本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/servicecatalog.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ExampleServiceCatalog_RejectPortfolioShare
func ExampleServiceCatalog_RejectPortfolioShare() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.RejectPortfolioShareInput{
PortfolioId: aws.String("Id"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
}
resp, err := svc.RejectPortfolioShare(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例2: ExampleServiceCatalog_CreateConstraint
func ExampleServiceCatalog_CreateConstraint() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.CreateConstraintInput{
IdempotencyToken: aws.String("IdempotencyToken"), // Required
Parameters: aws.String("ConstraintParameters"), // Required
PortfolioId: aws.String("Id"), // Required
ProductId: aws.String("Id"), // Required
Type: aws.String("ConstraintType"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
Description: aws.String("ConstraintDescription"),
}
resp, err := svc.CreateConstraint(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例3: ExampleServiceCatalog_ListRecordHistory
func ExampleServiceCatalog_ListRecordHistory() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.ListRecordHistoryInput{
AcceptLanguage: aws.String("AcceptLanguage"),
AccessLevelFilter: &servicecatalog.AccessLevelFilter{
Key: aws.String("AccessLevelFilterKey"),
Value: aws.String("AccessLevelFilterValue"),
},
PageSize: aws.Int64(1),
PageToken: aws.String("PageToken"),
SearchFilter: &servicecatalog.ListRecordHistorySearchFilter{
Key: aws.String("SearchFilterKey"),
Value: aws.String("SearchFilterValue"),
},
}
resp, err := svc.ListRecordHistory(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例4: ExampleServiceCatalog_DescribeProvisioningParameters
func ExampleServiceCatalog_DescribeProvisioningParameters() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.DescribeProvisioningParametersInput{
ProductId: aws.String("Id"), // Required
ProvisioningArtifactId: aws.String("Id"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
PathId: aws.String("Id"),
}
resp, err := svc.DescribeProvisioningParameters(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例5: ExampleServiceCatalog_ListPrincipalsForPortfolio
func ExampleServiceCatalog_ListPrincipalsForPortfolio() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.ListPrincipalsForPortfolioInput{
PortfolioId: aws.String("Id"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
PageSize: aws.Int64(1),
PageToken: aws.String("PageToken"),
}
resp, err := svc.ListPrincipalsForPortfolio(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例6: ExampleServiceCatalog_CreatePortfolio
func ExampleServiceCatalog_CreatePortfolio() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.CreatePortfolioInput{
DisplayName: aws.String("PortfolioDisplayName"), // Required
IdempotencyToken: aws.String("IdempotencyToken"), // Required
ProviderName: aws.String("ProviderName"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
Description: aws.String("PortfolioDescription"),
Tags: []*servicecatalog.Tag{
{ // Required
Key: aws.String("TagKey"), // Required
Value: aws.String("TagValue"), // Required
},
// More values...
},
}
resp, err := svc.CreatePortfolio(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例7: ExampleServiceCatalog_CreateProvisioningArtifact
func ExampleServiceCatalog_CreateProvisioningArtifact() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.CreateProvisioningArtifactInput{
IdempotencyToken: aws.String("IdempotencyToken"), // Required
Parameters: &servicecatalog.ProvisioningArtifactProperties{ // Required
Info: map[string]*string{ // Required
"Key": aws.String("ProvisioningArtifactInfoValue"), // Required
// More values...
},
Description: aws.String("ProvisioningArtifactDescription"),
Name: aws.String("ProvisioningArtifactName"),
Type: aws.String("ProvisioningArtifactType"),
},
ProductId: aws.String("Id"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
}
resp, err := svc.CreateProvisioningArtifact(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例8: ExampleServiceCatalog_TerminateProvisionedProduct
func ExampleServiceCatalog_TerminateProvisionedProduct() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.TerminateProvisionedProductInput{
TerminateToken: aws.String("IdempotencyToken"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
IgnoreErrors: aws.Bool(true),
ProvisionedProductId: aws.String("Id"),
ProvisionedProductName: aws.String("ProvisionedProductNameOrArn"),
}
resp, err := svc.TerminateProvisionedProduct(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例9: ExampleServiceCatalog_SearchProducts
func ExampleServiceCatalog_SearchProducts() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.SearchProductsInput{
AcceptLanguage: aws.String("AcceptLanguage"),
Filters: map[string][]*string{
"Key": { // Required
aws.String("ProductViewFilterValue"), // Required
// More values...
},
// More values...
},
PageSize: aws.Int64(1),
PageToken: aws.String("PageToken"),
SortBy: aws.String("ProductViewSortBy"),
SortOrder: aws.String("SortOrder"),
}
resp, err := svc.SearchProducts(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例10: ExampleServiceCatalog_UpdateProvisionedProduct
func ExampleServiceCatalog_UpdateProvisionedProduct() {
svc := servicecatalog.New(session.New())
params := &servicecatalog.UpdateProvisionedProductInput{
UpdateToken: aws.String("IdempotencyToken"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
PathId: aws.String("Id"),
ProductId: aws.String("Id"),
ProvisionedProductId: aws.String("Id"),
ProvisionedProductName: aws.String("ProvisionedProductNameOrArn"),
ProvisioningArtifactId: aws.String("Id"),
ProvisioningParameters: []*servicecatalog.UpdateProvisioningParameter{
{ // Required
Key: aws.String("ParameterKey"),
UsePreviousValue: aws.Bool(true),
Value: aws.String("ParameterValue"),
},
// More values...
},
}
resp, err := svc.UpdateProvisionedProduct(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例11: ExampleServiceCatalog_ScanProvisionedProducts
func ExampleServiceCatalog_ScanProvisionedProducts() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.ScanProvisionedProductsInput{
AcceptLanguage: aws.String("AcceptLanguage"),
PageSize: aws.Int64(1),
PageToken: aws.String("PageToken"),
}
resp, err := svc.ScanProvisionedProducts(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例12: ExampleServiceCatalog_ProvisionProduct
func ExampleServiceCatalog_ProvisionProduct() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.ProvisionProductInput{
ProductId: aws.String("Id"), // Required
ProvisionToken: aws.String("IdempotencyToken"), // Required
ProvisionedProductName: aws.String("ProvisionedProductName"), // Required
ProvisioningArtifactId: aws.String("Id"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
NotificationArns: []*string{
aws.String("NotificationArn"), // Required
// More values...
},
PathId: aws.String("Id"),
ProvisioningParameters: []*servicecatalog.ProvisioningParameter{
{ // Required
Key: aws.String("ParameterKey"),
Value: aws.String("ParameterValue"),
},
// More values...
},
Tags: []*servicecatalog.Tag{
{ // Required
Key: aws.String("TagKey"), // Required
Value: aws.String("TagValue"), // Required
},
// More values...
},
}
resp, err := svc.ProvisionProduct(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例13: ExampleServiceCatalog_UpdateProduct
func ExampleServiceCatalog_UpdateProduct() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := servicecatalog.New(sess)
params := &servicecatalog.UpdateProductInput{
Id: aws.String("Id"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
AddTags: []*servicecatalog.Tag{
{ // Required
Key: aws.String("TagKey"), // Required
Value: aws.String("TagValue"), // Required
},
// More values...
},
Description: aws.String("ProductViewShortDescription"),
Distributor: aws.String("ProductViewOwner"),
Name: aws.String("ProductViewName"),
Owner: aws.String("ProductViewOwner"),
RemoveTags: []*string{
aws.String("TagKey"), // Required
// More values...
},
SupportDescription: aws.String("SupportDescription"),
SupportEmail: aws.String("SupportEmail"),
SupportUrl: aws.String("SupportUrl"),
}
resp, err := svc.UpdateProduct(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例14: ExampleServiceCatalog_DescribeProductView
func ExampleServiceCatalog_DescribeProductView() {
svc := servicecatalog.New(session.New())
params := &servicecatalog.DescribeProductViewInput{
Id: aws.String("Id"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
}
resp, err := svc.DescribeProductView(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例15: ExampleServiceCatalog_ListLaunchPaths
func ExampleServiceCatalog_ListLaunchPaths() {
svc := servicecatalog.New(session.New())
params := &servicecatalog.ListLaunchPathsInput{
ProductId: aws.String("Id"), // Required
AcceptLanguage: aws.String("AcceptLanguage"),
PageSize: aws.Int64(1),
PageToken: aws.String("PageToken"),
}
resp, err := svc.ListLaunchPaths(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}