func ExampleWorkSpaces_DescribeWorkspaces() {
	svc := workspaces.New(session.New())

	params := &workspaces.DescribeWorkspacesInput{
		BundleId:    aws.String("BundleId"),
		DirectoryId: aws.String("DirectoryId"),
		Limit:       aws.Int64(1),
		NextToken:   aws.String("PaginationToken"),
		UserName:    aws.String("UserName"),
		WorkspaceIds: []*string{
			aws.String("WorkspaceId"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeWorkspaces(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 ExampleWorkSpaces_CreateWorkspaces() {
	svc := workspaces.New(session.New())

	params := &workspaces.CreateWorkspacesInput{
		Workspaces: []*workspaces.WorkspaceRequest{ // Required
			{ // Required
				BundleId:                    aws.String("BundleId"),    // Required
				DirectoryId:                 aws.String("DirectoryId"), // Required
				UserName:                    aws.String("UserName"),    // Required
				RootVolumeEncryptionEnabled: aws.Bool(true),
				UserVolumeEncryptionEnabled: aws.Bool(true),
				VolumeEncryptionKey:         aws.String("VolumeEncryptionKey"),
			},
			// More values...
		},
	}
	resp, err := svc.CreateWorkspaces(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 ExampleWorkSpaces_TerminateWorkspaces() {
	svc := workspaces.New(session.New())

	params := &workspaces.TerminateWorkspacesInput{
		TerminateWorkspaceRequests: []*workspaces.TerminateRequest{ // Required
			{ // Required
				WorkspaceId: aws.String("WorkspaceId"), // Required
			},
			// More values...
		},
	}
	resp, err := svc.TerminateWorkspaces(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)
}
Exemple #4
0
func init() {
	Before("@workspaces", func() {
		World["client"] = workspaces.New(smoke.Session)
	})
}