Documentation ¶
Index ¶
- type ActionType
- type ClientFactory
- type CreatedByType
- type ElseCondition
- type IfCondition
- type ManagedServiceIdentity
- type ManagedServiceIdentityType
- type MatchedBlockName
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Origin
- type ProvisioningState
- type RunResult
- type RunStatusEnum
- type StorageTask
- type StorageTaskAction
- type StorageTaskAssignment
- type StorageTaskAssignmentClient
- type StorageTaskAssignmentClientListOptions
- type StorageTaskAssignmentClientListResponse
- type StorageTaskAssignmentsListResult
- type StorageTaskOperation
- type StorageTaskOperationName
- type StorageTaskPreviewAction
- type StorageTaskPreviewActionCondition
- type StorageTaskPreviewActionIfCondition
- type StorageTaskPreviewActionProperties
- type StorageTaskPreviewBlobProperties
- type StorageTaskPreviewContainerProperties
- type StorageTaskPreviewKeyValueProperties
- type StorageTaskProperties
- type StorageTaskReportInstance
- type StorageTaskReportProperties
- type StorageTaskReportSummary
- type StorageTaskUpdateParameters
- type StorageTasksClient
- func (client *StorageTasksClient) BeginCreate(ctx context.Context, resourceGroupName string, storageTaskName string, ...) (*runtime.Poller[StorageTasksClientCreateResponse], error)
- func (client *StorageTasksClient) BeginDelete(ctx context.Context, resourceGroupName string, storageTaskName string, ...) (*runtime.Poller[StorageTasksClientDeleteResponse], error)
- func (client *StorageTasksClient) BeginUpdate(ctx context.Context, resourceGroupName string, storageTaskName string, ...) (*runtime.Poller[StorageTasksClientUpdateResponse], error)
- func (client *StorageTasksClient) Get(ctx context.Context, resourceGroupName string, storageTaskName string, ...) (StorageTasksClientGetResponse, error)
- func (client *StorageTasksClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[StorageTasksClientListByResourceGroupResponse]
- func (client *StorageTasksClient) NewListBySubscriptionPager(options *StorageTasksClientListBySubscriptionOptions) *runtime.Pager[StorageTasksClientListBySubscriptionResponse]
- func (client *StorageTasksClient) PreviewActions(ctx context.Context, location string, parameters StorageTaskPreviewAction, ...) (StorageTasksClientPreviewActionsResponse, error)
- type StorageTasksClientBeginCreateOptions
- type StorageTasksClientBeginDeleteOptions
- type StorageTasksClientBeginUpdateOptions
- type StorageTasksClientCreateResponse
- type StorageTasksClientDeleteResponse
- type StorageTasksClientGetOptions
- type StorageTasksClientGetResponse
- type StorageTasksClientListByResourceGroupOptions
- type StorageTasksClientListByResourceGroupResponse
- type StorageTasksClientListBySubscriptionOptions
- type StorageTasksClientListBySubscriptionResponse
- type StorageTasksClientPreviewActionsOptions
- type StorageTasksClientPreviewActionsResponse
- type StorageTasksClientUpdateResponse
- type StorageTasksListResult
- type StorageTasksReportClient
- type StorageTasksReportClientListOptions
- type StorageTasksReportClientListResponse
- type SystemData
- type UserAssignedIdentity
Examples ¶
- OperationsClient.NewListPager
- StorageTaskAssignmentClient.NewListPager
- StorageTasksClient.BeginCreate
- StorageTasksClient.BeginDelete
- StorageTasksClient.BeginUpdate
- StorageTasksClient.Get
- StorageTasksClient.NewListByResourceGroupPager
- StorageTasksClient.NewListBySubscriptionPager
- StorageTasksClient.PreviewActions
- StorageTasksReportClient.NewListPager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType string
ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
const (
ActionTypeInternal ActionType = "Internal"
)
func PossibleActionTypeValues ¶
func PossibleActionTypeValues() []ActionType
PossibleActionTypeValues returns the possible values for the ActionType const type.
type ClientFactory ¶
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 ¶
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 ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewOperationsClient ¶
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
func (*ClientFactory) NewStorageTaskAssignmentClient ¶
func (c *ClientFactory) NewStorageTaskAssignmentClient() *StorageTaskAssignmentClient
NewStorageTaskAssignmentClient creates a new instance of StorageTaskAssignmentClient.
func (*ClientFactory) NewStorageTasksClient ¶
func (c *ClientFactory) NewStorageTasksClient() *StorageTasksClient
NewStorageTasksClient creates a new instance of StorageTasksClient.
func (*ClientFactory) NewStorageTasksReportClient ¶
func (c *ClientFactory) NewStorageTasksReportClient() *StorageTasksReportClient
NewStorageTasksReportClient creates a new instance of StorageTasksReportClient.
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 ElseCondition ¶
type ElseCondition struct { // REQUIRED; List of operations to execute in the else block Operations []*StorageTaskOperation }
ElseCondition - The else block of storage task operation
func (ElseCondition) MarshalJSON ¶
func (e ElseCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ElseCondition.
func (*ElseCondition) UnmarshalJSON ¶
func (e *ElseCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ElseCondition.
type IfCondition ¶
type IfCondition struct { // REQUIRED; The condition predicate which is composed of object properties, eg: blob and container properties. Condition *string // REQUIRED; List of operations to execute when the condition predicate satisfies. Operations []*StorageTaskOperation }
IfCondition - The if block of storage task operation
func (IfCondition) MarshalJSON ¶
func (i IfCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IfCondition.
func (*IfCondition) UnmarshalJSON ¶
func (i *IfCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IfCondition.
type ManagedServiceIdentity ¶
type ManagedServiceIdentity struct { // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Type *ManagedServiceIdentityType // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM // resource ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. // The dictionary values can be empty objects ({}) in // requests. UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned // identity. PrincipalID *string // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. TenantID *string }
ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities)
func (ManagedServiceIdentity) MarshalJSON ¶
func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.
func (*ManagedServiceIdentity) UnmarshalJSON ¶
func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity.
type ManagedServiceIdentityType ¶
type ManagedServiceIdentityType string
ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
const ( ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" )
func PossibleManagedServiceIdentityTypeValues ¶
func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType
PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type.
type MatchedBlockName ¶
type MatchedBlockName string
MatchedBlockName - Represents the condition block name that matched blob properties.
const ( MatchedBlockNameElse MatchedBlockName = "Else" MatchedBlockNameIf MatchedBlockName = "If" MatchedBlockNameNone MatchedBlockName = "None" )
func PossibleMatchedBlockNameValues ¶
func PossibleMatchedBlockNameValues() []MatchedBlockName
PossibleMatchedBlockNameValues returns the possible values for the MatchedBlockName const type.
type Operation ¶
type Operation struct { // Localized display information for this particular operation. Display *OperationDisplay // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. ActionType *ActionType // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane // operations. IsDataAction *bool // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", // "Microsoft.Compute/virtualMachines/capture/action" Name *string // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" Origin *Origin }
Operation - Details of a REST API operation, returned from the Resource Provider Operations API
func (Operation) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct { // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. Description *string // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual // Machine", "Restart Virtual Machine". Operation *string // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft // Compute". Provider *string // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job // Schedule Collections". Resource *string }
OperationDisplay - Localized display information for this particular operation.
func (OperationDisplay) MarshalJSON ¶
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationListResult ¶
type OperationListResult struct { // READ-ONLY; URL to get the next set of operation list results (if there are any). NextLink *string // READ-ONLY; List of operations supported by the resource provider Value []*Operation }
OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
func (OperationListResult) MarshalJSON ¶
func (o OperationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResult.
func (*OperationListResult) UnmarshalJSON ¶
func (o *OperationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
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 ¶
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - Lists all of the available Storage Actions Rest API operations.
Generated from API version 2023-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/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/OperationsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armstorageactions.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewOperationsClient().NewListPager(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.OperationListResult = armstorageactions.OperationListResult{ // Value: []*armstorageactions.Operation{ // { // Name: to.Ptr("Microsoft.StorageActions/storageTasks/read"), // Display: &armstorageactions.OperationDisplay{ // Description: to.Ptr("Gets or Lists existing StorageTask resource(s)."), // Operation: to.Ptr("Get or List StorageTask resource(s)."), // Provider: to.Ptr("Microsoft StorageActions"), // Resource: to.Ptr("StorageTasks"), // }, // IsDataAction: to.Ptr(false), // }, // { // Name: to.Ptr("Microsoft.StorageActions/storageTasks/write"), // Display: &armstorageactions.OperationDisplay{ // Description: to.Ptr("Creates or Updates StorageTask resource."), // Operation: to.Ptr("Create or Update StorageTask resource."), // Provider: to.Ptr("Microsoft StorageActions"), // Resource: to.Ptr("StorageTasks"), // }, // IsDataAction: to.Ptr(false), // }, // { // Name: to.Ptr("Microsoft.StorageActions/storageTasks/delete"), // Display: &armstorageactions.OperationDisplay{ // Description: to.Ptr("Deletes StorageTask resource."), // Operation: to.Ptr("Delete StorageTask resource."), // Provider: to.Ptr("Microsoft StorageActions"), // Resource: to.Ptr("StorageTasks"), // }, // IsDataAction: to.Ptr(false), // }}, // } } }
Output:
type OperationsClientListOptions ¶
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
type OperationsClientListResponse ¶
type OperationsClientListResponse struct { // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult }
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type Origin ¶
type Origin string
Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
func PossibleOriginValues ¶
func PossibleOriginValues() []Origin
PossibleOriginValues returns the possible values for the Origin const type.
type ProvisioningState ¶
type ProvisioningState string
ProvisioningState - Represents the provisioning state of the storage task.
const ( ProvisioningStateCanceled ProvisioningState = "Canceled" ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" ProvisioningStateValidateSubscriptionQuotaBegin ProvisioningState = "ValidateSubscriptionQuotaBegin" ProvisioningStateValidateSubscriptionQuotaEnd ProvisioningState = "ValidateSubscriptionQuotaEnd" )
func PossibleProvisioningStateValues ¶
func PossibleProvisioningStateValues() []ProvisioningState
PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
type RunResult ¶
type RunResult string
RunResult - Represents the overall result of the execution for the run instance
func PossibleRunResultValues ¶
func PossibleRunResultValues() []RunResult
PossibleRunResultValues returns the possible values for the RunResult const type.
type RunStatusEnum ¶
type RunStatusEnum string
RunStatusEnum - Represents the status of the execution.
const ( RunStatusEnumFinished RunStatusEnum = "Finished" RunStatusEnumInProgress RunStatusEnum = "InProgress" )
func PossibleRunStatusEnumValues ¶
func PossibleRunStatusEnumValues() []RunStatusEnum
PossibleRunStatusEnumValues returns the possible values for the RunStatusEnum const type.
type StorageTask ¶
type StorageTask struct { // REQUIRED; The geo-location where the resource lives Location *string // The managed service identity of the resource. Identity *ManagedServiceIdentity // Properties of the storage task. Properties *StorageTaskProperties // Resource tags. Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
StorageTask - Represents Storage Task.
func (StorageTask) MarshalJSON ¶
func (s StorageTask) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTask.
func (*StorageTask) UnmarshalJSON ¶
func (s *StorageTask) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTask.
type StorageTaskAction ¶
type StorageTaskAction struct { // REQUIRED; The if block of storage task operation If *IfCondition // The else block of storage task operation Else *ElseCondition }
StorageTaskAction - The storage task action represents conditional statements and operations to be performed on target objects.
func (StorageTaskAction) MarshalJSON ¶
func (s StorageTaskAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskAction.
func (*StorageTaskAction) UnmarshalJSON ¶
func (s *StorageTaskAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskAction.
type StorageTaskAssignment ¶
type StorageTaskAssignment struct { // READ-ONLY; ARM Id of the storage task assignments, associated with the storage tasks. ID *string }
StorageTaskAssignment - Fetch the Storage task assignment ARM ids.
func (StorageTaskAssignment) MarshalJSON ¶
func (s StorageTaskAssignment) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskAssignment.
func (*StorageTaskAssignment) UnmarshalJSON ¶
func (s *StorageTaskAssignment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskAssignment.
type StorageTaskAssignmentClient ¶
type StorageTaskAssignmentClient struct {
// contains filtered or unexported fields
}
StorageTaskAssignmentClient contains the methods for the StorageTaskAssignment group. Don't use this type directly, use NewStorageTaskAssignmentClient() instead.
func NewStorageTaskAssignmentClient ¶
func NewStorageTaskAssignmentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StorageTaskAssignmentClient, error)
NewStorageTaskAssignmentClient creates a new instance of StorageTaskAssignmentClient with the specified values.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*StorageTaskAssignmentClient) NewListPager ¶
func (client *StorageTaskAssignmentClient) NewListPager(resourceGroupName string, storageTaskName string, options *StorageTaskAssignmentClientListOptions) *runtime.Pager[StorageTaskAssignmentClientListResponse]
NewListPager - Lists all the storage tasks available under the given resource group.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- storageTaskName - The name of the storage task within the specified resource group. Storage task names must be between 3 and 18 characters in length and use numbers and lower-case letters only.
- options - StorageTaskAssignmentClientListOptions contains the optional parameters for the StorageTaskAssignmentClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTaskAssignmentIds.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armstorageactions.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewStorageTaskAssignmentClient().NewListPager("rgroup1", "mytask1", &armstorageactions.StorageTaskAssignmentClientListOptions{Maxpagesize: 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.StorageTaskAssignmentsListResult = armstorageactions.StorageTaskAssignmentsListResult{ // Value: []*armstorageactions.StorageTaskAssignment{ // { // ID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/microsoft.storage/storageaccounts/acc123/storagetaskassignments/assign123"), // }, // { // ID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/microsoft.storage/storageaccounts/acc123/storagetaskassignments/assign455"), // }, // { // ID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup3/providers/microsoft.storage/storageaccounts/accxx1/storagetaskassignments/assign123"), // }, // { // ID: to.Ptr("/subscriptions/28e089f2-9607-4285-a0d0-64dbe3771929/resourcegroups/rgroup4/providers/microsoft.storage/storageaccounts/accxx2/storagetaskassignments/assign123"), // }}, // } } }
Output:
type StorageTaskAssignmentClientListOptions ¶
type StorageTaskAssignmentClientListOptions struct { // Optional, specifies the maximum number of storage task assignment Ids to be included in the list response. Maxpagesize *string }
StorageTaskAssignmentClientListOptions contains the optional parameters for the StorageTaskAssignmentClient.NewListPager method.
type StorageTaskAssignmentClientListResponse ¶
type StorageTaskAssignmentClientListResponse struct { // The response from the List Storage Tasks operation. StorageTaskAssignmentsListResult }
StorageTaskAssignmentClientListResponse contains the response from method StorageTaskAssignmentClient.NewListPager.
type StorageTaskAssignmentsListResult ¶
type StorageTaskAssignmentsListResult struct { // READ-ONLY; Request URL that can be used to query next page of storage task assignment Ids. Returned when total number of // requested storage task assignment Ids exceed maximum page size. NextLink *string // READ-ONLY; Gets the list of storage task assignment Ids. Value []*StorageTaskAssignment }
StorageTaskAssignmentsListResult - The response from the List Storage Tasks operation.
func (StorageTaskAssignmentsListResult) MarshalJSON ¶
func (s StorageTaskAssignmentsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskAssignmentsListResult.
func (*StorageTaskAssignmentsListResult) UnmarshalJSON ¶
func (s *StorageTaskAssignmentsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskAssignmentsListResult.
type StorageTaskOperation ¶
type StorageTaskOperation struct { // REQUIRED; The operation to be performed on the object. Name *StorageTaskOperationName // Action to be taken when the operation fails for a object. OnFailure *string // Action to be taken when the operation is successful for a object. OnSuccess *string // Key-value parameters for the operation. Parameters map[string]*string }
StorageTaskOperation - Represents an operation to be performed on the object
func (StorageTaskOperation) MarshalJSON ¶
func (s StorageTaskOperation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskOperation.
func (*StorageTaskOperation) UnmarshalJSON ¶
func (s *StorageTaskOperation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskOperation.
type StorageTaskOperationName ¶
type StorageTaskOperationName string
StorageTaskOperationName - The operation to be performed on the object.
const ( StorageTaskOperationNameDeleteBlob StorageTaskOperationName = "DeleteBlob" StorageTaskOperationNameSetBlobExpiry StorageTaskOperationName = "SetBlobExpiry" StorageTaskOperationNameSetBlobImmutabilityPolicy StorageTaskOperationName = "SetBlobImmutabilityPolicy" StorageTaskOperationNameSetBlobLegalHold StorageTaskOperationName = "SetBlobLegalHold" StorageTaskOperationNameSetBlobTags StorageTaskOperationName = "SetBlobTags" StorageTaskOperationNameSetBlobTier StorageTaskOperationName = "SetBlobTier" StorageTaskOperationNameUndeleteBlob StorageTaskOperationName = "UndeleteBlob" )
func PossibleStorageTaskOperationNameValues ¶
func PossibleStorageTaskOperationNameValues() []StorageTaskOperationName
PossibleStorageTaskOperationNameValues returns the possible values for the StorageTaskOperationName const type.
type StorageTaskPreviewAction ¶
type StorageTaskPreviewAction struct { // REQUIRED; Properties of the storage task preview. Properties *StorageTaskPreviewActionProperties }
StorageTaskPreviewAction - Storage Task Preview Action.
func (StorageTaskPreviewAction) MarshalJSON ¶
func (s StorageTaskPreviewAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskPreviewAction.
func (*StorageTaskPreviewAction) UnmarshalJSON ¶
func (s *StorageTaskPreviewAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskPreviewAction.
type StorageTaskPreviewActionCondition ¶
type StorageTaskPreviewActionCondition struct { // REQUIRED; Specify whether the else block is present in the condition. ElseBlockExists *bool // REQUIRED; The condition to be tested for a match with container and blob properties. If *StorageTaskPreviewActionIfCondition }
StorageTaskPreviewActionCondition - Represents the storage task conditions to be tested for a match with container and blob properties.
func (StorageTaskPreviewActionCondition) MarshalJSON ¶
func (s StorageTaskPreviewActionCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskPreviewActionCondition.
func (*StorageTaskPreviewActionCondition) UnmarshalJSON ¶
func (s *StorageTaskPreviewActionCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskPreviewActionCondition.
type StorageTaskPreviewActionIfCondition ¶
type StorageTaskPreviewActionIfCondition struct { // Storage task condition to bes tested for a match. Condition *string }
StorageTaskPreviewActionIfCondition - Represents storage task preview action condition.
func (StorageTaskPreviewActionIfCondition) MarshalJSON ¶
func (s StorageTaskPreviewActionIfCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskPreviewActionIfCondition.
func (*StorageTaskPreviewActionIfCondition) UnmarshalJSON ¶
func (s *StorageTaskPreviewActionIfCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskPreviewActionIfCondition.
type StorageTaskPreviewActionProperties ¶
type StorageTaskPreviewActionProperties struct { // REQUIRED; Preview action container properties to be tested for a match with the provided condition. Action *StorageTaskPreviewActionCondition // REQUIRED; Preview action container properties to be tested for a match with the provided condition. Blobs []*StorageTaskPreviewBlobProperties // REQUIRED; Preview action container properties to be tested for a match with the provided condition. Container *StorageTaskPreviewContainerProperties }
StorageTaskPreviewActionProperties - Storage task preview action properties.
func (StorageTaskPreviewActionProperties) MarshalJSON ¶
func (s StorageTaskPreviewActionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskPreviewActionProperties.
func (*StorageTaskPreviewActionProperties) UnmarshalJSON ¶
func (s *StorageTaskPreviewActionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskPreviewActionProperties.
type StorageTaskPreviewBlobProperties ¶
type StorageTaskPreviewBlobProperties struct { // metadata key value pairs to be tested for a match against the provided condition. Metadata []*StorageTaskPreviewKeyValueProperties // property for the container name. Name *string // properties key value pairs to be tested for a match against the provided condition. Properties []*StorageTaskPreviewKeyValueProperties // tags key value pairs to be tested for a match against the provided condition. Tags []*StorageTaskPreviewKeyValueProperties // READ-ONLY; Represents the condition block name that matched blob properties. MatchedBlock *MatchedBlockName }
StorageTaskPreviewBlobProperties - Storage task preview container properties
func (StorageTaskPreviewBlobProperties) MarshalJSON ¶
func (s StorageTaskPreviewBlobProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskPreviewBlobProperties.
func (*StorageTaskPreviewBlobProperties) UnmarshalJSON ¶
func (s *StorageTaskPreviewBlobProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskPreviewBlobProperties.
type StorageTaskPreviewContainerProperties ¶
type StorageTaskPreviewContainerProperties struct { // metadata key value pairs to be tested for a match against the provided condition. Metadata []*StorageTaskPreviewKeyValueProperties // property for the container name. Name *string }
StorageTaskPreviewContainerProperties - Storage task preview container properties
func (StorageTaskPreviewContainerProperties) MarshalJSON ¶
func (s StorageTaskPreviewContainerProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskPreviewContainerProperties.
func (*StorageTaskPreviewContainerProperties) UnmarshalJSON ¶
func (s *StorageTaskPreviewContainerProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskPreviewContainerProperties.
type StorageTaskPreviewKeyValueProperties ¶
type StorageTaskPreviewKeyValueProperties struct { // Represents the key property of the pair. Key *string // Represents the value property of the pair. Value *string }
StorageTaskPreviewKeyValueProperties - Storage task preview object key value pair properties.
func (StorageTaskPreviewKeyValueProperties) MarshalJSON ¶
func (s StorageTaskPreviewKeyValueProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskPreviewKeyValueProperties.
func (*StorageTaskPreviewKeyValueProperties) UnmarshalJSON ¶
func (s *StorageTaskPreviewKeyValueProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskPreviewKeyValueProperties.
type StorageTaskProperties ¶
type StorageTaskProperties struct { // REQUIRED; The storage task action that is executed Action *StorageTaskAction // REQUIRED; Text that describes the purpose of the storage task Description *string // REQUIRED; Storage Task is enabled when set to true and disabled when set to false Enabled *bool // READ-ONLY; The creation date and time of the storage task in UTC. CreationTimeInUTC *time.Time // READ-ONLY; Represents the provisioning state of the storage task. ProvisioningState *ProvisioningState // READ-ONLY; Storage task version. TaskVersion *int64 }
StorageTaskProperties - Properties of the storage task.
func (StorageTaskProperties) MarshalJSON ¶
func (s StorageTaskProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskProperties.
func (*StorageTaskProperties) UnmarshalJSON ¶
func (s *StorageTaskProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskProperties.
type StorageTaskReportInstance ¶
type StorageTaskReportInstance struct { // Storage task execution report for a run instance. Properties *StorageTaskReportProperties // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
StorageTaskReportInstance - Storage Tasks run report instance
func (StorageTaskReportInstance) MarshalJSON ¶
func (s StorageTaskReportInstance) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskReportInstance.
func (*StorageTaskReportInstance) UnmarshalJSON ¶
func (s *StorageTaskReportInstance) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskReportInstance.
type StorageTaskReportProperties ¶
type StorageTaskReportProperties struct { // READ-ONLY; End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison // operators can be used as described for DateTime properties in // https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators FinishTime *string // READ-ONLY; Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount // eq 0 and other comparison operators can be used as described for Numerical properties // in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators ObjectFailedCount *string // READ-ONLY; Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as // objectsOperatedOnCount ge 100 and other comparison operators can be used as described for // Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators ObjectsOperatedOnCount *string // READ-ONLY; Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount // gt 150 and other comparison operators can be used as described for Numerical // properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators ObjectsSucceededCount *string // READ-ONLY; Total number of objects that meet the condition as defined in the storage task assignment execution context. // Filter options such as objectsTargetedCount gt 50 and other comparison operators can be // used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators ObjectsTargetedCount *string // READ-ONLY; Represents the overall result of the execution for the run instance RunResult *RunResult // READ-ONLY; Represents the status of the execution. RunStatusEnum *RunStatusEnum // READ-ONLY; Well known Azure Storage error code that represents the error encountered during execution of the run instance. RunStatusError *string // READ-ONLY; Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other // comparison operators can be used as described for DateTime properties in // https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators StartTime *string // READ-ONLY; Represents the Storage Account Id where the storage task definition was applied and executed. StorageAccountID *string // READ-ONLY; Full path to the verbose report stored in the reporting container as specified in the assignment execution context // for the storage account. SummaryReportPath *string // READ-ONLY; Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. TaskAssignmentID *string // READ-ONLY; Storage Task Arm Id. TaskID *string // READ-ONLY; Storage Task Version TaskVersion *string }
StorageTaskReportProperties - Storage task execution report for a run instance.
func (StorageTaskReportProperties) MarshalJSON ¶
func (s StorageTaskReportProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskReportProperties.
func (*StorageTaskReportProperties) UnmarshalJSON ¶
func (s *StorageTaskReportProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskReportProperties.
type StorageTaskReportSummary ¶
type StorageTaskReportSummary struct { // READ-ONLY; Request URL that can be used to query next page of storage task run results summary. Returned when the number // of run instances and summary reports exceed maximum page size. NextLink *string // READ-ONLY; Gets storage tasks run result summary. Value []*StorageTaskReportInstance }
StorageTaskReportSummary - Fetch Storage Tasks Run Summary.
func (StorageTaskReportSummary) MarshalJSON ¶
func (s StorageTaskReportSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskReportSummary.
func (*StorageTaskReportSummary) UnmarshalJSON ¶
func (s *StorageTaskReportSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskReportSummary.
type StorageTaskUpdateParameters ¶
type StorageTaskUpdateParameters struct { // The identity of the resource. Identity *ManagedServiceIdentity // Properties of the storage task. Properties *StorageTaskProperties // Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this // resource (across resource groups). A maximum of 15 tags can be provided for a // resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. Tags map[string]*string }
StorageTaskUpdateParameters - Parameters of the storage task update request
func (StorageTaskUpdateParameters) MarshalJSON ¶
func (s StorageTaskUpdateParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTaskUpdateParameters.
func (*StorageTaskUpdateParameters) UnmarshalJSON ¶
func (s *StorageTaskUpdateParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTaskUpdateParameters.
type StorageTasksClient ¶
type StorageTasksClient struct {
// contains filtered or unexported fields
}
StorageTasksClient contains the methods for the StorageTasks group. Don't use this type directly, use NewStorageTasksClient() instead.
func NewStorageTasksClient ¶
func NewStorageTasksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StorageTasksClient, error)
NewStorageTasksClient creates a new instance of StorageTasksClient with the specified values.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*StorageTasksClient) BeginCreate ¶
func (client *StorageTasksClient) BeginCreate(ctx context.Context, resourceGroupName string, storageTaskName string, parameters StorageTask, options *StorageTasksClientBeginCreateOptions) (*runtime.Poller[StorageTasksClientCreateResponse], error)
BeginCreate - Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already created and a subsequent create request is issued with different properties, the storage task properties will be updated. If a storage task is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- storageTaskName - The name of the storage task within the specified resource group. Storage task names must be between 3 and 18 characters in length and use numbers and lower-case letters only.
- parameters - The parameters to create a Storage Task.
- options - StorageTasksClientBeginCreateOptions contains the optional parameters for the StorageTasksClient.BeginCreate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/PutStorageTask.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/storageactions/armstorageactions" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armstorageactions.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewStorageTasksClient().BeginCreate(ctx, "res4228", "mytask1", armstorageactions.StorageTask{ Location: to.Ptr("westus"), Properties: &armstorageactions.StorageTaskProperties{ Description: to.Ptr("My Storage task"), Action: &armstorageactions.StorageTaskAction{ Else: &armstorageactions.ElseCondition{ Operations: []*armstorageactions.StorageTaskOperation{ { Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), OnFailure: to.Ptr("break"), OnSuccess: to.Ptr("continue"), }}, }, If: &armstorageactions.IfCondition{ Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), Operations: []*armstorageactions.StorageTaskOperation{ { Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), OnFailure: to.Ptr("break"), OnSuccess: to.Ptr("continue"), Parameters: map[string]*string{ "tier": to.Ptr("Hot"), }, }}, }, }, Enabled: to.Ptr(true), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %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.StorageTask = armstorageactions.StorageTask{ // Name: to.Ptr("mytask1"), // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1"), // Location: to.Ptr("westus"), // Properties: &armstorageactions.StorageTaskProperties{ // Description: to.Ptr("Storage task"), // Action: &armstorageactions.StorageTaskAction{ // Else: &armstorageactions.ElseCondition{ // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // }}, // }, // If: &armstorageactions.IfCondition{ // Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // Parameters: map[string]*string{ // "tier": to.Ptr("Hot"), // }, // }}, // }, // }, // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-06T00:24:59.144Z"); return t}()), // Enabled: to.Ptr(true), // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), // TaskVersion: to.Ptr[int64](1), // }, // } }
Output:
func (*StorageTasksClient) BeginDelete ¶
func (client *StorageTasksClient) BeginDelete(ctx context.Context, resourceGroupName string, storageTaskName string, options *StorageTasksClientBeginDeleteOptions) (*runtime.Poller[StorageTasksClientDeleteResponse], error)
BeginDelete - Delete the storage task resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- storageTaskName - The name of the storage task within the specified resource group. Storage task names must be between 3 and 18 characters in length and use numbers and lower-case letters only.
- options - StorageTasksClientBeginDeleteOptions contains the optional parameters for the StorageTasksClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/DeleteStorageTask.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armstorageactions.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewStorageTasksClient().BeginDelete(ctx, "res4228", "mytask1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*StorageTasksClient) BeginUpdate ¶
func (client *StorageTasksClient) BeginUpdate(ctx context.Context, resourceGroupName string, storageTaskName string, parameters StorageTaskUpdateParameters, options *StorageTasksClientBeginUpdateOptions) (*runtime.Poller[StorageTasksClientUpdateResponse], error)
BeginUpdate - Update storage task properties If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- storageTaskName - The name of the storage task within the specified resource group. Storage task names must be between 3 and 18 characters in length and use numbers and lower-case letters only.
- parameters - The parameters to provide to update the storage task resource.
- options - StorageTasksClientBeginUpdateOptions contains the optional parameters for the StorageTasksClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/PatchStorageTask.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/storageactions/armstorageactions" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armstorageactions.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewStorageTasksClient().BeginUpdate(ctx, "res4228", "mytask1", armstorageactions.StorageTaskUpdateParameters{ Properties: &armstorageactions.StorageTaskProperties{ Description: to.Ptr("My Storage task"), Action: &armstorageactions.StorageTaskAction{ Else: &armstorageactions.ElseCondition{ Operations: []*armstorageactions.StorageTaskOperation{ { Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), OnFailure: to.Ptr("break"), OnSuccess: to.Ptr("continue"), }}, }, If: &armstorageactions.IfCondition{ Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), Operations: []*armstorageactions.StorageTaskOperation{ { Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), OnFailure: to.Ptr("break"), OnSuccess: to.Ptr("continue"), Parameters: map[string]*string{ "tier": to.Ptr("Hot"), }, }}, }, }, Enabled: to.Ptr(true), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %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.StorageTask = armstorageactions.StorageTask{ // Name: to.Ptr("mytask1"), // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1"), // Location: to.Ptr("westus"), // Properties: &armstorageactions.StorageTaskProperties{ // Description: to.Ptr("Storage task"), // Action: &armstorageactions.StorageTaskAction{ // Else: &armstorageactions.ElseCondition{ // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // }}, // }, // If: &armstorageactions.IfCondition{ // Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // Parameters: map[string]*string{ // "tier": to.Ptr("Hot"), // }, // }}, // }, // }, // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-06T00:24:59.144Z"); return t}()), // Enabled: to.Ptr(true), // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), // TaskVersion: to.Ptr[int64](1), // }, // } }
Output:
func (*StorageTasksClient) Get ¶
func (client *StorageTasksClient) Get(ctx context.Context, resourceGroupName string, storageTaskName string, options *StorageTasksClientGetOptions) (StorageTasksClientGetResponse, error)
Get - Get the storage task properties If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- storageTaskName - The name of the storage task within the specified resource group. Storage task names must be between 3 and 18 characters in length and use numbers and lower-case letters only.
- options - StorageTasksClientGetOptions contains the optional parameters for the StorageTasksClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/GetStorageTask.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armstorageactions.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewStorageTasksClient().Get(ctx, "res4228", "mytask1", 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.StorageTask = armstorageactions.StorageTask{ // Name: to.Ptr("mytask1"), // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), // ID: to.Ptr("/subscriptions/1f31ba14-ce16-4281-b9b4-3e78da6e1616/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1"), // Location: to.Ptr("westus"), // Properties: &armstorageactions.StorageTaskProperties{ // Description: to.Ptr("Storage task"), // Action: &armstorageactions.StorageTaskAction{ // Else: &armstorageactions.ElseCondition{ // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // }}, // }, // If: &armstorageactions.IfCondition{ // Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // Parameters: map[string]*string{ // "tier": to.Ptr("Hot"), // }, // }}, // }, // }, // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-06T00:24:59.144Z"); return t}()), // Enabled: to.Ptr(true), // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), // TaskVersion: to.Ptr[int64](1), // }, // } }
Output:
func (*StorageTasksClient) NewListByResourceGroupPager ¶
func (client *StorageTasksClient) NewListByResourceGroupPager(resourceGroupName string, options *StorageTasksClientListByResourceGroupOptions) *runtime.Pager[StorageTasksClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all the storage tasks available under the given resource group.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - StorageTasksClientListByResourceGroupOptions contains the optional parameters for the StorageTasksClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armstorageactions.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewStorageTasksClient().NewListByResourceGroupPager("res6117", 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.StorageTasksListResult = armstorageactions.StorageTasksListResult{ // Value: []*armstorageactions.StorageTask{ // { // Name: to.Ptr("mytask1"), // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res6117/providers/Microsoft.StorageActions/storageTasks/mytask1"), // Location: to.Ptr("eastus"), // Identity: &armstorageactions.ManagedServiceIdentity{ // Type: to.Ptr(armstorageactions.ManagedServiceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("2fd475e8-8923-4597-842f-7ce1adfc6c4a"), // TenantID: to.Ptr("b4a2005c-32c1-434c-bbf0-ff486912fc75"), // }, // Properties: &armstorageactions.StorageTaskProperties{ // Description: to.Ptr("Storage task"), // Action: &armstorageactions.StorageTaskAction{ // If: &armstorageactions.IfCondition{ // Condition: to.Ptr("[[greater(Content-Length, '100')]]"), // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // }}, // }, // }, // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-05T23:06:50.772Z"); return t}()), // Enabled: to.Ptr(true), // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), // TaskVersion: to.Ptr[int64](1), // }, // }, // { // Name: to.Ptr("mytask2"), // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res6117/providers/Microsoft.StorageActions/storageTasks/mytask2"), // Location: to.Ptr("westus"), // Properties: &armstorageactions.StorageTaskProperties{ // Description: to.Ptr("Storage task"), // Action: &armstorageactions.StorageTaskAction{ // Else: &armstorageactions.ElseCondition{ // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // }}, // }, // If: &armstorageactions.IfCondition{ // Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // Parameters: map[string]*string{ // "tier": to.Ptr("Hot"), // }, // }}, // }, // }, // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-06T00:24:59.144Z"); return t}()), // Enabled: to.Ptr(true), // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), // TaskVersion: to.Ptr[int64](1), // }, // }}, // } } }
Output:
func (*StorageTasksClient) NewListBySubscriptionPager ¶
func (client *StorageTasksClient) NewListBySubscriptionPager(options *StorageTasksClientListBySubscriptionOptions) *runtime.Pager[StorageTasksClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists all the storage tasks available under the subscription.
Generated from API version 2023-01-01
- options - StorageTasksClientListBySubscriptionOptions contains the optional parameters for the StorageTasksClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksBySubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armstorageactions.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewStorageTasksClient().NewListBySubscriptionPager(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.StorageTasksListResult = armstorageactions.StorageTasksListResult{ // Value: []*armstorageactions.StorageTask{ // { // Name: to.Ptr("mytask1"), // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res6117/providers/Microsoft.StorageActions/storageTasks/mytask1"), // Location: to.Ptr("eastus"), // Identity: &armstorageactions.ManagedServiceIdentity{ // Type: to.Ptr(armstorageactions.ManagedServiceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("2fd475e8-8923-4597-842f-7ce1adfc6c4a"), // TenantID: to.Ptr("b4a2005c-32c1-434c-bbf0-ff486912fc75"), // }, // Properties: &armstorageactions.StorageTaskProperties{ // Description: to.Ptr("Storage task"), // Action: &armstorageactions.StorageTaskAction{ // If: &armstorageactions.IfCondition{ // Condition: to.Ptr("[[greater(Content-Length, '100')]]"), // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // }}, // }, // }, // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-05T23:06:50.772Z"); return t}()), // Enabled: to.Ptr(true), // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), // TaskVersion: to.Ptr[int64](1), // }, // }, // { // Name: to.Ptr("mytask2"), // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res6117/providers/Microsoft.StorageActions/storageTasks/mytask2"), // Location: to.Ptr("westus"), // Properties: &armstorageactions.StorageTaskProperties{ // Description: to.Ptr("Storage task"), // Action: &armstorageactions.StorageTaskAction{ // Else: &armstorageactions.ElseCondition{ // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // }}, // }, // If: &armstorageactions.IfCondition{ // Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), // Operations: []*armstorageactions.StorageTaskOperation{ // { // Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), // OnFailure: to.Ptr("break"), // OnSuccess: to.Ptr("continue"), // Parameters: map[string]*string{ // "tier": to.Ptr("Hot"), // }, // }}, // }, // }, // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-06T00:24:59.144Z"); return t}()), // Enabled: to.Ptr(true), // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), // TaskVersion: to.Ptr[int64](1), // }, // }}, // } } }
Output:
func (*StorageTasksClient) PreviewActions ¶
func (client *StorageTasksClient) PreviewActions(ctx context.Context, location string, parameters StorageTaskPreviewAction, options *StorageTasksClientPreviewActionsOptions) (StorageTasksClientPreviewActionsResponse, error)
PreviewActions - Runs the input conditions against input object metadata properties and designates matched objects in response. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- location - The location to perform preview of the actions.
- parameters - The parameters to preview action condition.
- options - StorageTasksClientPreviewActionsOptions contains the optional parameters for the StorageTasksClient.PreviewActions method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/PerformStorageTaskActionsPreview.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/storageactions/armstorageactions" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armstorageactions.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewStorageTasksClient().PreviewActions(ctx, "eastus", armstorageactions.StorageTaskPreviewAction{ Properties: &armstorageactions.StorageTaskPreviewActionProperties{ Action: &armstorageactions.StorageTaskPreviewActionCondition{ ElseBlockExists: to.Ptr(true), If: &armstorageactions.StorageTaskPreviewActionIfCondition{ Condition: to.Ptr("[[equals(AccessTier, 'Hot')]]"), }, }, Blobs: []*armstorageactions.StorageTaskPreviewBlobProperties{ { Name: to.Ptr("folder1/file1.txt"), Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ { Key: to.Ptr("mKey1"), Value: to.Ptr("mValue1"), }}, Properties: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ { Key: to.Ptr("Creation-Time"), Value: to.Ptr("Wed, 07 Jun 2023 05:23:29 GMT"), }, { Key: to.Ptr("Last-Modified"), Value: to.Ptr("Wed, 07 Jun 2023 05:23:29 GMT"), }, { Key: to.Ptr("Etag"), Value: to.Ptr("0x8DB67175454D36D"), }, { Key: to.Ptr("Content-Length"), Value: to.Ptr("38619"), }, { Key: to.Ptr("Content-Type"), Value: to.Ptr("text/xml"), }, { Key: to.Ptr("Content-Encoding"), Value: to.Ptr(""), }, { Key: to.Ptr("Content-Language"), Value: to.Ptr(""), }, { Key: to.Ptr("Content-CRC64"), Value: to.Ptr(""), }, { Key: to.Ptr("Content-MD5"), Value: to.Ptr("njr6iDrmU9+FC89WMK22EA=="), }, { Key: to.Ptr("Cache-Control"), Value: to.Ptr(""), }, { Key: to.Ptr("Content-Disposition"), Value: to.Ptr(""), }, { Key: to.Ptr("BlobType"), Value: to.Ptr("BlockBlob"), }, { Key: to.Ptr("AccessTier"), Value: to.Ptr("Hot"), }, { Key: to.Ptr("AccessTierInferred"), Value: to.Ptr("true"), }, { Key: to.Ptr("LeaseStatus"), Value: to.Ptr("unlocked"), }, { Key: to.Ptr("LeaseState"), Value: to.Ptr("available"), }, { Key: to.Ptr("ServerEncrypted"), Value: to.Ptr("true"), }, { Key: to.Ptr("TagCount"), Value: to.Ptr("1"), }}, Tags: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ { Key: to.Ptr("tKey1"), Value: to.Ptr("tValue1"), }}, }, { Name: to.Ptr("folder2/file1.txt"), Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ { Key: to.Ptr("mKey2"), Value: to.Ptr("mValue2"), }}, Properties: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ { Key: to.Ptr("Creation-Time"), Value: to.Ptr("Wed, 06 Jun 2023 05:23:29 GMT"), }, { Key: to.Ptr("Last-Modified"), Value: to.Ptr("Wed, 06 Jun 2023 05:23:29 GMT"), }, { Key: to.Ptr("Etag"), Value: to.Ptr("0x6FB67175454D36D"), }}, Tags: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ { Key: to.Ptr("tKey2"), Value: to.Ptr("tValue2"), }}, }}, Container: &armstorageactions.StorageTaskPreviewContainerProperties{ Name: to.Ptr("firstContainer"), Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ { Key: to.Ptr("mContainerKey1"), Value: to.Ptr("mContainerValue1"), }}, }, }, }, 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.StorageTaskPreviewAction = armstorageactions.StorageTaskPreviewAction{ // Properties: &armstorageactions.StorageTaskPreviewActionProperties{ // Action: &armstorageactions.StorageTaskPreviewActionCondition{ // ElseBlockExists: to.Ptr(true), // If: &armstorageactions.StorageTaskPreviewActionIfCondition{ // Condition: to.Ptr("[[equals(AccessTier, 'Hot')]]"), // }, // }, // Blobs: []*armstorageactions.StorageTaskPreviewBlobProperties{ // { // Name: to.Ptr("folder1/file1.txt"), // MatchedBlock: to.Ptr(armstorageactions.MatchedBlockNameIf), // Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ // { // Key: to.Ptr("mKey1"), // Value: to.Ptr("mValue1"), // }}, // Properties: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ // { // Key: to.Ptr("Creation-Time"), // Value: to.Ptr("Wed, 07 Jun 2023 05:23:29 GMT"), // }, // { // Key: to.Ptr("Last-Modified"), // Value: to.Ptr("Wed, 07 Jun 2023 05:23:29 GMT"), // }, // { // Key: to.Ptr("Etag"), // Value: to.Ptr("0x8DB67175454D36D"), // }, // { // Key: to.Ptr("Content-Length"), // Value: to.Ptr("38619"), // }, // { // Key: to.Ptr("Content-Type"), // Value: to.Ptr("text/xml"), // }, // { // Key: to.Ptr("Content-Encoding"), // Value: to.Ptr(""), // }, // { // Key: to.Ptr("Content-Language"), // Value: to.Ptr(""), // }, // { // Key: to.Ptr("Content-CRC64"), // Value: to.Ptr(""), // }, // { // Key: to.Ptr("Content-MD5"), // Value: to.Ptr("njr6iDrmU9+FC89WMK22EA=="), // }, // { // Key: to.Ptr("Cache-Control"), // Value: to.Ptr(""), // }, // { // Key: to.Ptr("Content-Disposition"), // Value: to.Ptr(""), // }, // { // Key: to.Ptr("BlobType"), // Value: to.Ptr("BlockBlob"), // }, // { // Key: to.Ptr("AccessTier"), // Value: to.Ptr("Hot"), // }, // { // Key: to.Ptr("AccessTierInferred"), // Value: to.Ptr("true"), // }, // { // Key: to.Ptr("LeaseStatus"), // Value: to.Ptr("unlocked"), // }, // { // Key: to.Ptr("LeaseState"), // Value: to.Ptr("available"), // }, // { // Key: to.Ptr("ServerEncrypted"), // Value: to.Ptr("true"), // }, // { // Key: to.Ptr("TagCount"), // Value: to.Ptr("1"), // }}, // Tags: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ // { // Key: to.Ptr("tKey1"), // Value: to.Ptr("tValue1"), // }}, // }, // { // Name: to.Ptr("folder2/file1.txt"), // MatchedBlock: to.Ptr(armstorageactions.MatchedBlockNameElse), // Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ // { // Key: to.Ptr("mKey2"), // Value: to.Ptr("mValue2"), // }}, // Properties: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ // { // Key: to.Ptr("Creation-Time"), // Value: to.Ptr("Wed, 06 Jun 2023 05:23:29 GMT"), // }, // { // Key: to.Ptr("Last-Modified"), // Value: to.Ptr("Wed, 06 Jun 2023 05:23:29 GMT"), // }, // { // Key: to.Ptr("Etag"), // Value: to.Ptr("0x6FB67175454D36D"), // }}, // Tags: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ // { // Key: to.Ptr("tKey2"), // Value: to.Ptr("tValue2"), // }}, // }}, // Container: &armstorageactions.StorageTaskPreviewContainerProperties{ // Name: to.Ptr("firstContainer"), // Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ // { // Key: to.Ptr("mContainerKey1"), // Value: to.Ptr("mContainerValue1"), // }}, // }, // }, // } }
Output:
type StorageTasksClientBeginCreateOptions ¶
type StorageTasksClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
StorageTasksClientBeginCreateOptions contains the optional parameters for the StorageTasksClient.BeginCreate method.
type StorageTasksClientBeginDeleteOptions ¶
type StorageTasksClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
StorageTasksClientBeginDeleteOptions contains the optional parameters for the StorageTasksClient.BeginDelete method.
type StorageTasksClientBeginUpdateOptions ¶
type StorageTasksClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
StorageTasksClientBeginUpdateOptions contains the optional parameters for the StorageTasksClient.BeginUpdate method.
type StorageTasksClientCreateResponse ¶
type StorageTasksClientCreateResponse struct { // Represents Storage Task. StorageTask }
StorageTasksClientCreateResponse contains the response from method StorageTasksClient.BeginCreate.
type StorageTasksClientDeleteResponse ¶
type StorageTasksClientDeleteResponse struct { }
StorageTasksClientDeleteResponse contains the response from method StorageTasksClient.BeginDelete.
type StorageTasksClientGetOptions ¶
type StorageTasksClientGetOptions struct { }
StorageTasksClientGetOptions contains the optional parameters for the StorageTasksClient.Get method.
type StorageTasksClientGetResponse ¶
type StorageTasksClientGetResponse struct { // Represents Storage Task. StorageTask }
StorageTasksClientGetResponse contains the response from method StorageTasksClient.Get.
type StorageTasksClientListByResourceGroupOptions ¶
type StorageTasksClientListByResourceGroupOptions struct { }
StorageTasksClientListByResourceGroupOptions contains the optional parameters for the StorageTasksClient.NewListByResourceGroupPager method.
type StorageTasksClientListByResourceGroupResponse ¶
type StorageTasksClientListByResourceGroupResponse struct { // The response from the List Storage Tasks operation. StorageTasksListResult }
StorageTasksClientListByResourceGroupResponse contains the response from method StorageTasksClient.NewListByResourceGroupPager.
type StorageTasksClientListBySubscriptionOptions ¶
type StorageTasksClientListBySubscriptionOptions struct { }
StorageTasksClientListBySubscriptionOptions contains the optional parameters for the StorageTasksClient.NewListBySubscriptionPager method.
type StorageTasksClientListBySubscriptionResponse ¶
type StorageTasksClientListBySubscriptionResponse struct { // The response from the List Storage Tasks operation. StorageTasksListResult }
StorageTasksClientListBySubscriptionResponse contains the response from method StorageTasksClient.NewListBySubscriptionPager.
type StorageTasksClientPreviewActionsOptions ¶
type StorageTasksClientPreviewActionsOptions struct { }
StorageTasksClientPreviewActionsOptions contains the optional parameters for the StorageTasksClient.PreviewActions method.
type StorageTasksClientPreviewActionsResponse ¶
type StorageTasksClientPreviewActionsResponse struct { // Storage Task Preview Action. StorageTaskPreviewAction }
StorageTasksClientPreviewActionsResponse contains the response from method StorageTasksClient.PreviewActions.
type StorageTasksClientUpdateResponse ¶
type StorageTasksClientUpdateResponse struct { // Represents Storage Task. StorageTask }
StorageTasksClientUpdateResponse contains the response from method StorageTasksClient.BeginUpdate.
type StorageTasksListResult ¶
type StorageTasksListResult struct { // READ-ONLY; Request URL that can be used to query next page of storage tasks. Returned when total number of requested storage // tasks exceed maximum page size. NextLink *string // READ-ONLY; Gets the list of storage tasks and their properties. Value []*StorageTask }
StorageTasksListResult - The response from the List Storage Tasks operation.
func (StorageTasksListResult) MarshalJSON ¶
func (s StorageTasksListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTasksListResult.
func (*StorageTasksListResult) UnmarshalJSON ¶
func (s *StorageTasksListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTasksListResult.
type StorageTasksReportClient ¶
type StorageTasksReportClient struct {
// contains filtered or unexported fields
}
StorageTasksReportClient contains the methods for the StorageTasksReport group. Don't use this type directly, use NewStorageTasksReportClient() instead.
func NewStorageTasksReportClient ¶
func NewStorageTasksReportClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StorageTasksReportClient, error)
NewStorageTasksReportClient creates a new instance of StorageTasksReportClient with the specified values.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*StorageTasksReportClient) NewListPager ¶
func (client *StorageTasksReportClient) NewListPager(resourceGroupName string, storageTaskName string, options *StorageTasksReportClientListOptions) *runtime.Pager[StorageTasksReportClientListResponse]
NewListPager - Fetch the storage tasks run report summary for each assignment.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- storageTaskName - The name of the storage task within the specified resource group. Storage task names must be between 3 and 18 characters in length and use numbers and lower-case letters only.
- options - StorageTasksReportClientListOptions contains the optional parameters for the StorageTasksReportClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksRunReportSummary.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armstorageactions.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewStorageTasksReportClient().NewListPager("rgroup1", "mytask1", &armstorageactions.StorageTasksReportClientListOptions{Maxpagesize: nil, Filter: 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.StorageTaskReportSummary = armstorageactions.StorageTaskReportSummary{ // Value: []*armstorageactions.StorageTaskReportInstance{ // { // Name: to.Ptr("instance1"), // Type: to.Ptr("Microsoft.StorageActions/storageTasks/reports"), // ID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.StorageActions/storageTasks/myTaskName/reports/instance1"), // Properties: &armstorageactions.StorageTaskReportProperties{ // FinishTime: to.Ptr("2023-06-23T00:40:10.2931264Z"), // ObjectFailedCount: to.Ptr("0"), // ObjectsOperatedOnCount: to.Ptr("150"), // ObjectsSucceededCount: to.Ptr("150"), // ObjectsTargetedCount: to.Ptr("150"), // RunResult: to.Ptr(armstorageactions.RunResultSucceeded), // RunStatusEnum: to.Ptr(armstorageactions.RunStatusEnumFinished), // RunStatusError: to.Ptr("0"), // StartTime: to.Ptr("2023-06-23T00:30:43.226744Z"), // StorageAccountID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.Storage/storageAccounts/acc123"), // SummaryReportPath: to.Ptr("https://acc123.blob.core.windows.net/result-container/{folderpath}/SummaryReport.json"), // TaskAssignmentID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.Storage/storageAccounts/acc123/storageTaskAssignments/assign1"), // TaskID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.StorageActions/storageTasks/mytask1"), // TaskVersion: to.Ptr("1"), // }, // }, // { // Name: to.Ptr("instance2"), // Type: to.Ptr("Microsoft.StorageActions/storageTasks/reports"), // ID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.StorageActions/storageTasks/myTaskName/reports/instance2"), // Properties: &armstorageactions.StorageTaskReportProperties{ // FinishTime: to.Ptr("2023-06-23T00:40:10.2931264Z"), // ObjectFailedCount: to.Ptr("0"), // ObjectsOperatedOnCount: to.Ptr("150"), // ObjectsSucceededCount: to.Ptr("150"), // ObjectsTargetedCount: to.Ptr("150"), // RunResult: to.Ptr(armstorageactions.RunResultSucceeded), // RunStatusEnum: to.Ptr(armstorageactions.RunStatusEnumFinished), // RunStatusError: to.Ptr("0"), // StartTime: to.Ptr("2023-06-23T00:30:43.226744Z"), // StorageAccountID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.Storage/storageAccounts/acc123"), // SummaryReportPath: to.Ptr("https://acc123.blob.core.windows.net/result-container/{folderpath}/SummaryReport.json"), // TaskAssignmentID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.Storage/storageAccounts/acc123/storageTaskAssignments/assign1"), // TaskID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.StorageActions/storageTasks/mytask1"), // TaskVersion: to.Ptr("1"), // }, // }}, // } } }
Output:
type StorageTasksReportClientListOptions ¶
type StorageTasksReportClientListOptions struct { // Optional. When specified, it can be used to query using reporting properties. Filter *string // Optional, specifies the maximum number of storage task assignment Ids to be included in the list response. Maxpagesize *string }
StorageTasksReportClientListOptions contains the optional parameters for the StorageTasksReportClient.NewListPager method.
type StorageTasksReportClientListResponse ¶
type StorageTasksReportClientListResponse struct { // Fetch Storage Tasks Run Summary. StorageTaskReportSummary }
StorageTasksReportClientListResponse contains the response from method StorageTasksReportClient.NewListPager.
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 UserAssignedIdentity ¶
type UserAssignedIdentity struct { // READ-ONLY; The client ID of the assigned identity. ClientID *string // READ-ONLY; The principal ID of the assigned identity. PrincipalID *string }
UserAssignedIdentity - User assigned identity properties
func (UserAssignedIdentity) MarshalJSON ¶
func (u UserAssignedIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.
func (*UserAssignedIdentity) UnmarshalJSON ¶
func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.