Exemplo n.º 1
0
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)
}
Exemplo n.º 2
0
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)
}
Exemplo n.º 3
0
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)
}
Exemplo n.º 4
0
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)
}
Exemplo n.º 5
0
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)
}
Exemplo n.º 6
0
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)
}
Exemplo n.º 7
0
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)
}
Exemplo n.º 8
0
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)
}
Exemplo n.º 9
0
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)
}
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)
}
Exemplo n.º 11
0
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)
}
Exemplo n.º 12
0
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)
}
Exemplo n.º 13
0
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)
}
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)
}
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)
}