Beispiel #1
0
func ExampleStorageGateway_DescribeMaintenanceStartTime() {
	svc := storagegateway.New(nil)

	params := &storagegateway.DescribeMaintenanceStartTimeInput{
		GatewayARN: aws.String("GatewayARN"), // Required
	}
	resp, err := svc.DescribeMaintenanceStartTime(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)
}
Beispiel #2
0
func ExampleStorageGateway_UpdateGatewaySoftwareNow() {
	svc := storagegateway.New(nil)

	params := &storagegateway.UpdateGatewaySoftwareNowInput{
		GatewayARN: aws.String("GatewayARN"), // Required
	}
	resp, err := svc.UpdateGatewaySoftwareNow(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)
}
Beispiel #3
0
func ExampleStorageGateway_DescribeChapCredentials() {
	svc := storagegateway.New(nil)

	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)
}
Beispiel #4
0
func ExampleStorageGateway_ListVolumeInitiators() {
	svc := storagegateway.New(nil)

	params := &storagegateway.ListVolumeInitiatorsInput{
		VolumeARN: aws.String("VolumeARN"), // Required
	}
	resp, err := svc.ListVolumeInitiators(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)
}
Beispiel #5
0
func ExampleStorageGateway_DeleteBandwidthRateLimit() {
	svc := storagegateway.New(nil)

	params := &storagegateway.DeleteBandwidthRateLimitInput{
		BandwidthType: aws.String("BandwidthType"), // Required
		GatewayARN:    aws.String("GatewayARN"),    // Required
	}
	resp, err := svc.DeleteBandwidthRateLimit(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)
}
Beispiel #6
0
func ExampleStorageGateway_RetrieveTapeRecoveryPoint() {
	svc := storagegateway.New(nil)

	params := &storagegateway.RetrieveTapeRecoveryPointInput{
		GatewayARN: aws.String("GatewayARN"), // Required
		TapeARN:    aws.String("TapeARN"),    // Required
	}
	resp, err := svc.RetrieveTapeRecoveryPoint(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)
}
Beispiel #7
0
func ExampleStorageGateway_CreateSnapshotFromVolumeRecoveryPoint() {
	svc := storagegateway.New(nil)

	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)
}
Beispiel #8
0
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 {
		// 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)
}
Beispiel #9
0
func ExampleStorageGateway_DescribeTapeRecoveryPoints() {
	svc := storagegateway.New(nil)

	params := &storagegateway.DescribeTapeRecoveryPointsInput{
		GatewayARN: aws.String("GatewayARN"), // Required
		Limit:      aws.Int64(1),
		Marker:     aws.String("Marker"),
	}
	resp, err := svc.DescribeTapeRecoveryPoints(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)
}
Beispiel #10
0
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 {
		// 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)
}
Beispiel #11
0
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 {
		// 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)
}
Beispiel #12
0
func ExampleStorageGateway_UpdateSnapshotSchedule() {
	svc := storagegateway.New(nil)

	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)
}
Beispiel #13
0
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 {
		// 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)
}
Beispiel #14
0
func ExampleStorageGateway_DescribeStorediSCSIVolumes() {
	svc := storagegateway.New(nil)

	params := &storagegateway.DescribeStorediSCSIVolumesInput{
		VolumeARNs: []*string{ // Required
			aws.String("VolumeARN"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeStorediSCSIVolumes(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)
}
Beispiel #15
0
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 {
		// 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)
}
Beispiel #16
0
func ExampleStorageGateway_AddWorkingStorage() {
	svc := storagegateway.New(nil)

	params := &storagegateway.AddWorkingStorageInput{
		DiskIds: []*string{ // Required
			aws.String("DiskId"), // Required
			// More values...
		},
		GatewayARN: aws.String("GatewayARN"), // Required
	}
	resp, err := svc.AddWorkingStorage(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)
}
Beispiel #17
0
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 {
		// 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)
}
Beispiel #18
0
func ExampleStorageGateway_DescribeTapeArchives() {
	svc := storagegateway.New(nil)

	params := &storagegateway.DescribeTapeArchivesInput{
		Limit:  aws.Int64(1),
		Marker: aws.String("Marker"),
		TapeARNs: []*string{
			aws.String("TapeARN"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeTapeArchives(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)
}
Beispiel #19
0
func ExampleStorageGateway_CreateCachediSCSIVolume() {
	svc := storagegateway.New(nil)

	params := &storagegateway.CreateCachediSCSIVolumeInput{
		ClientToken:        aws.String("ClientToken"),        // Required
		GatewayARN:         aws.String("GatewayARN"),         // Required
		NetworkInterfaceId: aws.String("NetworkInterfaceId"), // Required
		TargetName:         aws.String("TargetName"),         // Required
		VolumeSizeInBytes:  aws.Int64(1),                     // Required
		SnapshotId:         aws.String("SnapshotId"),
	}
	resp, err := svc.CreateCachediSCSIVolume(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)
}
Beispiel #20
0
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 {
		// 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)
}
Beispiel #21
0
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 {
		// 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)
}
Beispiel #22
0
func TestInterface(t *testing.T) {
	assert.Implements(t, (*storagegatewayiface.StorageGatewayAPI)(nil), storagegateway.New(nil))
}
Beispiel #23
0
func init() {
	Before("@storagegateway", func() {
		World["client"] = storagegateway.New(nil)
	})
}