func ExampleStorageGateway_DescribeVTLDevices() { svc := storagegateway.New(nil) params := &storagegateway.DescribeVTLDevicesInput{ GatewayARN: aws.String("GatewayARN"), // Required Limit: aws.Long(1), Marker: aws.String("Marker"), VTLDeviceARNs: []*string{ aws.String("VTLDeviceARN"), // Required // More values... }, } resp, err := svc.DescribeVTLDevices(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS Error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, the SDK should always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleStorageGateway_AddCache() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.AddCacheInput{ DiskIds: []*string{ // Required aws.String("DiskId"), // Required // More values... }, GatewayARN: aws.String("GatewayARN"), // Required } resp, err := svc.AddCache(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 ExampleStorageGateway_ListGateways() { svc := storagegateway.New(nil) params := &storagegateway.ListGatewaysInput{ Limit: aws.Int64(1), Marker: aws.String("Marker"), } resp, err := svc.ListGateways(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, the SDK should always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.Prettify(resp)) }
func ExampleStorageGateway_UpdateGatewayInformation() { svc := storagegateway.New(nil) params := &storagegateway.UpdateGatewayInformationInput{ GatewayARN: aws.String("GatewayARN"), // Required GatewayName: aws.String("GatewayName"), GatewayTimezone: aws.String("GatewayTimezone"), } resp, err := svc.UpdateGatewayInformation(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS Error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, the SDK should always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleStorageGateway_DescribeSnapshotSchedule() { svc := storagegateway.New(nil) params := &storagegateway.DescribeSnapshotScheduleInput{ VolumeARN: aws.String("VolumeARN"), // Required } resp, err := svc.DescribeSnapshotSchedule(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, the SDK should always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.Prettify(resp)) }
func ExampleStorageGateway_AddTagsToResource() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.AddTagsToResourceInput{ ResourceARN: aws.String("ResourceARN"), // Required Tags: []*storagegateway.Tag{ // Required { // Required Key: aws.String("TagKey"), // Required Value: aws.String("TagValue"), // Required }, // More values... }, } resp, err := svc.AddTagsToResource(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 ExampleStorageGateway_DescribeVTLDevices() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.DescribeVTLDevicesInput{ GatewayARN: aws.String("GatewayARN"), // Required Limit: aws.Int64(1), Marker: aws.String("Marker"), VTLDeviceARNs: []*string{ aws.String("VTLDeviceARN"), // Required // More values... }, } resp, err := svc.DescribeVTLDevices(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 ExampleStorageGateway_UpdateBandwidthRateLimit() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.UpdateBandwidthRateLimitInput{ GatewayARN: aws.String("GatewayARN"), // Required AverageDownloadRateLimitInBitsPerSec: aws.Int64(1), AverageUploadRateLimitInBitsPerSec: aws.Int64(1), } resp, err := svc.UpdateBandwidthRateLimit(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 ExampleStorageGateway_DescribeCachediSCSIVolumes() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.DescribeCachediSCSIVolumesInput{ VolumeARNs: []*string{ // Required aws.String("VolumeARN"), // Required // More values... }, } resp, err := svc.DescribeCachediSCSIVolumes(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 ExampleStorageGateway_ActivateGateway() { svc := storagegateway.New(nil) params := &storagegateway.ActivateGatewayInput{ ActivationKey: aws.String("ActivationKey"), // Required GatewayName: aws.String("GatewayName"), // Required GatewayRegion: aws.String("RegionId"), // Required GatewayTimezone: aws.String("GatewayTimezone"), // Required GatewayType: aws.String("GatewayType"), MediumChangerType: aws.String("MediumChangerType"), TapeDriveType: aws.String("TapeDriveType"), } resp, err := svc.ActivateGateway(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, the SDK should always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.Prettify(resp)) }
func ExampleStorageGateway_CreateTapes() { svc := storagegateway.New(nil) params := &storagegateway.CreateTapesInput{ ClientToken: aws.String("ClientToken"), // Required GatewayARN: aws.String("GatewayARN"), // Required NumTapesToCreate: aws.Int64(1), // Required TapeBarcodePrefix: aws.String("TapeBarcodePrefix"), // Required TapeSizeInBytes: aws.Int64(1), // Required } resp, err := svc.CreateTapes(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, the SDK should always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.Prettify(resp)) }
func ExampleStorageGateway_CreateSnapshotFromVolumeRecoveryPoint() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.CreateSnapshotFromVolumeRecoveryPointInput{ SnapshotDescription: aws.String("SnapshotDescription"), // Required VolumeARN: aws.String("VolumeARN"), // Required } resp, err := svc.CreateSnapshotFromVolumeRecoveryPoint(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 ExampleStorageGateway_UpdateChapCredentials() { svc := storagegateway.New(nil) params := &storagegateway.UpdateChapCredentialsInput{ InitiatorName: aws.String("IqnName"), // Required SecretToAuthenticateInitiator: aws.String("ChapSecret"), // Required TargetARN: aws.String("TargetARN"), // Required SecretToAuthenticateTarget: aws.String("ChapSecret"), } resp, err := svc.UpdateChapCredentials(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, the SDK should always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.Prettify(resp)) }
func ExampleStorageGateway_UpdateSnapshotSchedule() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.UpdateSnapshotScheduleInput{ RecurrenceInHours: aws.Int64(1), // Required StartAt: aws.Int64(1), // Required VolumeARN: aws.String("VolumeARN"), // Required Description: aws.String("Description"), } resp, err := svc.UpdateSnapshotSchedule(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 ExampleStorageGateway_ActivateGateway() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.ActivateGatewayInput{ ActivationKey: aws.String("ActivationKey"), // Required GatewayName: aws.String("GatewayName"), // Required GatewayRegion: aws.String("RegionId"), // Required GatewayTimezone: aws.String("GatewayTimezone"), // Required GatewayType: aws.String("GatewayType"), MediumChangerType: aws.String("MediumChangerType"), TapeDriveType: aws.String("TapeDriveType"), } resp, err := svc.ActivateGateway(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 ExampleStorageGateway_UpdateMaintenanceStartTime() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.UpdateMaintenanceStartTimeInput{ DayOfWeek: aws.Int64(1), // Required GatewayARN: aws.String("GatewayARN"), // Required HourOfDay: aws.Int64(1), // Required MinuteOfHour: aws.Int64(1), // Required } resp, err := svc.UpdateMaintenanceStartTime(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 ExampleStorageGateway_UpdateGatewayInformation() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.UpdateGatewayInformationInput{ GatewayARN: aws.String("GatewayARN"), // Required GatewayName: aws.String("GatewayName"), GatewayTimezone: aws.String("GatewayTimezone"), } resp, err := svc.UpdateGatewayInformation(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 ExampleStorageGateway_UpdateChapCredentials() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.UpdateChapCredentialsInput{ InitiatorName: aws.String("IqnName"), // Required SecretToAuthenticateInitiator: aws.String("ChapSecret"), // Required TargetARN: aws.String("TargetARN"), // Required SecretToAuthenticateTarget: aws.String("ChapSecret"), } resp, err := svc.UpdateChapCredentials(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 ExampleStorageGateway_ListGateways() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.ListGatewaysInput{ Limit: aws.Int64(1), Marker: aws.String("Marker"), } resp, err := svc.ListGateways(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 ExampleStorageGateway_CreateStorediSCSIVolume() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.CreateStorediSCSIVolumeInput{ DiskId: aws.String("DiskId"), // Required GatewayARN: aws.String("GatewayARN"), // Required NetworkInterfaceId: aws.String("NetworkInterfaceId"), // Required PreserveExistingData: aws.Bool(true), // Required TargetName: aws.String("TargetName"), // Required SnapshotId: aws.String("SnapshotId"), } resp, err := svc.CreateStorediSCSIVolume(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 ExampleStorageGateway_UpdateBandwidthRateLimit() { svc := storagegateway.New(nil) params := &storagegateway.UpdateBandwidthRateLimitInput{ GatewayARN: aws.String("GatewayARN"), // Required AverageDownloadRateLimitInBitsPerSec: aws.Int64(1), AverageUploadRateLimitInBitsPerSec: aws.Int64(1), } resp, err := svc.UpdateBandwidthRateLimit(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, the SDK should always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.Prettify(resp)) }
func ExampleStorageGateway_CreateTapes() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.CreateTapesInput{ ClientToken: aws.String("ClientToken"), // Required GatewayARN: aws.String("GatewayARN"), // Required NumTapesToCreate: aws.Int64(1), // Required TapeBarcodePrefix: aws.String("TapeBarcodePrefix"), // Required TapeSizeInBytes: aws.Int64(1), // Required } resp, err := svc.CreateTapes(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 ExampleStorageGateway_UpdateMaintenanceStartTime() { svc := storagegateway.New(nil) params := &storagegateway.UpdateMaintenanceStartTimeInput{ DayOfWeek: aws.Int64(1), // Required GatewayARN: aws.String("GatewayARN"), // Required HourOfDay: aws.Int64(1), // Required MinuteOfHour: aws.Int64(1), // Required } resp, err := svc.UpdateMaintenanceStartTime(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, the SDK should always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.Prettify(resp)) }
func ExampleStorageGateway_AddUploadBuffer() { svc := storagegateway.New(nil) params := &storagegateway.AddUploadBufferInput{ DiskIds: []*string{ // Required aws.String("DiskId"), // Required // More values... }, GatewayARN: aws.String("GatewayARN"), // Required } resp, err := svc.AddUploadBuffer(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, the SDK should always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.Prettify(resp)) }
func ExampleStorageGateway_CreateStorediSCSIVolume() { svc := storagegateway.New(nil) params := &storagegateway.CreateStorediSCSIVolumeInput{ DiskId: aws.String("DiskId"), // Required GatewayARN: aws.String("GatewayARN"), // Required NetworkInterfaceId: aws.String("NetworkInterfaceId"), // Required PreserveExistingData: aws.Bool(true), // Required TargetName: aws.String("TargetName"), // Required SnapshotId: aws.String("SnapshotId"), } resp, err := svc.CreateStorediSCSIVolume(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, the SDK should always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.Prettify(resp)) }
func ExampleStorageGateway_DeleteTape() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := storagegateway.New(sess) params := &storagegateway.DeleteTapeInput{ GatewayARN: aws.String("GatewayARN"), // Required TapeARN: aws.String("TapeARN"), // Required } resp, err := svc.DeleteTape(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 ExampleStorageGateway_DescribeSnapshotSchedule() { svc := storagegateway.New(session.New()) params := &storagegateway.DescribeSnapshotScheduleInput{ VolumeARN: aws.String("VolumeARN"), // Required } resp, err := svc.DescribeSnapshotSchedule(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 ExampleStorageGateway_ResetCache() { svc := storagegateway.New(session.New()) params := &storagegateway.ResetCacheInput{ GatewayARN: aws.String("GatewayARN"), // Required } resp, err := svc.ResetCache(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 ExampleStorageGateway_ListVolumeRecoveryPoints() { svc := storagegateway.New(nil) params := &storagegateway.ListVolumeRecoveryPointsInput{ GatewayARN: aws.String("GatewayARN"), // Required } resp, err := svc.ListVolumeRecoveryPoints(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 ExampleStorageGateway_DescribeChapCredentials() { svc := storagegateway.New(session.New()) params := &storagegateway.DescribeChapCredentialsInput{ TargetARN: aws.String("TargetARN"), // Required } resp, err := svc.DescribeChapCredentials(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) }