armstorageimportexport

package module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 15 Imported by: 1

README

Azure Storage Import/Export Module for Go

PkgGoDev

The armstorageimportexport module provides operations for working with Azure Storage Import/Export.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Storage Import/Export module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Storage Import/Export. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Storage Import/Export module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armstorageimportexport.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armstorageimportexport.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewJobsClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Storage Import/Export label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitLockerKeysClient

type BitLockerKeysClient struct {
	// contains filtered or unexported fields
}

BitLockerKeysClient contains the methods for the BitLockerKeys group. Don't use this type directly, use NewBitLockerKeysClient() instead.

func NewBitLockerKeysClient

func NewBitLockerKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BitLockerKeysClient, error)

NewBitLockerKeysClient creates a new instance of BitLockerKeysClient with the specified values.

  • subscriptionID - The subscription ID for the Azure user.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*BitLockerKeysClient) NewListPager added in v0.4.0

func (client *BitLockerKeysClient) NewListPager(jobName string, resourceGroupName string, options *BitLockerKeysClientListOptions) *runtime.Pager[BitLockerKeysClientListResponse]

NewListPager - Returns the BitLocker Keys for all drives in the specified job.

Generated from API version 2021-01-01

  • jobName - The name of the import/export job.
  • resourceGroupName - The resource group name uniquely identifies the resource group within the user subscription.
  • options - BitLockerKeysClientListOptions contains the optional parameters for the BitLockerKeysClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/ListBitLockerKeys.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewBitLockerKeysClient().NewListPager("myJob", "myResourceGroup", &armstorageimportexport.BitLockerKeysClientListOptions{AcceptLanguage: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.GetBitLockerKeysResponse = armstorageimportexport.GetBitLockerKeysResponse{
		// 	Value: []*armstorageimportexport.DriveBitLockerKey{
		// 		{
		// 			BitLockerKey: to.Ptr("000000-000000-111111-222222-333333-444444-555555-666666"),
		// 			DriveID: to.Ptr("9CA995BB"),
		// 	}},
		// }
	}
}
Output:

type BitLockerKeysClientListOptions added in v0.2.0

type BitLockerKeysClientListOptions struct {
	// Specifies the preferred language for the response.
	AcceptLanguage *string
}

BitLockerKeysClientListOptions contains the optional parameters for the BitLockerKeysClient.NewListPager method.

type BitLockerKeysClientListResponse added in v0.2.0

type BitLockerKeysClientListResponse struct {
	// GetBitLockerKeys response
	GetBitLockerKeysResponse
}

BitLockerKeysClientListResponse contains the response from method BitLockerKeysClient.NewListPager.

type ClientFactory added in v0.6.0

type ClientFactory struct {
	// contains filtered or unexported fields
}

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v0.6.0

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • subscriptionID - The subscription ID for the Azure user.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewBitLockerKeysClient added in v0.6.0

func (c *ClientFactory) NewBitLockerKeysClient() *BitLockerKeysClient

NewBitLockerKeysClient creates a new instance of BitLockerKeysClient.

func (*ClientFactory) NewJobsClient added in v0.6.0

func (c *ClientFactory) NewJobsClient() *JobsClient

NewJobsClient creates a new instance of JobsClient.

func (*ClientFactory) NewLocationsClient added in v0.6.0

func (c *ClientFactory) NewLocationsClient() *LocationsClient

NewLocationsClient creates a new instance of LocationsClient.

func (*ClientFactory) NewOperationsClient added in v0.6.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type DeliveryPackageInformation

type DeliveryPackageInformation struct {
	// REQUIRED; The name of the carrier that is used to ship the import or export drives.
	CarrierName *string

	// REQUIRED; The tracking number of the package.
	TrackingNumber *string

	// The number of drives included in the package.
	DriveCount *int64

	// The date when the package is shipped.
	ShipDate *string
}

DeliveryPackageInformation - Contains information about the delivery package being shipped by the customer to the Microsoft data center.

func (DeliveryPackageInformation) MarshalJSON added in v0.6.0

func (d DeliveryPackageInformation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeliveryPackageInformation.

func (*DeliveryPackageInformation) UnmarshalJSON added in v0.6.0

func (d *DeliveryPackageInformation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryPackageInformation.

type DriveBitLockerKey

type DriveBitLockerKey struct {
	// BitLocker recovery key or password
	BitLockerKey *string

	// Drive ID
	DriveID *string
}

DriveBitLockerKey - BitLocker recovery key or password to the specified drive

func (DriveBitLockerKey) MarshalJSON added in v0.6.0

func (d DriveBitLockerKey) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DriveBitLockerKey.

func (*DriveBitLockerKey) UnmarshalJSON added in v0.6.0

func (d *DriveBitLockerKey) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DriveBitLockerKey.

type DriveState

type DriveState string

DriveState - The drive's current state.

const (
	DriveStateCompleted         DriveState = "Completed"
	DriveStateCompletedMoreInfo DriveState = "CompletedMoreInfo"
	DriveStateNeverReceived     DriveState = "NeverReceived"
	DriveStateReceived          DriveState = "Received"
	DriveStateShippedBack       DriveState = "ShippedBack"
	DriveStateSpecified         DriveState = "Specified"
	DriveStateTransferring      DriveState = "Transferring"
)

func PossibleDriveStateValues

func PossibleDriveStateValues() []DriveState

PossibleDriveStateValues returns the possible values for the DriveState const type.

type DriveStatus

type DriveStatus struct {
	// The BitLocker key used to encrypt the drive.
	BitLockerKey *string

	// Bytes successfully transferred for the drive.
	BytesSucceeded *int64

	// Detailed status about the data transfer process. This field is not returned in the response until the drive is in the Transferring
	// state.
	CopyStatus *string

	// The drive header hash value.
	DriveHeaderHash *string

	// The drive's hardware serial number, without spaces.
	DriveID *string

	// A URI that points to the blob containing the error log for the data transfer operation.
	ErrorLogURI *string

	// The relative path of the manifest file on the drive.
	ManifestFile *string

	// The Base16-encoded MD5 hash of the manifest file on the drive.
	ManifestHash *string

	// A URI that points to the blob containing the drive manifest file.
	ManifestURI *string

	// Percentage completed for the drive.
	PercentComplete *int64

	// The drive's current state.
	State *DriveState

	// A URI that points to the blob containing the verbose log for the data transfer operation.
	VerboseLogURI *string
}

DriveStatus - Provides information about the drive's status

func (DriveStatus) MarshalJSON added in v0.6.0

func (d DriveStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DriveStatus.

func (*DriveStatus) UnmarshalJSON added in v0.6.0

func (d *DriveStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DriveStatus.

type EncryptionKekType

type EncryptionKekType string

EncryptionKekType - The type of kek encryption key

const (
	EncryptionKekTypeCustomerManaged  EncryptionKekType = "CustomerManaged"
	EncryptionKekTypeMicrosoftManaged EncryptionKekType = "MicrosoftManaged"
)

func PossibleEncryptionKekTypeValues

func PossibleEncryptionKekTypeValues() []EncryptionKekType

PossibleEncryptionKekTypeValues returns the possible values for the EncryptionKekType const type.

type EncryptionKeyDetails

type EncryptionKeyDetails struct {
	// The type of kek encryption key
	KekType *EncryptionKekType

	// Specifies the url for kek encryption key.
	KekURL *string

	// Specifies the keyvault resource id for kek encryption key.
	KekVaultResourceID *string
}

EncryptionKeyDetails - Specifies the encryption key properties

func (EncryptionKeyDetails) MarshalJSON added in v0.6.0

func (e EncryptionKeyDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EncryptionKeyDetails.

func (*EncryptionKeyDetails) UnmarshalJSON added in v0.6.0

func (e *EncryptionKeyDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionKeyDetails.

type ErrorResponse

type ErrorResponse struct {
	// Describes the error information.
	Error *ErrorResponseError
}

ErrorResponse - Response when errors occurred

func (ErrorResponse) MarshalJSON added in v0.6.0

func (e ErrorResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v0.6.0

func (e *ErrorResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ErrorResponseError

type ErrorResponseError struct {
	// Provides information about the error code.
	Code *string

	// Describes the error details if present.
	Details []*ErrorResponseErrorDetailsItem

	// Inner error object if present.
	Innererror any

	// Provides information about the error message.
	Message *string

	// Provides information about the error target.
	Target *string
}

ErrorResponseError - Describes the error information.

func (ErrorResponseError) MarshalJSON

func (e ErrorResponseError) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponseError.

func (*ErrorResponseError) UnmarshalJSON added in v0.6.0

func (e *ErrorResponseError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseError.

type ErrorResponseErrorDetailsItem

type ErrorResponseErrorDetailsItem struct {
	// Provides information about the error code.
	Code *string

	// Provides information about the error message.
	Message *string

	// Provides information about the error target.
	Target *string
}

func (ErrorResponseErrorDetailsItem) MarshalJSON added in v0.6.0

func (e ErrorResponseErrorDetailsItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponseErrorDetailsItem.

func (*ErrorResponseErrorDetailsItem) UnmarshalJSON added in v0.6.0

func (e *ErrorResponseErrorDetailsItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseErrorDetailsItem.

type Export

type Export struct {
	// A list of the blobs to be exported.
	BlobList *ExportBlobList

	// The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning
	// with the container name. If the blob is in root container, the URI must begin
	// with $root.
	BlobListBlobPath *string
}

Export - A property containing information about the blobs to be exported for an export job. This property is required for export jobs, but must not be specified for import jobs.

func (Export) MarshalJSON added in v0.6.0

func (e Export) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Export.

func (*Export) UnmarshalJSON added in v0.6.0

func (e *Export) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Export.

type ExportBlobList

type ExportBlobList struct {
	// A collection of blob-path strings.
	BlobPath []*string

	// A collection of blob-prefix strings.
	BlobPathPrefix []*string
}

ExportBlobList - A list of the blobs to be exported.

func (ExportBlobList) MarshalJSON

func (e ExportBlobList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportBlobList.

func (*ExportBlobList) UnmarshalJSON added in v0.6.0

func (e *ExportBlobList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportBlobList.

type GetBitLockerKeysResponse

type GetBitLockerKeysResponse struct {
	// drive status
	Value []*DriveBitLockerKey
}

GetBitLockerKeysResponse - GetBitLockerKeys response

func (GetBitLockerKeysResponse) MarshalJSON

func (g GetBitLockerKeysResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GetBitLockerKeysResponse.

func (*GetBitLockerKeysResponse) UnmarshalJSON added in v0.6.0

func (g *GetBitLockerKeysResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GetBitLockerKeysResponse.

type IdentityDetails

type IdentityDetails struct {
	// The type of identity
	Type *IdentityType

	// READ-ONLY; Specifies the principal id for the identity for the job.
	PrincipalID *string

	// READ-ONLY; Specifies the tenant id for the identity for the job.
	TenantID *string
}

IdentityDetails - Specifies the identity properties.

func (IdentityDetails) MarshalJSON added in v0.6.0

func (i IdentityDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IdentityDetails.

func (*IdentityDetails) UnmarshalJSON added in v0.6.0

func (i *IdentityDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IdentityDetails.

type IdentityType

type IdentityType string

IdentityType - The type of identity

const (
	IdentityTypeNone           IdentityType = "None"
	IdentityTypeSystemAssigned IdentityType = "SystemAssigned"
	IdentityTypeUserAssigned   IdentityType = "UserAssigned"
)

func PossibleIdentityTypeValues

func PossibleIdentityTypeValues() []IdentityType

PossibleIdentityTypeValues returns the possible values for the IdentityType const type.

type JobDetails

type JobDetails struct {
	// Default value is false. Indicates whether the manifest files on the drives should be copied to block blobs.
	BackupDriveManifest *bool

	// Indicates whether a request has been submitted to cancel the job.
	CancelRequested *bool

	// Contains information about the package being shipped by the customer to the Microsoft data center.
	DeliveryPackage *DeliveryPackageInformation

	// The virtual blob directory to which the copy logs and backups of drive manifest files (if enabled) will be stored.
	DiagnosticsPath *string

	// List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified
	// for export jobs.
	DriveList []*DriveStatus

	// Contains information about the encryption key.
	EncryptionKey *EncryptionKeyDetails

	// A property containing information about the blobs to be exported for an export job. This property is included for export
	// jobs only.
	Export *Export

	// A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive
	// space. If all blobs were exported successfully, then this element is not
	// included in the response.
	IncompleteBlobListURI *string

	// The type of job
	JobType *string

	// Default value is Error. Indicates whether error logging or verbose logging will be enabled.
	LogLevel *string

	// Overall percentage completed for the job.
	PercentComplete *int64

	// Specifies the provisioning state of the job.
	ProvisioningState *string

	// Specifies the return address information for the job.
	ReturnAddress *ReturnAddress

	// Contains information about the package being shipped from the Microsoft data center to the customer to return the drives.
	// The format is the same as the deliveryPackage property above. This property is
	// not included if the drives have not yet been returned.
	ReturnPackage *PackageInformation

	// Specifies the return carrier and customer's account with the carrier.
	ReturnShipping *ReturnShipping

	// Contains information about the Microsoft datacenter to which the drives should be shipped.
	ShippingInformation *ShippingInformation

	// Current state of the job.
	State *string

	// The resource identifier of the storage account where data will be imported to or exported from.
	StorageAccountID *string
}

JobDetails - Specifies the job properties

func (JobDetails) MarshalJSON

func (j JobDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobDetails.

func (*JobDetails) UnmarshalJSON added in v0.6.0

func (j *JobDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type JobDetails.

type JobResponse

type JobResponse struct {
	// Specifies the job identity details
	Identity *IdentityDetails

	// Specifies the Azure location where the job is created.
	Location *string

	// Specifies the job properties
	Properties *JobDetails

	// Specifies the tags that are assigned to the job.
	Tags any

	// READ-ONLY; Specifies the resource identifier of the job.
	ID *string

	// READ-ONLY; Specifies the name of the job.
	Name *string

	// READ-ONLY; SystemData of ImportExport Jobs.
	SystemData *SystemData

	// READ-ONLY; Specifies the type of the job resource.
	Type *string
}

JobResponse - Contains the job information.

func (JobResponse) MarshalJSON added in v0.6.0

func (j JobResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobResponse.

func (*JobResponse) UnmarshalJSON added in v0.6.0

func (j *JobResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type JobResponse.

type JobsClient

type JobsClient struct {
	// contains filtered or unexported fields
}

JobsClient contains the methods for the Jobs group. Don't use this type directly, use NewJobsClient() instead.

func NewJobsClient

func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobsClient, error)

NewJobsClient creates a new instance of JobsClient with the specified values.

  • subscriptionID - The subscription ID for the Azure user.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*JobsClient) Create

func (client *JobsClient) Create(ctx context.Context, jobName string, resourceGroupName string, body PutJobParameters, options *JobsClientCreateOptions) (JobsClientCreateResponse, error)

Create - Creates a new job or updates an existing job in the specified subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-01-01

  • jobName - The name of the import/export job.
  • resourceGroupName - The resource group name uniquely identifies the resource group within the user subscription.
  • body - The parameters used for creating the job
  • options - JobsClientCreateOptions contains the optional parameters for the JobsClient.Create method.
Example (CreateExportJob)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/CreateExportJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewJobsClient().Create(ctx, "myExportJob", "myResourceGroup", armstorageimportexport.PutJobParameters{
		Location: to.Ptr("West US"),
		Properties: &armstorageimportexport.JobDetails{
			BackupDriveManifest: to.Ptr(true),
			DiagnosticsPath:     to.Ptr("waimportexport"),
			Export: &armstorageimportexport.Export{
				BlobList: &armstorageimportexport.ExportBlobList{
					BlobPathPrefix: []*string{
						to.Ptr("/")},
				},
			},
			JobType:  to.Ptr("Export"),
			LogLevel: to.Ptr("Verbose"),
			ReturnAddress: &armstorageimportexport.ReturnAddress{
				City:            to.Ptr("Redmond"),
				CountryOrRegion: to.Ptr("USA"),
				Email:           to.Ptr("Test@contoso.com"),
				Phone:           to.Ptr("4250000000"),
				PostalCode:      to.Ptr("98007"),
				RecipientName:   to.Ptr("Test"),
				StateOrProvince: to.Ptr("wa"),
				StreetAddress1:  to.Ptr("Street1"),
				StreetAddress2:  to.Ptr("street2"),
			},
			ReturnShipping: &armstorageimportexport.ReturnShipping{
				CarrierAccountNumber: to.Ptr("989ffff"),
				CarrierName:          to.Ptr("FedEx"),
			},
			StorageAccountID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/test"),
		},
	}, &armstorageimportexport.JobsClientCreateOptions{AcceptLanguage: nil,
		ClientTenantID: nil,
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.JobResponse = armstorageimportexport.JobResponse{
	// 	Name: to.Ptr("myExportJob"),
	// 	Type: to.Ptr("Microsoft.ImportExport/jobs"),
	// 	ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ImportExport/jobs/myExportJob"),
	// 	Identity: &armstorageimportexport.IdentityDetails{
	// 		Type: to.Ptr(armstorageimportexport.IdentityTypeNone),
	// 	},
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armstorageimportexport.JobDetails{
	// 		BackupDriveManifest: to.Ptr(true),
	// 		CancelRequested: to.Ptr(false),
	// 		DiagnosticsPath: to.Ptr("waimportexport"),
	// 		EncryptionKey: &armstorageimportexport.EncryptionKeyDetails{
	// 			KekType: to.Ptr(armstorageimportexport.EncryptionKekTypeMicrosoftManaged),
	// 		},
	// 		Export: &armstorageimportexport.Export{
	// 			BlobList: &armstorageimportexport.ExportBlobList{
	// 				BlobPathPrefix: []*string{
	// 					to.Ptr("/")},
	// 				},
	// 			},
	// 			JobType: to.Ptr("Export"),
	// 			LogLevel: to.Ptr("Verbose"),
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 			ReturnAddress: &armstorageimportexport.ReturnAddress{
	// 				City: to.Ptr("Redmond"),
	// 				CountryOrRegion: to.Ptr("USA"),
	// 				Email: to.Ptr("Test@contoso.com"),
	// 				Phone: to.Ptr("4250000000"),
	// 				PostalCode: to.Ptr("98007"),
	// 				RecipientName: to.Ptr("Test"),
	// 				StateOrProvince: to.Ptr("wa"),
	// 				StreetAddress1: to.Ptr("Street1"),
	// 				StreetAddress2: to.Ptr("street2"),
	// 			},
	// 			ReturnShipping: &armstorageimportexport.ReturnShipping{
	// 				CarrierAccountNumber: to.Ptr("989ffff"),
	// 				CarrierName: to.Ptr("FedEx"),
	// 			},
	// 			ShippingInformation: &armstorageimportexport.ShippingInformation{
	// 				AdditionalInformation: to.Ptr(""),
	// 				City: to.Ptr("Santa Clara"),
	// 				CountryOrRegion: to.Ptr("USA"),
	// 				Phone: to.Ptr("408 0000 0000"),
	// 				PostalCode: to.Ptr("95050"),
	// 				RecipientName: to.Ptr("Microsoft Azure Import/Export Service"),
	// 				StateOrProvince: to.Ptr("CA"),
	// 				StreetAddress1: to.Ptr("2045 Lafayette Street"),
	// 				StreetAddress2: to.Ptr(""),
	// 			},
	// 			State: to.Ptr("Creating"),
	// 			StorageAccountID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/test"),
	// 		},
	// 		SystemData: &armstorageimportexport.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 		},
	// 	}
}
Output:

Example (CreateImportJob)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/CreateJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewJobsClient().Create(ctx, "myJob", "myResourceGroup", armstorageimportexport.PutJobParameters{
		Location: to.Ptr("West US"),
		Properties: &armstorageimportexport.JobDetails{
			BackupDriveManifest: to.Ptr(true),
			DiagnosticsPath:     to.Ptr("waimportexport"),
			DriveList: []*armstorageimportexport.DriveStatus{
				{
					BitLockerKey:    to.Ptr("238810-662376-448998-450120-652806-203390-606320-483076"),
					DriveHeaderHash: to.Ptr("0:1048576:FB6B6ED500D49DA6E0D723C98D42C657F2881CC13357C28DCECA6A524F1292501571A321238540E621AB5BD9C9A32637615919A75593E6CB5C1515DAE341CABF;135266304:143360:C957A189AFC38C4E80731252301EB91427CE55E61448FA3C73C6FDDE70ABBC197947EC8D0249A2C639BB10B95957D5820A4BE8DFBBF76FFFA688AE5CE0D42EC3"),
					DriveID:         to.Ptr("9CA995BB"),
					ManifestFile:    to.Ptr("\\8a0c23f7-14b7-470a-9633-fcd46590a1bc.manifest"),
					ManifestHash:    to.Ptr("4228EC5D8E048CB9B515338C789314BE8D0B2FDBC7C7A0308E1C826242CDE74E"),
				}},
			JobType:  to.Ptr("Import"),
			LogLevel: to.Ptr("Verbose"),
			ReturnAddress: &armstorageimportexport.ReturnAddress{
				City:            to.Ptr("Redmond"),
				CountryOrRegion: to.Ptr("USA"),
				Email:           to.Ptr("Test@contoso.com"),
				Phone:           to.Ptr("4250000000"),
				PostalCode:      to.Ptr("98007"),
				RecipientName:   to.Ptr("Test"),
				StateOrProvince: to.Ptr("wa"),
				StreetAddress1:  to.Ptr("Street1"),
				StreetAddress2:  to.Ptr("street2"),
			},
			ReturnShipping: &armstorageimportexport.ReturnShipping{
				CarrierAccountNumber: to.Ptr("989ffff"),
				CarrierName:          to.Ptr("FedEx"),
			},
			StorageAccountID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/test"),
		},
	}, &armstorageimportexport.JobsClientCreateOptions{AcceptLanguage: nil,
		ClientTenantID: nil,
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.JobResponse = armstorageimportexport.JobResponse{
	// 	Name: to.Ptr("myJob"),
	// 	Type: to.Ptr("Microsoft.ImportExport/jobs"),
	// 	ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ImportExport/jobs/myJob"),
	// 	Identity: &armstorageimportexport.IdentityDetails{
	// 		Type: to.Ptr(armstorageimportexport.IdentityTypeNone),
	// 	},
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armstorageimportexport.JobDetails{
	// 		BackupDriveManifest: to.Ptr(true),
	// 		CancelRequested: to.Ptr(false),
	// 		DiagnosticsPath: to.Ptr("waimportexport"),
	// 		DriveList: []*armstorageimportexport.DriveStatus{
	// 			{
	// 				DriveHeaderHash: to.Ptr("0:1048576:FB6B6ED500D49DA6E0D723C98D42C657F2881CC13357C28DCECA6A524F1292501571A321238540E621AB5BD9C9A32637615919A75593E6CB5C1515DAE341CABF;135266304:143360:C957A189AFC38C4E80731252301EB91427CE55E61448FA3C73C6FDDE70ABBC197947EC8D0249A2C639BB10B95957D5820A4BE8DFBBF76FFFA688AE5CE0D42EC3"),
	// 				DriveID: to.Ptr("9CA995BB"),
	// 				ManifestFile: to.Ptr("\\8a0c23f7-14b7-470a-9633-fcd46590a1bc.manifest"),
	// 				ManifestHash: to.Ptr("4228EC5D8E048CB9B515338C789314BE8D0B2FDBC7C7A0308E1C826242CDE74E"),
	// 				State: to.Ptr(armstorageimportexport.DriveStateSpecified),
	// 		}},
	// 		EncryptionKey: &armstorageimportexport.EncryptionKeyDetails{
	// 			KekType: to.Ptr(armstorageimportexport.EncryptionKekTypeMicrosoftManaged),
	// 		},
	// 		JobType: to.Ptr("Import"),
	// 		LogLevel: to.Ptr("Verbose"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		ReturnAddress: &armstorageimportexport.ReturnAddress{
	// 			City: to.Ptr("Redmond"),
	// 			CountryOrRegion: to.Ptr("USA"),
	// 			Email: to.Ptr("Test@contoso.com"),
	// 			Phone: to.Ptr("4250000000"),
	// 			PostalCode: to.Ptr("98007"),
	// 			RecipientName: to.Ptr("Test"),
	// 			StateOrProvince: to.Ptr("wa"),
	// 			StreetAddress1: to.Ptr("Street1"),
	// 			StreetAddress2: to.Ptr("street2"),
	// 		},
	// 		ReturnShipping: &armstorageimportexport.ReturnShipping{
	// 			CarrierAccountNumber: to.Ptr("989ffff"),
	// 			CarrierName: to.Ptr("FedEx"),
	// 		},
	// 		ShippingInformation: &armstorageimportexport.ShippingInformation{
	// 			AdditionalInformation: to.Ptr(""),
	// 			City: to.Ptr("Santa Clara"),
	// 			CountryOrRegion: to.Ptr("USA"),
	// 			Phone: to.Ptr("408 0000 0000"),
	// 			PostalCode: to.Ptr("95050"),
	// 			RecipientName: to.Ptr("Microsoft Azure Import/Export Service"),
	// 			StateOrProvince: to.Ptr("CA"),
	// 			StreetAddress1: to.Ptr("2045 Lafayette Street"),
	// 			StreetAddress2: to.Ptr(""),
	// 		},
	// 		State: to.Ptr("Creating"),
	// 		StorageAccountID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/test"),
	// 	},
	// 	SystemData: &armstorageimportexport.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*JobsClient) Delete

func (client *JobsClient) Delete(ctx context.Context, jobName string, resourceGroupName string, options *JobsClientDeleteOptions) (JobsClientDeleteResponse, error)

Delete - Deletes an existing job. Only jobs in the Creating or Completed states can be deleted. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-01-01

  • jobName - The name of the import/export job.
  • resourceGroupName - The resource group name uniquely identifies the resource group within the user subscription.
  • options - JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/DeleteJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewJobsClient().Delete(ctx, "myJob", "myResourceGroup", &armstorageimportexport.JobsClientDeleteOptions{AcceptLanguage: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*JobsClient) Get

func (client *JobsClient) Get(ctx context.Context, jobName string, resourceGroupName string, options *JobsClientGetOptions) (JobsClientGetResponse, error)

Get - Gets information about an existing job. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-01-01

  • jobName - The name of the import/export job.
  • resourceGroupName - The resource group name uniquely identifies the resource group within the user subscription.
  • options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method.
Example (GetExportJob)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/GetExportJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewJobsClient().Get(ctx, "myJob", "myResourceGroup", &armstorageimportexport.JobsClientGetOptions{AcceptLanguage: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.JobResponse = armstorageimportexport.JobResponse{
	// 	Name: to.Ptr("myJob"),
	// 	Type: to.Ptr("Microsoft.ImportExport/jobs"),
	// 	ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ImportExport/jobs/test"),
	// 	Identity: &armstorageimportexport.IdentityDetails{
	// 		Type: to.Ptr(armstorageimportexport.IdentityTypeNone),
	// 	},
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armstorageimportexport.JobDetails{
	// 		BackupDriveManifest: to.Ptr(true),
	// 		CancelRequested: to.Ptr(false),
	// 		DiagnosticsPath: to.Ptr("waimportexport"),
	// 		DriveList: []*armstorageimportexport.DriveStatus{
	// 		},
	// 		EncryptionKey: &armstorageimportexport.EncryptionKeyDetails{
	// 			KekType: to.Ptr(armstorageimportexport.EncryptionKekTypeMicrosoftManaged),
	// 		},
	// 		Export: &armstorageimportexport.Export{
	// 			BlobList: &armstorageimportexport.ExportBlobList{
	// 				BlobPathPrefix: []*string{
	// 					to.Ptr("/")},
	// 				},
	// 			},
	// 			JobType: to.Ptr("Export"),
	// 			LogLevel: to.Ptr("Verbose"),
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 			ReturnAddress: &armstorageimportexport.ReturnAddress{
	// 				City: to.Ptr("Redmond"),
	// 				CountryOrRegion: to.Ptr("USA"),
	// 				Email: to.Ptr("Test@contoso.com"),
	// 				Phone: to.Ptr("4250000000"),
	// 				PostalCode: to.Ptr("98007"),
	// 				RecipientName: to.Ptr("Test"),
	// 				StateOrProvince: to.Ptr("wa"),
	// 				StreetAddress1: to.Ptr("Street1"),
	// 				StreetAddress2: to.Ptr("street2"),
	// 			},
	// 			ReturnShipping: &armstorageimportexport.ReturnShipping{
	// 				CarrierAccountNumber: to.Ptr("989ffff"),
	// 				CarrierName: to.Ptr("FedEx"),
	// 			},
	// 			ShippingInformation: &armstorageimportexport.ShippingInformation{
	// 				AdditionalInformation: to.Ptr(""),
	// 				City: to.Ptr("Santa Clara"),
	// 				CountryOrRegion: to.Ptr("USA"),
	// 				Phone: to.Ptr("408 0000 0000"),
	// 				PostalCode: to.Ptr("95050"),
	// 				RecipientName: to.Ptr("Microsoft Azure Import/Export Service"),
	// 				StateOrProvince: to.Ptr("CA"),
	// 				StreetAddress1: to.Ptr("2045 Lafayette Street"),
	// 				StreetAddress2: to.Ptr(""),
	// 			},
	// 			State: to.Ptr("Creating"),
	// 			StorageAccountID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/test"),
	// 		},
	// 		SystemData: &armstorageimportexport.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 		},
	// 	}
}
Output:

Example (GetImportJob)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/GetJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewJobsClient().Get(ctx, "myJob", "myResourceGroup", &armstorageimportexport.JobsClientGetOptions{AcceptLanguage: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.JobResponse = armstorageimportexport.JobResponse{
	// 	Name: to.Ptr("myJob"),
	// 	Type: to.Ptr("Microsoft.ImportExport/jobs"),
	// 	ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ImportExport/jobs/test"),
	// 	Identity: &armstorageimportexport.IdentityDetails{
	// 		Type: to.Ptr(armstorageimportexport.IdentityTypeNone),
	// 	},
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armstorageimportexport.JobDetails{
	// 		BackupDriveManifest: to.Ptr(true),
	// 		CancelRequested: to.Ptr(false),
	// 		DiagnosticsPath: to.Ptr("waimportexport"),
	// 		DriveList: []*armstorageimportexport.DriveStatus{
	// 			{
	// 				DriveHeaderHash: to.Ptr(""),
	// 				DriveID: to.Ptr("9CA995BB"),
	// 				ManifestFile: to.Ptr("\\DriveManifest.xml"),
	// 				ManifestHash: to.Ptr("109B21108597EF36D5785F08303F3638"),
	// 				State: to.Ptr(armstorageimportexport.DriveStateSpecified),
	// 		}},
	// 		EncryptionKey: &armstorageimportexport.EncryptionKeyDetails{
	// 			KekType: to.Ptr(armstorageimportexport.EncryptionKekTypeMicrosoftManaged),
	// 		},
	// 		JobType: to.Ptr("Import"),
	// 		LogLevel: to.Ptr("Verbose"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		ReturnAddress: &armstorageimportexport.ReturnAddress{
	// 			City: to.Ptr("Redmond"),
	// 			CountryOrRegion: to.Ptr("USA"),
	// 			Email: to.Ptr("Test@contoso.com"),
	// 			Phone: to.Ptr("4250000000"),
	// 			PostalCode: to.Ptr("98007"),
	// 			RecipientName: to.Ptr("Test"),
	// 			StateOrProvince: to.Ptr("wa"),
	// 			StreetAddress1: to.Ptr("Street1"),
	// 			StreetAddress2: to.Ptr("street2"),
	// 		},
	// 		ReturnShipping: &armstorageimportexport.ReturnShipping{
	// 			CarrierAccountNumber: to.Ptr("989ffff"),
	// 			CarrierName: to.Ptr("FedEx"),
	// 		},
	// 		ShippingInformation: &armstorageimportexport.ShippingInformation{
	// 			AdditionalInformation: to.Ptr(""),
	// 			City: to.Ptr("Santa Clara"),
	// 			CountryOrRegion: to.Ptr("USA"),
	// 			Phone: to.Ptr("408 0000 0000"),
	// 			PostalCode: to.Ptr("95050"),
	// 			RecipientName: to.Ptr("Microsoft Azure Import/Export Service"),
	// 			StateOrProvince: to.Ptr("CA"),
	// 			StreetAddress1: to.Ptr("2045 Lafayette Street"),
	// 			StreetAddress2: to.Ptr(""),
	// 		},
	// 		State: to.Ptr("Creating"),
	// 		StorageAccountID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/test"),
	// 	},
	// 	SystemData: &armstorageimportexport.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*JobsClient) NewListByResourceGroupPager added in v0.4.0

func (client *JobsClient) NewListByResourceGroupPager(resourceGroupName string, options *JobsClientListByResourceGroupOptions) *runtime.Pager[JobsClientListByResourceGroupResponse]

NewListByResourceGroupPager - Returns all active and completed jobs in a resource group.

Generated from API version 2021-01-01

  • resourceGroupName - The resource group name uniquely identifies the resource group within the user subscription.
  • options - JobsClientListByResourceGroupOptions contains the optional parameters for the JobsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/ListJobsInResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewJobsClient().NewListByResourceGroupPager("myResourceGroup", &armstorageimportexport.JobsClientListByResourceGroupOptions{Top: nil,
		Filter:         nil,
		AcceptLanguage: nil,
	})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ListJobsResponse = armstorageimportexport.ListJobsResponse{
		// 	Value: []*armstorageimportexport.JobResponse{
		// 		{
		// 			Name: to.Ptr("test-by1-ssd-2"),
		// 			Type: to.Ptr("Microsoft.ImportExport/jobs"),
		// 			ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ImportExport/jobs/test-by1-ssd-2"),
		// 			Identity: &armstorageimportexport.IdentityDetails{
		// 				Type: to.Ptr(armstorageimportexport.IdentityTypeNone),
		// 			},
		// 			Location: to.Ptr("West US"),
		// 			Properties: &armstorageimportexport.JobDetails{
		// 				BackupDriveManifest: to.Ptr(true),
		// 				CancelRequested: to.Ptr(false),
		// 				DeliveryPackage: &armstorageimportexport.DeliveryPackageInformation{
		// 					CarrierName: to.Ptr("FedEx"),
		// 					DriveCount: to.Ptr[int64](1),
		// 					ShipDate: to.Ptr("9/29/2017 10:28:35 PM"),
		// 					TrackingNumber: to.Ptr("787895108176"),
		// 				},
		// 				DiagnosticsPath: to.Ptr("waimportexport"),
		// 				EncryptionKey: &armstorageimportexport.EncryptionKeyDetails{
		// 					KekType: to.Ptr(armstorageimportexport.EncryptionKekTypeMicrosoftManaged),
		// 				},
		// 				JobType: to.Ptr("Import"),
		// 				LogLevel: to.Ptr("Verbose"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				ReturnAddress: &armstorageimportexport.ReturnAddress{
		// 					City: to.Ptr("Redmond"),
		// 					CountryOrRegion: to.Ptr("USA"),
		// 					Email: to.Ptr("test@contoso.com"),
		// 					Phone: to.Ptr("4250000000"),
		// 					PostalCode: to.Ptr("98007"),
		// 					RecipientName: to.Ptr("La"),
		// 					StateOrProvince: to.Ptr("wa"),
		// 					StreetAddress1: to.Ptr("Street1"),
		// 					StreetAddress2: to.Ptr("street2"),
		// 				},
		// 				ReturnShipping: &armstorageimportexport.ReturnShipping{
		// 					CarrierAccountNumber: to.Ptr("989ffff"),
		// 					CarrierName: to.Ptr("FedEx"),
		// 				},
		// 				ShippingInformation: &armstorageimportexport.ShippingInformation{
		// 					AdditionalInformation: to.Ptr(""),
		// 					City: to.Ptr("Santa Clara"),
		// 					CountryOrRegion: to.Ptr("USA"),
		// 					Phone: to.Ptr("408 352 7600"),
		// 					PostalCode: to.Ptr("95050"),
		// 					RecipientName: to.Ptr("Microsoft Azure Import/Export Service"),
		// 					StateOrProvince: to.Ptr("CA"),
		// 					StreetAddress1: to.Ptr("2045 Lafayette Street"),
		// 					StreetAddress2: to.Ptr(""),
		// 				},
		// 				State: to.Ptr("Received"),
		// 				StorageAccountID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/xtprodtestwu"),
		// 			},
		// 			SystemData: &armstorageimportexport.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("string"),
		// 				CreatedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("string"),
		// 				LastModifiedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*JobsClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Returns all active and completed jobs in a subscription.

Generated from API version 2021-01-01

  • options - JobsClientListBySubscriptionOptions contains the optional parameters for the JobsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/ListJobsInSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewJobsClient().NewListBySubscriptionPager(&armstorageimportexport.JobsClientListBySubscriptionOptions{Top: nil,
		Filter:         nil,
		AcceptLanguage: nil,
	})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ListJobsResponse = armstorageimportexport.ListJobsResponse{
		// 	Value: []*armstorageimportexport.JobResponse{
		// 		{
		// 			Name: to.Ptr("test-bn1-import-cpu100-01"),
		// 			Type: to.Ptr("Microsoft.ImportExport/jobs"),
		// 			ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testrg/providers/Microsoft.ImportExport/jobs/test-bn1-import-cpu100-01"),
		// 			Identity: &armstorageimportexport.IdentityDetails{
		// 				Type: to.Ptr(armstorageimportexport.IdentityTypeNone),
		// 			},
		// 			Location: to.Ptr("East US 2"),
		// 			Properties: &armstorageimportexport.JobDetails{
		// 				BackupDriveManifest: to.Ptr(true),
		// 				CancelRequested: to.Ptr(false),
		// 				DeliveryPackage: &armstorageimportexport.DeliveryPackageInformation{
		// 					CarrierName: to.Ptr("FedEx"),
		// 					DriveCount: to.Ptr[int64](1),
		// 					ShipDate: to.Ptr("8/11/2017 9:05:00 PM"),
		// 					TrackingNumber: to.Ptr("992016102507"),
		// 				},
		// 				DiagnosticsPath: to.Ptr("waimportexport"),
		// 				DriveList: []*armstorageimportexport.DriveStatus{
		// 					{
		// 						DriveID: to.Ptr("7PHR882C"),
		// 						ManifestFile: to.Ptr("\\DriveManifest.xml"),
		// 						ManifestHash: to.Ptr("E5D632DB047C74B3B17C8F3359950ADB"),
		// 						State: to.Ptr(armstorageimportexport.DriveStateReceived),
		// 				}},
		// 				EncryptionKey: &armstorageimportexport.EncryptionKeyDetails{
		// 					KekType: to.Ptr(armstorageimportexport.EncryptionKekTypeMicrosoftManaged),
		// 				},
		// 				JobType: to.Ptr("Import"),
		// 				LogLevel: to.Ptr("Verbose"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				ReturnAddress: &armstorageimportexport.ReturnAddress{
		// 					City: to.Ptr("city"),
		// 					CountryOrRegion: to.Ptr("USA"),
		// 					Email: to.Ptr("test@contoso.com"),
		// 					Phone: to.Ptr("425000000"),
		// 					PostalCode: to.Ptr("98007"),
		// 					RecipientName: to.Ptr("La"),
		// 					StateOrProvince: to.Ptr("wa"),
		// 					StreetAddress1: to.Ptr("Street1"),
		// 					StreetAddress2: to.Ptr("street2"),
		// 				},
		// 				ReturnShipping: &armstorageimportexport.ReturnShipping{
		// 					CarrierAccountNumber: to.Ptr("989ffff"),
		// 					CarrierName: to.Ptr("FedEx"),
		// 				},
		// 				ShippingInformation: &armstorageimportexport.ShippingInformation{
		// 					AdditionalInformation: to.Ptr(""),
		// 					City: to.Ptr("Boydton"),
		// 					CountryOrRegion: to.Ptr("USA"),
		// 					Phone: to.Ptr("+1-434-738-9443"),
		// 					PostalCode: to.Ptr("23917"),
		// 					RecipientName: to.Ptr("Windows Azure Import Export Service"),
		// 					StateOrProvince: to.Ptr("VA"),
		// 					StreetAddress1: to.Ptr("Boydton 1 / BLDG # 1 101 Herbert Drive"),
		// 					StreetAddress2: to.Ptr(""),
		// 				},
		// 				State: to.Ptr("Received"),
		// 				StorageAccountID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/xtprodtestarmos2"),
		// 			},
		// 			SystemData: &armstorageimportexport.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("string"),
		// 				CreatedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("string"),
		// 				LastModifiedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("test-bn1-import-cpu100-02"),
		// 			Type: to.Ptr("Microsoft.ImportExport/jobs"),
		// 			ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testrg/providers/Microsoft.ImportExport/jobs/test-bn1-import-cpu100-02"),
		// 			Identity: &armstorageimportexport.IdentityDetails{
		// 				Type: to.Ptr(armstorageimportexport.IdentityTypeNone),
		// 			},
		// 			Location: to.Ptr("East US 2"),
		// 			Properties: &armstorageimportexport.JobDetails{
		// 				BackupDriveManifest: to.Ptr(true),
		// 				CancelRequested: to.Ptr(false),
		// 				DeliveryPackage: &armstorageimportexport.DeliveryPackageInformation{
		// 					CarrierName: to.Ptr("FedEx"),
		// 					DriveCount: to.Ptr[int64](1),
		// 					ShipDate: to.Ptr("8/13/2017 7:32:23 PM"),
		// 					TrackingNumber: to.Ptr("992016102508"),
		// 				},
		// 				DiagnosticsPath: to.Ptr("waimportexport"),
		// 				DriveList: []*armstorageimportexport.DriveStatus{
		// 					{
		// 						CopyStatus: to.Ptr("InProgress"),
		// 						DriveID: to.Ptr("KV6H86XP"),
		// 						ErrorLogURI: to.Ptr("https://foo.blob.core.windows.net/waimportexport/waies/test-bn1-import-cpu100-02_KV6H86XP_20170813-194620-021_error.xml"),
		// 						ManifestFile: to.Ptr("\\DriveManifest.xml"),
		// 						ManifestHash: to.Ptr("F6A488A65AF0CCA7D050B7F9F43A197C"),
		// 						ManifestURI: to.Ptr("https://foo.blob.core.windows.net/waimportexport/waies/test-bn1-import-cpu100-02_KV6H86XP_20170813-194620-574_manifest.xml"),
		// 						State: to.Ptr(armstorageimportexport.DriveStateCompletedMoreInfo),
		// 						VerboseLogURI: to.Ptr("https://foo.blob.core.windows.net/waimportexport/waies/test-bn1-import-cpu100-02_KV6H86XP_20170813-194618-350_verbose.xml"),
		// 				}},
		// 				EncryptionKey: &armstorageimportexport.EncryptionKeyDetails{
		// 					KekType: to.Ptr(armstorageimportexport.EncryptionKekTypeMicrosoftManaged),
		// 				},
		// 				JobType: to.Ptr("Import"),
		// 				LogLevel: to.Ptr("Verbose"),
		// 				PercentComplete: to.Ptr[int64](6),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				ReturnAddress: &armstorageimportexport.ReturnAddress{
		// 					City: to.Ptr("city"),
		// 					CountryOrRegion: to.Ptr("USA"),
		// 					Email: to.Ptr("test@contoso.com"),
		// 					Phone: to.Ptr("4256150991"),
		// 					PostalCode: to.Ptr("98007"),
		// 					RecipientName: to.Ptr("La"),
		// 					StateOrProvince: to.Ptr("wa"),
		// 					StreetAddress1: to.Ptr("Street1"),
		// 					StreetAddress2: to.Ptr("street2"),
		// 				},
		// 				ShippingInformation: &armstorageimportexport.ShippingInformation{
		// 					AdditionalInformation: to.Ptr(""),
		// 					City: to.Ptr("Boydton"),
		// 					CountryOrRegion: to.Ptr("USA"),
		// 					Phone: to.Ptr("+1-434-738-9443"),
		// 					PostalCode: to.Ptr("23917"),
		// 					RecipientName: to.Ptr("Windows Azure Import Export Service"),
		// 					StateOrProvince: to.Ptr("VA"),
		// 					StreetAddress1: to.Ptr("Boydton 1 / BLDG # 1 101 Herbert Drive"),
		// 					StreetAddress2: to.Ptr(""),
		// 				},
		// 				State: to.Ptr("Transferring"),
		// 				StorageAccountID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/xtprodtestarmos2"),
		// 			},
		// 			SystemData: &armstorageimportexport.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("string"),
		// 				CreatedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("string"),
		// 				LastModifiedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*JobsClient) Update

func (client *JobsClient) Update(ctx context.Context, jobName string, resourceGroupName string, body UpdateJobParameters, options *JobsClientUpdateOptions) (JobsClientUpdateResponse, error)

Update - Updates specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-01-01

  • jobName - The name of the import/export job.
  • resourceGroupName - The resource group name uniquely identifies the resource group within the user subscription.
  • body - The parameters to update in the job
  • options - JobsClientUpdateOptions contains the optional parameters for the JobsClient.Update method.
Example (UpdateExportJob)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/UpdateExportJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewJobsClient().Update(ctx, "myExportJob", "myResourceGroup", armstorageimportexport.UpdateJobParameters{
		Properties: &armstorageimportexport.UpdateJobParametersProperties{
			BackupDriveManifest: to.Ptr(true),
			LogLevel:            to.Ptr("Verbose"),
			State:               to.Ptr(""),
		},
	}, &armstorageimportexport.JobsClientUpdateOptions{AcceptLanguage: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.JobResponse = armstorageimportexport.JobResponse{
	// 	Name: to.Ptr("myExportJob"),
	// 	Type: to.Ptr("Microsoft.ImportExport/jobs"),
	// 	ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ImportExport/jobs/myExportJob"),
	// 	Identity: &armstorageimportexport.IdentityDetails{
	// 		Type: to.Ptr(armstorageimportexport.IdentityTypeNone),
	// 	},
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armstorageimportexport.JobDetails{
	// 		BackupDriveManifest: to.Ptr(true),
	// 		CancelRequested: to.Ptr(false),
	// 		DiagnosticsPath: to.Ptr("waimportexport"),
	// 		EncryptionKey: &armstorageimportexport.EncryptionKeyDetails{
	// 			KekType: to.Ptr(armstorageimportexport.EncryptionKekTypeMicrosoftManaged),
	// 		},
	// 		Export: &armstorageimportexport.Export{
	// 			BlobList: &armstorageimportexport.ExportBlobList{
	// 				BlobPathPrefix: []*string{
	// 					to.Ptr("/")},
	// 				},
	// 			},
	// 			JobType: to.Ptr("Export"),
	// 			LogLevel: to.Ptr("Verbose"),
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 			ReturnAddress: &armstorageimportexport.ReturnAddress{
	// 				City: to.Ptr("Redmond"),
	// 				CountryOrRegion: to.Ptr("USA"),
	// 				Email: to.Ptr("Test@contoso.com"),
	// 				Phone: to.Ptr("4250000000"),
	// 				PostalCode: to.Ptr("98007"),
	// 				RecipientName: to.Ptr("Test"),
	// 				StateOrProvince: to.Ptr("wa"),
	// 				StreetAddress1: to.Ptr("Street1"),
	// 				StreetAddress2: to.Ptr("street2"),
	// 			},
	// 			ReturnShipping: &armstorageimportexport.ReturnShipping{
	// 				CarrierAccountNumber: to.Ptr("989ffff"),
	// 				CarrierName: to.Ptr("FedEx"),
	// 			},
	// 			ShippingInformation: &armstorageimportexport.ShippingInformation{
	// 				AdditionalInformation: to.Ptr(""),
	// 				City: to.Ptr("Santa Clara"),
	// 				CountryOrRegion: to.Ptr("USA"),
	// 				Phone: to.Ptr("408 352 7600"),
	// 				PostalCode: to.Ptr("95050"),
	// 				RecipientName: to.Ptr("Microsoft Azure Import/Export Service"),
	// 				StateOrProvince: to.Ptr("CA"),
	// 				StreetAddress1: to.Ptr("2045 Lafayette Street"),
	// 				StreetAddress2: to.Ptr(""),
	// 			},
	// 			State: to.Ptr("Creating"),
	// 			StorageAccountID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/test"),
	// 		},
	// 		SystemData: &armstorageimportexport.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 		},
	// 	}
}
Output:

Example (UpdateImportJob)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/UpdateJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewJobsClient().Update(ctx, "myJob", "myResourceGroup", armstorageimportexport.UpdateJobParameters{
		Properties: &armstorageimportexport.UpdateJobParametersProperties{
			BackupDriveManifest: to.Ptr(true),
			LogLevel:            to.Ptr("Verbose"),
			State:               to.Ptr(""),
		},
	}, &armstorageimportexport.JobsClientUpdateOptions{AcceptLanguage: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.JobResponse = armstorageimportexport.JobResponse{
	// 	Name: to.Ptr("myJob"),
	// 	Type: to.Ptr("Microsoft.ImportExport/jobs"),
	// 	ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ImportExport/jobs/myJob"),
	// 	Identity: &armstorageimportexport.IdentityDetails{
	// 		Type: to.Ptr(armstorageimportexport.IdentityTypeNone),
	// 	},
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armstorageimportexport.JobDetails{
	// 		BackupDriveManifest: to.Ptr(true),
	// 		CancelRequested: to.Ptr(false),
	// 		DiagnosticsPath: to.Ptr("waimportexport"),
	// 		DriveList: []*armstorageimportexport.DriveStatus{
	// 			{
	// 				DriveHeaderHash: to.Ptr("0:1048576:FB6B6ED500D49DA6E0D723C98D42C657F2881CC13357C28DCECA6A524F1292501571A321238540E621AB5BD9C9A32637615919A75593E6CB5C1515DAE341CABF;135266304:143360:C957A189AFC38C4E80731252301EB91427CE55E61448FA3C73C6FDDE70ABBC197947EC8D0249A2C639BB10B95957D5820A4BE8DFBBF76FFFA688AE5CE0D42EC3"),
	// 				DriveID: to.Ptr("9CA995BB"),
	// 				ManifestFile: to.Ptr("\\8a0c23f7-14b7-470a-9633-fcd46590a1bc.manifest"),
	// 				ManifestHash: to.Ptr("4228EC5D8E048CB9B515338C789314BE8D0B2FDBC7C7A0308E1C826242CDE74E"),
	// 				State: to.Ptr(armstorageimportexport.DriveStateSpecified),
	// 		}},
	// 		EncryptionKey: &armstorageimportexport.EncryptionKeyDetails{
	// 			KekType: to.Ptr(armstorageimportexport.EncryptionKekTypeMicrosoftManaged),
	// 		},
	// 		JobType: to.Ptr("Import"),
	// 		LogLevel: to.Ptr("Verbose"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		ReturnAddress: &armstorageimportexport.ReturnAddress{
	// 			City: to.Ptr("Redmond"),
	// 			CountryOrRegion: to.Ptr("USA"),
	// 			Email: to.Ptr("Test@contoso.com"),
	// 			Phone: to.Ptr("4250000000"),
	// 			PostalCode: to.Ptr("98007"),
	// 			RecipientName: to.Ptr("Test"),
	// 			StateOrProvince: to.Ptr("wa"),
	// 			StreetAddress1: to.Ptr("Street1"),
	// 			StreetAddress2: to.Ptr("street2"),
	// 		},
	// 		ReturnShipping: &armstorageimportexport.ReturnShipping{
	// 			CarrierAccountNumber: to.Ptr("989ffff"),
	// 			CarrierName: to.Ptr("FedEx"),
	// 		},
	// 		ShippingInformation: &armstorageimportexport.ShippingInformation{
	// 			AdditionalInformation: to.Ptr(""),
	// 			City: to.Ptr("Santa Clara"),
	// 			CountryOrRegion: to.Ptr("USA"),
	// 			Phone: to.Ptr("408 352 7600"),
	// 			PostalCode: to.Ptr("95050"),
	// 			RecipientName: to.Ptr("Microsoft Azure Import/Export Service"),
	// 			StateOrProvince: to.Ptr("CA"),
	// 			StreetAddress1: to.Ptr("2045 Lafayette Street"),
	// 			StreetAddress2: to.Ptr(""),
	// 		},
	// 		State: to.Ptr("Creating"),
	// 		StorageAccountID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/test"),
	// 	},
	// 	SystemData: &armstorageimportexport.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armstorageimportexport.CreatedByTypeUser),
	// 	},
	// }
}
Output:

type JobsClientCreateOptions added in v0.2.0

type JobsClientCreateOptions struct {
	// Specifies the preferred language for the response.
	AcceptLanguage *string

	// The tenant ID of the client making the request.
	ClientTenantID *string
}

JobsClientCreateOptions contains the optional parameters for the JobsClient.Create method.

type JobsClientCreateResponse added in v0.2.0

type JobsClientCreateResponse struct {
	// Contains the job information.
	JobResponse
}

JobsClientCreateResponse contains the response from method JobsClient.Create.

type JobsClientDeleteOptions added in v0.2.0

type JobsClientDeleteOptions struct {
	// Specifies the preferred language for the response.
	AcceptLanguage *string
}

JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method.

type JobsClientDeleteResponse added in v0.2.0

type JobsClientDeleteResponse struct {
}

JobsClientDeleteResponse contains the response from method JobsClient.Delete.

type JobsClientGetOptions added in v0.2.0

type JobsClientGetOptions struct {
	// Specifies the preferred language for the response.
	AcceptLanguage *string
}

JobsClientGetOptions contains the optional parameters for the JobsClient.Get method.

type JobsClientGetResponse added in v0.2.0

type JobsClientGetResponse struct {
	// Contains the job information.
	JobResponse
}

JobsClientGetResponse contains the response from method JobsClient.Get.

type JobsClientListByResourceGroupOptions added in v0.2.0

type JobsClientListByResourceGroupOptions struct {
	// Specifies the preferred language for the response.
	AcceptLanguage *string

	// Can be used to restrict the results to certain conditions.
	Filter *string

	// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100.
	Top *int64
}

JobsClientListByResourceGroupOptions contains the optional parameters for the JobsClient.NewListByResourceGroupPager method.

type JobsClientListByResourceGroupResponse added in v0.2.0

type JobsClientListByResourceGroupResponse struct {
	// List jobs response
	ListJobsResponse
}

JobsClientListByResourceGroupResponse contains the response from method JobsClient.NewListByResourceGroupPager.

type JobsClientListBySubscriptionOptions added in v0.2.0

type JobsClientListBySubscriptionOptions struct {
	// Specifies the preferred language for the response.
	AcceptLanguage *string

	// Can be used to restrict the results to certain conditions.
	Filter *string

	// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100.
	Top *int64
}

JobsClientListBySubscriptionOptions contains the optional parameters for the JobsClient.NewListBySubscriptionPager method.

type JobsClientListBySubscriptionResponse added in v0.2.0

type JobsClientListBySubscriptionResponse struct {
	// List jobs response
	ListJobsResponse
}

JobsClientListBySubscriptionResponse contains the response from method JobsClient.NewListBySubscriptionPager.

type JobsClientUpdateOptions added in v0.2.0

type JobsClientUpdateOptions struct {
	// Specifies the preferred language for the response.
	AcceptLanguage *string
}

JobsClientUpdateOptions contains the optional parameters for the JobsClient.Update method.

type JobsClientUpdateResponse added in v0.2.0

type JobsClientUpdateResponse struct {
	// Contains the job information.
	JobResponse
}

JobsClientUpdateResponse contains the response from method JobsClient.Update.

type ListJobsResponse

type ListJobsResponse struct {
	// link to next batch of jobs
	NextLink *string

	// Job list
	Value []*JobResponse
}

ListJobsResponse - List jobs response

func (ListJobsResponse) MarshalJSON

func (l ListJobsResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListJobsResponse.

func (*ListJobsResponse) UnmarshalJSON added in v0.6.0

func (l *ListJobsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListJobsResponse.

type ListOperationsResponse

type ListOperationsResponse struct {
	// operations
	Value []*Operation
}

ListOperationsResponse - List operations response

func (ListOperationsResponse) MarshalJSON

func (l ListOperationsResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListOperationsResponse.

func (*ListOperationsResponse) UnmarshalJSON added in v0.6.0

func (l *ListOperationsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListOperationsResponse.

type Location

type Location struct {
	// Specifies the resource identifier of the location.
	ID *string

	// Specifies the name of the location. Use List Locations to get all supported locations.
	Name *string

	// location properties
	Properties *LocationProperties

	// Specifies the type of the location.
	Type *string
}

Location - Provides information about an Azure data center location.

func (Location) MarshalJSON added in v0.6.0

func (l Location) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Location.

func (*Location) UnmarshalJSON added in v0.6.0

func (l *Location) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Location.

type LocationProperties

type LocationProperties struct {
	// Additional shipping information for customer, specific to datacenter to which customer should send their disks.
	AdditionalShippingInformation *string

	// A list of location IDs that should be used to ship shipping drives to for jobs created against the current location. If
	// the current location is active, it will be part of the list. If it is
	// temporarily closed due to maintenance, this list may contain other locations.
	AlternateLocations []*string

	// The city name to use when shipping the drives to the Azure data center.
	City *string

	// The country or region to use when shipping the drives to the Azure data center.
	CountryOrRegion *string

	// The phone number for the Azure data center.
	Phone *string

	// The postal code to use when shipping the drives to the Azure data center.
	PostalCode *string

	// The recipient name to use when shipping the drives to the Azure data center.
	RecipientName *string

	// The state or province to use when shipping the drives to the Azure data center.
	StateOrProvince *string

	// The first line of the street address to use when shipping the drives to the Azure data center.
	StreetAddress1 *string

	// The second line of the street address to use when shipping the drives to the Azure data center.
	StreetAddress2 *string

	// A list of carriers that are supported at this location.
	SupportedCarriers []*string
}

LocationProperties - location properties

func (LocationProperties) MarshalJSON

func (l LocationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LocationProperties.

func (*LocationProperties) UnmarshalJSON added in v0.6.0

func (l *LocationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LocationProperties.

type LocationsClient

type LocationsClient struct {
	// contains filtered or unexported fields
}

LocationsClient contains the methods for the Locations group. Don't use this type directly, use NewLocationsClient() instead.

func NewLocationsClient

func NewLocationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationsClient, error)

NewLocationsClient creates a new instance of LocationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*LocationsClient) Get

Get - Returns the details about a location to which you can ship the disks associated with an import or export job. A location is an Azure region. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-01-01

  • locationName - The name of the location. For example, West US or westus.
  • options - LocationsClientGetOptions contains the optional parameters for the LocationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/GetLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLocationsClient().Get(ctx, "West US", &armstorageimportexport.LocationsClientGetOptions{AcceptLanguage: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Location = armstorageimportexport.Location{
	// 	Name: to.Ptr("West US"),
	// 	Type: to.Ptr("Microsoft.ImportExport/locations"),
	// 	ID: to.Ptr("/providers/Microsoft.ImportExport/locations/westus"),
	// 	Properties: &armstorageimportexport.LocationProperties{
	// 		AdditionalShippingInformation: to.Ptr(""),
	// 		AlternateLocations: []*string{
	// 			to.Ptr("/providers/Microsoft.ImportExport/locations/westus")},
	// 			City: to.Ptr("Santa Clara"),
	// 			CountryOrRegion: to.Ptr("USA"),
	// 			Phone: to.Ptr("408 352 7600"),
	// 			PostalCode: to.Ptr("95050"),
	// 			RecipientName: to.Ptr("Microsoft Azure Import/Export Service"),
	// 			StateOrProvince: to.Ptr("CA"),
	// 			StreetAddress1: to.Ptr("2045 Lafayette Street"),
	// 			StreetAddress2: to.Ptr(""),
	// 			SupportedCarriers: []*string{
	// 				to.Ptr("FedEx")},
	// 			},
	// 		}
}
Output:

func (*LocationsClient) NewListPager added in v0.4.0

NewListPager - Returns a list of locations to which you can ship the disks associated with an import or export job. A location is a Microsoft data center region.

Generated from API version 2021-01-01

  • options - LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/ListLocations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLocationsClient().NewListPager(&armstorageimportexport.LocationsClientListOptions{AcceptLanguage: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.LocationsResponse = armstorageimportexport.LocationsResponse{
		// 	Value: []*armstorageimportexport.Location{
		// 		{
		// 			Name: to.Ptr("Australia East"),
		// 			Type: to.Ptr("Microsoft.ImportExport/locations"),
		// 			ID: to.Ptr("/providers/Microsoft.ImportExport/locations/australiaeast"),
		// 			Properties: &armstorageimportexport.LocationProperties{
		// 				AdditionalShippingInformation: to.Ptr(""),
		// 				AlternateLocations: []*string{
		// 					to.Ptr("/providers/Microsoft.ImportExport/locations/australiaeast")},
		// 					City: to.Ptr("Macquarie Park"),
		// 					CountryOrRegion: to.Ptr("Australia"),
		// 					Phone: to.Ptr("612 0000 0000"),
		// 					PostalCode: to.Ptr("2113"),
		// 					RecipientName: to.Ptr("Windows Azure Import/Export Service"),
		// 					StateOrProvince: to.Ptr("NSW"),
		// 					StreetAddress1: to.Ptr("Customer-A c/o NEXTDC Ltd, Delivery code ABCDEFG, 4 Eden Park Drive"),
		// 					StreetAddress2: to.Ptr(""),
		// 					SupportedCarriers: []*string{
		// 						to.Ptr("DHL")},
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("Australia Southeast"),
		// 					Type: to.Ptr("Microsoft.ImportExport/locations"),
		// 					ID: to.Ptr("/providers/Microsoft.ImportExport/locations/australiasoutheast"),
		// 					Properties: &armstorageimportexport.LocationProperties{
		// 						AdditionalShippingInformation: to.Ptr(""),
		// 						AlternateLocations: []*string{
		// 							to.Ptr("/providers/Microsoft.ImportExport/locations/australiasoutheast")},
		// 							City: to.Ptr("Melbourne"),
		// 							CountryOrRegion: to.Ptr("Australia"),
		// 							Phone: to.Ptr("61 0 0000 0000"),
		// 							PostalCode: to.Ptr("3207"),
		// 							RecipientName: to.Ptr("Microsoft Azure Import/Export Service"),
		// 							StateOrProvince: to.Ptr("Melbourne"),
		// 							StreetAddress1: to.Ptr("Microsoft, c/o NEXTDC Ltd, Delivery code ABCDEFG, 826-830 Lorimer St, Port"),
		// 							StreetAddress2: to.Ptr(""),
		// 							SupportedCarriers: []*string{
		// 								to.Ptr("DHL")},
		// 							},
		// 					}},
		// 				}
	}
}
Output:

type LocationsClientGetOptions added in v0.2.0

type LocationsClientGetOptions struct {
	// Specifies the preferred language for the response.
	AcceptLanguage *string
}

LocationsClientGetOptions contains the optional parameters for the LocationsClient.Get method.

type LocationsClientGetResponse added in v0.2.0

type LocationsClientGetResponse struct {
	// Provides information about an Azure data center location.
	Location
}

LocationsClientGetResponse contains the response from method LocationsClient.Get.

type LocationsClientListOptions added in v0.2.0

type LocationsClientListOptions struct {
	// Specifies the preferred language for the response.
	AcceptLanguage *string
}

LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method.

type LocationsClientListResponse added in v0.2.0

type LocationsClientListResponse struct {
	// Locations response
	LocationsResponse
}

LocationsClientListResponse contains the response from method LocationsClient.NewListPager.

type LocationsResponse

type LocationsResponse struct {
	// locations
	Value []*Location
}

LocationsResponse - Locations response

func (LocationsResponse) MarshalJSON

func (l LocationsResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LocationsResponse.

func (*LocationsResponse) UnmarshalJSON added in v0.6.0

func (l *LocationsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LocationsResponse.

type Operation

type Operation struct {
	// REQUIRED; operation display properties
	Display *OperationDisplay

	// REQUIRED; Name of the operation.
	Name *string
}

Operation - Describes a supported operation by the Storage Import/Export job API.

func (Operation) MarshalJSON added in v0.6.0

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v0.6.0

func (o *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// Short description of the operation.
	Description *string

	// The display name of the operation.
	Operation *string

	// The resource provider name to which the operation belongs.
	Provider *string

	// The name of the resource to which the operation belongs.
	Resource *string
}

OperationDisplay - operation display properties

func (OperationDisplay) MarshalJSON added in v0.6.0

func (o OperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v0.6.0

func (o *OperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager added in v0.4.0

NewListPager - Returns the list of operations supported by the import/export resource provider.

Generated from API version 2021-01-01

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/examples/ListOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageimportexport/armstorageimportexport"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armstorageimportexport.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(&armstorageimportexport.OperationsClientListOptions{AcceptLanguage: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ListOperationsResponse = armstorageimportexport.ListOperationsResponse{
		// 	Value: []*armstorageimportexport.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.ImportExport/locations/read"),
		// 			Display: &armstorageimportexport.OperationDisplay{
		// 				Description: to.Ptr("Gets the properties for the specified location or returns the list of locations."),
		// 				Operation: to.Ptr("Get or List Locations"),
		// 				Provider: to.Ptr("Microsoft Import/Export"),
		// 				Resource: to.Ptr("Locations"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ImportExport/jobs/write"),
		// 			Display: &armstorageimportexport.OperationDisplay{
		// 				Description: to.Ptr("Creates a job with the specified parameters or update the properties or tags for the specified job."),
		// 				Operation: to.Ptr("Create or Update Job"),
		// 				Provider: to.Ptr("Microsoft Import/Export"),
		// 				Resource: to.Ptr("Jobs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ImportExport/jobs/read"),
		// 			Display: &armstorageimportexport.OperationDisplay{
		// 				Description: to.Ptr("Gets the properties for the specified job or returns the list of jobs."),
		// 				Operation: to.Ptr("Get or List Jobs"),
		// 				Provider: to.Ptr("Microsoft Import/Export"),
		// 				Resource: to.Ptr("Jobs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ImportExport/jobs/listBitLockerKeys/action"),
		// 			Display: &armstorageimportexport.OperationDisplay{
		// 				Description: to.Ptr("Gets the BitLocker keys for the specified job."),
		// 				Operation: to.Ptr("List BitLocker Keys"),
		// 				Provider: to.Ptr("Microsoft Import/Export"),
		// 				Resource: to.Ptr("Jobs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ImportExport/jobs/delete"),
		// 			Display: &armstorageimportexport.OperationDisplay{
		// 				Description: to.Ptr("Deletes an existing job."),
		// 				Operation: to.Ptr("Delete Job"),
		// 				Provider: to.Ptr("Microsoft Import/Export"),
		// 				Resource: to.Ptr("Jobs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ImportExport/register/action"),
		// 			Display: &armstorageimportexport.OperationDisplay{
		// 				Description: to.Ptr("Registers the subscription for the import/export resource provider and enables the creation of import/export jobs."),
		// 				Operation: to.Ptr("Registers the Import/Export Resource Provider"),
		// 				Provider: to.Ptr("Microsoft Import/Export"),
		// 				Resource: to.Ptr("Import/Export Resource Provider"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
	// Specifies the preferred language for the response.
	AcceptLanguage *string
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	// List operations response
	ListOperationsResponse
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type PackageInformation

type PackageInformation struct {
	// REQUIRED; The name of the carrier that is used to ship the import or export drives.
	CarrierName *string

	// REQUIRED; The number of drives included in the package.
	DriveCount *int64

	// REQUIRED; The date when the package is shipped.
	ShipDate *string

	// REQUIRED; The tracking number of the package.
	TrackingNumber *string
}

PackageInformation - Contains information about the package being shipped by the customer to the Microsoft data center.

func (PackageInformation) MarshalJSON added in v0.6.0

func (p PackageInformation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PackageInformation.

func (*PackageInformation) UnmarshalJSON added in v0.6.0

func (p *PackageInformation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PackageInformation.

type PutJobParameters

type PutJobParameters struct {
	// Specifies the supported Azure location where the job should be created
	Location *string

	// Specifies the job properties
	Properties *JobDetails

	// Specifies the tags that will be assigned to the job.
	Tags any
}

PutJobParameters - Put Job parameters

func (PutJobParameters) MarshalJSON added in v0.6.0

func (p PutJobParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PutJobParameters.

func (*PutJobParameters) UnmarshalJSON added in v0.6.0

func (p *PutJobParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PutJobParameters.

type ReturnAddress

type ReturnAddress struct {
	// REQUIRED; The city name to use when returning the drives.
	City *string

	// REQUIRED; The country or region to use when returning the drives.
	CountryOrRegion *string

	// REQUIRED; Email address of the recipient of the returned drives.
	Email *string

	// REQUIRED; Phone number of the recipient of the returned drives.
	Phone *string

	// REQUIRED; The postal code to use when returning the drives.
	PostalCode *string

	// REQUIRED; The name of the recipient who will receive the hard drives when they are returned.
	RecipientName *string

	// REQUIRED; The first line of the street address to use when returning the drives.
	StreetAddress1 *string

	// The state or province to use when returning the drives.
	StateOrProvince *string

	// The second line of the street address to use when returning the drives.
	StreetAddress2 *string
}

ReturnAddress - Specifies the return address information for the job.

func (ReturnAddress) MarshalJSON added in v0.6.0

func (r ReturnAddress) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReturnAddress.

func (*ReturnAddress) UnmarshalJSON added in v0.6.0

func (r *ReturnAddress) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReturnAddress.

type ReturnShipping

type ReturnShipping struct {
	// REQUIRED; The customer's account number with the carrier.
	CarrierAccountNumber *string

	// REQUIRED; The carrier's name.
	CarrierName *string
}

ReturnShipping - Specifies the return carrier and customer's account with the carrier.

func (ReturnShipping) MarshalJSON added in v0.6.0

func (r ReturnShipping) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReturnShipping.

func (*ReturnShipping) UnmarshalJSON added in v0.6.0

func (r *ReturnShipping) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReturnShipping.

type ShippingInformation

type ShippingInformation struct {
	// The city name to use when returning the drives.
	City *string

	// The country or region to use when returning the drives.
	CountryOrRegion *string

	// Phone number of the recipient of the returned drives.
	Phone *string

	// The postal code to use when returning the drives.
	PostalCode *string

	// The name of the recipient who will receive the hard drives when they are returned.
	RecipientName *string

	// The state or province to use when returning the drives.
	StateOrProvince *string

	// The first line of the street address to use when returning the drives.
	StreetAddress1 *string

	// The second line of the street address to use when returning the drives.
	StreetAddress2 *string

	// READ-ONLY; Additional shipping information for customer, specific to datacenter to which customer should send their disks.
	AdditionalInformation *string
}

ShippingInformation - Contains information about the Microsoft datacenter to which the drives should be shipped.

func (ShippingInformation) MarshalJSON added in v0.6.0

func (s ShippingInformation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ShippingInformation.

func (*ShippingInformation) UnmarshalJSON added in v0.6.0

func (s *ShippingInformation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ShippingInformation.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type UpdateJobParameters

type UpdateJobParameters struct {
	// Specifies the properties of a UpdateJob.
	Properties *UpdateJobParametersProperties

	// Specifies the tags that will be assigned to the job
	Tags any
}

UpdateJobParameters - Update Job parameters

func (UpdateJobParameters) MarshalJSON

func (u UpdateJobParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UpdateJobParameters.

func (*UpdateJobParameters) UnmarshalJSON added in v0.6.0

func (u *UpdateJobParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateJobParameters.

type UpdateJobParametersProperties

type UpdateJobParametersProperties struct {
	// Indicates whether the manifest files on the drives should be copied to block blobs.
	BackupDriveManifest *bool

	// If specified, the value must be true. The service will attempt to cancel the job.
	CancelRequested *bool

	// Contains information about the package being shipped by the customer to the Microsoft data center.
	DeliveryPackage *DeliveryPackageInformation

	// List of drives that comprise the job.
	DriveList []*DriveStatus

	// Indicates whether error logging or verbose logging is enabled.
	LogLevel *string

	// Specifies the return address information for the job.
	ReturnAddress *ReturnAddress

	// Specifies the return carrier and customer's account with the carrier.
	ReturnShipping *ReturnShipping

	// If specified, the value must be Shipping, which tells the Import/Export service that the package for the job has been shipped.
	// The ReturnAddress and DeliveryPackage properties must have been set
	// either in this request or in a previous request, otherwise the request will fail.
	State *string
}

UpdateJobParametersProperties - Specifies the properties of a UpdateJob.

func (UpdateJobParametersProperties) MarshalJSON

func (u UpdateJobParametersProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UpdateJobParametersProperties.

func (*UpdateJobParametersProperties) UnmarshalJSON added in v0.6.0

func (u *UpdateJobParametersProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateJobParametersProperties.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL