Documentation ¶
Index ¶
- type Action
- type ActionClassification
- type ActionStatus
- type ActionType
- type Branch
- type BranchStatus
- type CapabilitiesClient
- func (client *CapabilitiesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, parentProviderNamespace string, ...) (CapabilitiesClientCreateOrUpdateResponse, error)
- func (client *CapabilitiesClient) Delete(ctx context.Context, resourceGroupName string, parentProviderNamespace string, ...) (CapabilitiesClientDeleteResponse, error)
- func (client *CapabilitiesClient) Get(ctx context.Context, resourceGroupName string, parentProviderNamespace string, ...) (CapabilitiesClientGetResponse, error)
- func (client *CapabilitiesClient) NewListPager(resourceGroupName string, parentProviderNamespace string, ...) *runtime.Pager[CapabilitiesClientListResponse]
- type CapabilitiesClientCreateOrUpdateOptions
- type CapabilitiesClientCreateOrUpdateResponse
- type CapabilitiesClientDeleteOptions
- type CapabilitiesClientDeleteResponse
- type CapabilitiesClientGetOptions
- type CapabilitiesClientGetResponse
- type CapabilitiesClientListOptions
- type CapabilitiesClientListResponse
- type Capability
- type CapabilityListResult
- type CapabilityProperties
- type CapabilityType
- type CapabilityTypeListResult
- type CapabilityTypeProperties
- type CapabilityTypesClient
- func (client *CapabilityTypesClient) Get(ctx context.Context, locationName string, targetTypeName string, ...) (CapabilityTypesClientGetResponse, error)
- func (client *CapabilityTypesClient) NewListPager(locationName string, targetTypeName string, ...) *runtime.Pager[CapabilityTypesClientListResponse]
- type CapabilityTypesClientGetOptions
- type CapabilityTypesClientGetResponse
- type CapabilityTypesClientListOptions
- type CapabilityTypesClientListResponse
- type ClientFactory
- func (c *ClientFactory) NewCapabilitiesClient() *CapabilitiesClient
- func (c *ClientFactory) NewCapabilityTypesClient() *CapabilityTypesClient
- func (c *ClientFactory) NewExperimentsClient() *ExperimentsClient
- func (c *ClientFactory) NewOperationsClient() *OperationsClient
- func (c *ClientFactory) NewTargetTypesClient() *TargetTypesClient
- func (c *ClientFactory) NewTargetsClient() *TargetsClient
- type ContinuousAction
- type CreatedByType
- type DelayAction
- type DiscreteAction
- type ErrorAdditionalInfo
- type ErrorDetail
- type ErrorResponse
- type Experiment
- type ExperimentCancelOperationResult
- type ExperimentExecutionActionTargetDetailsError
- type ExperimentExecutionActionTargetDetailsProperties
- type ExperimentExecutionDetails
- type ExperimentExecutionDetailsListResult
- type ExperimentExecutionDetailsProperties
- type ExperimentExecutionDetailsPropertiesRunInformation
- type ExperimentListResult
- type ExperimentProperties
- type ExperimentStartOperationResult
- type ExperimentStatus
- type ExperimentStatusListResult
- type ExperimentStatusProperties
- type ExperimentsClient
- func (client *ExperimentsClient) BeginCancel(ctx context.Context, resourceGroupName string, experimentName string, ...) (*runtime.Poller[ExperimentsClientCancelResponse], error)
- func (client *ExperimentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, experimentName string, ...) (*runtime.Poller[ExperimentsClientCreateOrUpdateResponse], error)
- func (client *ExperimentsClient) Delete(ctx context.Context, resourceGroupName string, experimentName string, ...) (ExperimentsClientDeleteResponse, error)
- func (client *ExperimentsClient) Get(ctx context.Context, resourceGroupName string, experimentName string, ...) (ExperimentsClientGetResponse, error)
- func (client *ExperimentsClient) GetExecutionDetails(ctx context.Context, resourceGroupName string, experimentName string, ...) (ExperimentsClientGetExecutionDetailsResponse, error)
- func (client *ExperimentsClient) GetStatus(ctx context.Context, resourceGroupName string, experimentName string, ...) (ExperimentsClientGetStatusResponse, error)
- func (client *ExperimentsClient) NewListAllPager(options *ExperimentsClientListAllOptions) *runtime.Pager[ExperimentsClientListAllResponse]
- func (client *ExperimentsClient) NewListAllStatusesPager(resourceGroupName string, experimentName string, ...) *runtime.Pager[ExperimentsClientListAllStatusesResponse]
- func (client *ExperimentsClient) NewListExecutionDetailsPager(resourceGroupName string, experimentName string, ...) *runtime.Pager[ExperimentsClientListExecutionDetailsResponse]
- func (client *ExperimentsClient) NewListPager(resourceGroupName string, options *ExperimentsClientListOptions) *runtime.Pager[ExperimentsClientListResponse]
- func (client *ExperimentsClient) Start(ctx context.Context, resourceGroupName string, experimentName string, ...) (ExperimentsClientStartResponse, error)
- type ExperimentsClientBeginCancelOptions
- type ExperimentsClientBeginCreateOrUpdateOptions
- type ExperimentsClientCancelResponse
- type ExperimentsClientCreateOrUpdateResponse
- type ExperimentsClientDeleteOptions
- type ExperimentsClientDeleteResponse
- type ExperimentsClientGetExecutionDetailsOptions
- type ExperimentsClientGetExecutionDetailsResponse
- type ExperimentsClientGetOptions
- type ExperimentsClientGetResponse
- type ExperimentsClientGetStatusOptions
- type ExperimentsClientGetStatusResponse
- type ExperimentsClientListAllOptions
- type ExperimentsClientListAllResponse
- type ExperimentsClientListAllStatusesOptions
- type ExperimentsClientListAllStatusesResponse
- type ExperimentsClientListExecutionDetailsOptions
- type ExperimentsClientListExecutionDetailsResponse
- type ExperimentsClientListOptions
- type ExperimentsClientListResponse
- type ExperimentsClientStartOptions
- type ExperimentsClientStartResponse
- type KeyValuePair
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListAllOptions
- type OperationsClientListAllResponse
- type Origin
- type Resource
- type ResourceIdentity
- type ResourceIdentityType
- type Selector
- type SelectorType
- type Step
- type StepStatus
- type SystemData
- type Target
- type TargetListResult
- type TargetReference
- type TargetType
- type TargetTypeListResult
- type TargetTypeProperties
- type TargetTypesClient
- type TargetTypesClientGetOptions
- type TargetTypesClientGetResponse
- type TargetTypesClientListOptions
- type TargetTypesClientListResponse
- type TargetsClient
- func (client *TargetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, parentProviderNamespace string, ...) (TargetsClientCreateOrUpdateResponse, error)
- func (client *TargetsClient) Delete(ctx context.Context, resourceGroupName string, parentProviderNamespace string, ...) (TargetsClientDeleteResponse, error)
- func (client *TargetsClient) Get(ctx context.Context, resourceGroupName string, parentProviderNamespace string, ...) (TargetsClientGetResponse, error)
- func (client *TargetsClient) NewListPager(resourceGroupName string, parentProviderNamespace string, ...) *runtime.Pager[TargetsClientListResponse]
- type TargetsClientCreateOrUpdateOptions
- type TargetsClientCreateOrUpdateResponse
- type TargetsClientDeleteOptions
- type TargetsClientDeleteResponse
- type TargetsClientGetOptions
- type TargetsClientGetResponse
- type TargetsClientListOptions
- type TargetsClientListResponse
- type TrackedResource
Examples ¶
- CapabilitiesClient.CreateOrUpdate
- CapabilitiesClient.Delete
- CapabilitiesClient.Get
- CapabilitiesClient.NewListPager
- CapabilityTypesClient.Get
- CapabilityTypesClient.NewListPager
- ExperimentsClient.BeginCancel
- ExperimentsClient.BeginCreateOrUpdate
- ExperimentsClient.Delete
- ExperimentsClient.Get
- ExperimentsClient.GetExecutionDetails
- ExperimentsClient.GetStatus
- ExperimentsClient.NewListAllPager
- ExperimentsClient.NewListAllStatusesPager
- ExperimentsClient.NewListExecutionDetailsPager
- ExperimentsClient.NewListPager
- ExperimentsClient.Start
- TargetTypesClient.Get
- TargetTypesClient.NewListPager
- TargetsClient.CreateOrUpdate
- TargetsClient.Delete
- TargetsClient.Get
- TargetsClient.NewListPager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { // REQUIRED; String that represents a Capability URN. Name *string `json:"name,omitempty"` // REQUIRED; Enum that discriminates between action models. Type *string `json:"type,omitempty"` }
Action - Model that represents the base action model.
func (Action) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Action.
func (*Action) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Action.
type ActionClassification ¶
type ActionClassification interface { // GetAction returns the Action content of the underlying type. GetAction() *Action }
ActionClassification provides polymorphic access to related types. Call the interface's GetAction() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *Action, *ContinuousAction, *DelayAction, *DiscreteAction
type ActionStatus ¶
type ActionStatus struct { // READ-ONLY; The id of the action status. ActionID *string `json:"actionId,omitempty" azure:"ro"` // READ-ONLY; The name of the action status. ActionName *string `json:"actionName,omitempty" azure:"ro"` // READ-ONLY; String that represents the end time of the action. EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` // READ-ONLY; String that represents the start time of the action. StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` // READ-ONLY; The status of the action. Status *string `json:"status,omitempty" azure:"ro"` // READ-ONLY; The array of targets. Targets []*ExperimentExecutionActionTargetDetailsProperties `json:"targets,omitempty" azure:"ro"` }
ActionStatus - Model that represents the an action and its status.
func (ActionStatus) MarshalJSON ¶
func (a ActionStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionStatus.
func (*ActionStatus) UnmarshalJSON ¶ added in v0.5.0
func (a *ActionStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionStatus.
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 Branch ¶
type Branch struct { // REQUIRED; List of actions. Actions []ActionClassification `json:"actions,omitempty"` // REQUIRED; String of the branch name. Name *string `json:"name,omitempty"` }
Branch - Model that represents a branch in the step.
func (Branch) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Branch.
func (*Branch) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Branch.
type BranchStatus ¶
type BranchStatus struct { // READ-ONLY; The array of actions. Actions []*ActionStatus `json:"actions,omitempty" azure:"ro"` // READ-ONLY; The id of the branch status. BranchID *string `json:"branchId,omitempty" azure:"ro"` // READ-ONLY; The name of the branch status. BranchName *string `json:"branchName,omitempty" azure:"ro"` // READ-ONLY; The status of the branch. Status *string `json:"status,omitempty" azure:"ro"` }
BranchStatus - Model that represents the a list of actions and action statuses.
func (BranchStatus) MarshalJSON ¶
func (b BranchStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BranchStatus.
func (*BranchStatus) UnmarshalJSON ¶ added in v0.6.0
func (b *BranchStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BranchStatus.
type CapabilitiesClient ¶
type CapabilitiesClient struct {
// contains filtered or unexported fields
}
CapabilitiesClient contains the methods for the Capabilities group. Don't use this type directly, use NewCapabilitiesClient() instead.
func NewCapabilitiesClient ¶
func NewCapabilitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapabilitiesClient, error)
NewCapabilitiesClient creates a new instance of CapabilitiesClient with the specified values.
- subscriptionID - GUID that represents an Azure subscription ID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*CapabilitiesClient) CreateOrUpdate ¶
func (client *CapabilitiesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, parentProviderNamespace string, parentResourceType string, parentResourceName string, targetName string, capabilityName string, capability Capability, options *CapabilitiesClientCreateOrUpdateOptions) (CapabilitiesClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update a Capability resource that extends a Target resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- parentProviderNamespace - String that represents a resource provider namespace.
- parentResourceType - String that represents a resource type.
- parentResourceName - String that represents a resource name.
- targetName - String that represents a Target resource name.
- capabilityName - String that represents a Capability resource name.
- capability - Capability resource to be created or updated.
- options - CapabilitiesClientCreateOrUpdateOptions contains the optional parameters for the CapabilitiesClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/CreateOrUpdateACapability.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCapabilitiesClient().CreateOrUpdate(ctx, "exampleRG", "Microsoft.Compute", "virtualMachines", "exampleVM", "Microsoft-VirtualMachine", "Shutdown-1.0", armchaos.Capability{ Properties: &armchaos.CapabilityProperties{}, }, 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.Capability = armchaos.Capability{ // Name: to.Ptr("Shutdown-1.0"), // Type: to.Ptr("Microsoft.Chaos/targets/capabilities"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0"), // Properties: &armchaos.CapabilityProperties{ // Description: to.Ptr("Shutdown an Azure Virtual Machine for a defined period of time."), // ParametersSchema: to.Ptr("https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json"), // Publisher: to.Ptr("Microsoft"), // TargetType: to.Ptr("VirtualMachine"), // Urn: to.Ptr("urn:csci:microsoft:virtualMachine:shutdown/1.0"), // }, // SystemData: &armchaos.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-14T05:08:38.4662189Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-14T05:08:38.4662189Z"); return t}()), // }, // } }
Output:
func (*CapabilitiesClient) Delete ¶
func (client *CapabilitiesClient) Delete(ctx context.Context, resourceGroupName string, parentProviderNamespace string, parentResourceType string, parentResourceName string, targetName string, capabilityName string, options *CapabilitiesClientDeleteOptions) (CapabilitiesClientDeleteResponse, error)
Delete - Delete a Capability that extends a Target resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- parentProviderNamespace - String that represents a resource provider namespace.
- parentResourceType - String that represents a resource type.
- parentResourceName - String that represents a resource name.
- targetName - String that represents a Target resource name.
- capabilityName - String that represents a Capability resource name.
- options - CapabilitiesClientDeleteOptions contains the optional parameters for the CapabilitiesClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/DeleteACapability.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewCapabilitiesClient().Delete(ctx, "exampleRG", "Microsoft.Compute", "virtualMachines", "exampleVM", "Microsoft-VirtualMachine", "Shutdown-1.0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*CapabilitiesClient) Get ¶
func (client *CapabilitiesClient) Get(ctx context.Context, resourceGroupName string, parentProviderNamespace string, parentResourceType string, parentResourceName string, targetName string, capabilityName string, options *CapabilitiesClientGetOptions) (CapabilitiesClientGetResponse, error)
Get - Get a Capability resource that extends a Target resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- parentProviderNamespace - String that represents a resource provider namespace.
- parentResourceType - String that represents a resource type.
- parentResourceName - String that represents a resource name.
- targetName - String that represents a Target resource name.
- capabilityName - String that represents a Capability resource name.
- options - CapabilitiesClientGetOptions contains the optional parameters for the CapabilitiesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/GetACapability.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCapabilitiesClient().Get(ctx, "exampleRG", "Microsoft.Compute", "virtualMachines", "exampleVM", "Microsoft-VirtualMachine", "Shutdown-1.0", 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.Capability = armchaos.Capability{ // Name: to.Ptr("Shutdown-1.0"), // Type: to.Ptr("Microsoft.Chaos/targets/capabilities"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0"), // Properties: &armchaos.CapabilityProperties{ // Description: to.Ptr("Shutdown an Azure Virtual Machine for a defined period of time."), // ParametersSchema: to.Ptr("https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json"), // Publisher: to.Ptr("Microsoft"), // TargetType: to.Ptr("VirtualMachine"), // Urn: to.Ptr("urn:csci:microsoft:virtualMachine:shutdown/1.0"), // }, // SystemData: &armchaos.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-14T05:08:38.4662189Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-14T05:08:38.4662189Z"); return t}()), // }, // } }
Output:
func (*CapabilitiesClient) NewListPager ¶ added in v0.4.0
func (client *CapabilitiesClient) NewListPager(resourceGroupName string, parentProviderNamespace string, parentResourceType string, parentResourceName string, targetName string, options *CapabilitiesClientListOptions) *runtime.Pager[CapabilitiesClientListResponse]
NewListPager - Get a list of Capability resources that extend a Target resource..
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- parentProviderNamespace - String that represents a resource provider namespace.
- parentResourceType - String that represents a resource type.
- parentResourceName - String that represents a resource name.
- targetName - String that represents a Target resource name.
- options - CapabilitiesClientListOptions contains the optional parameters for the CapabilitiesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/ListCapabilities.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCapabilitiesClient().NewListPager("exampleRG", "Microsoft.Compute", "virtualMachines", "exampleVM", "Microsoft-VirtualMachine", &armchaos.CapabilitiesClientListOptions{ContinuationToken: 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.CapabilityListResult = armchaos.CapabilityListResult{ // Value: []*armchaos.Capability{ // { // Name: to.Ptr("Shutdown-1.0"), // Type: to.Ptr("Microsoft.Chaos/targets/capabilities"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0"), // Properties: &armchaos.CapabilityProperties{ // Description: to.Ptr("Shutdown an Azure Virtual Machine for a defined period of time."), // ParametersSchema: to.Ptr("https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json"), // Publisher: to.Ptr("Microsoft"), // TargetType: to.Ptr("VirtualMachine"), // Urn: to.Ptr("urn:csci:microsoft:virtualMachine:shutdown/1.0"), // }, // SystemData: &armchaos.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-14T05:08:38.4662189Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-14T05:08:38.4662189Z"); return t}()), // }, // }}, // } } }
Output:
type CapabilitiesClientCreateOrUpdateOptions ¶ added in v0.2.0
type CapabilitiesClientCreateOrUpdateOptions struct { }
CapabilitiesClientCreateOrUpdateOptions contains the optional parameters for the CapabilitiesClient.CreateOrUpdate method.
type CapabilitiesClientCreateOrUpdateResponse ¶ added in v0.2.0
type CapabilitiesClientCreateOrUpdateResponse struct {
Capability
}
CapabilitiesClientCreateOrUpdateResponse contains the response from method CapabilitiesClient.CreateOrUpdate.
type CapabilitiesClientDeleteOptions ¶ added in v0.2.0
type CapabilitiesClientDeleteOptions struct { }
CapabilitiesClientDeleteOptions contains the optional parameters for the CapabilitiesClient.Delete method.
type CapabilitiesClientDeleteResponse ¶ added in v0.2.0
type CapabilitiesClientDeleteResponse struct { }
CapabilitiesClientDeleteResponse contains the response from method CapabilitiesClient.Delete.
type CapabilitiesClientGetOptions ¶ added in v0.2.0
type CapabilitiesClientGetOptions struct { }
CapabilitiesClientGetOptions contains the optional parameters for the CapabilitiesClient.Get method.
type CapabilitiesClientGetResponse ¶ added in v0.2.0
type CapabilitiesClientGetResponse struct {
Capability
}
CapabilitiesClientGetResponse contains the response from method CapabilitiesClient.Get.
type CapabilitiesClientListOptions ¶ added in v0.2.0
type CapabilitiesClientListOptions struct { // String that sets the continuation token. ContinuationToken *string }
CapabilitiesClientListOptions contains the optional parameters for the CapabilitiesClient.NewListPager method.
type CapabilitiesClientListResponse ¶ added in v0.2.0
type CapabilitiesClientListResponse struct {
CapabilityListResult
}
CapabilitiesClientListResponse contains the response from method CapabilitiesClient.NewListPager.
type Capability ¶
type Capability struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The properties of a capability resource. Properties *CapabilityProperties `json:"properties,omitempty" azure:"ro"` // READ-ONLY; The standard system metadata of a resource type. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
Capability - Model that represents a Capability resource.
func (Capability) MarshalJSON ¶
func (c Capability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Capability.
func (*Capability) UnmarshalJSON ¶ added in v0.6.0
func (c *Capability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Capability.
type CapabilityListResult ¶
type CapabilityListResult struct { // READ-ONLY; URL to retrieve the next page of Capability resources. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; List of Capability resources. Value []*Capability `json:"value,omitempty" azure:"ro"` }
CapabilityListResult - Model that represents a list of Capability resources and a link for pagination.
func (CapabilityListResult) MarshalJSON ¶
func (c CapabilityListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapabilityListResult.
func (*CapabilityListResult) UnmarshalJSON ¶ added in v0.6.0
func (c *CapabilityListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapabilityListResult.
type CapabilityProperties ¶
type CapabilityProperties struct { // READ-ONLY; Localized string of the description. Description *string `json:"description,omitempty" azure:"ro"` // READ-ONLY; URL to retrieve JSON schema of the Capability parameters. ParametersSchema *string `json:"parametersSchema,omitempty" azure:"ro"` // READ-ONLY; String of the Publisher that this Capability extends. Publisher *string `json:"publisher,omitempty" azure:"ro"` // READ-ONLY; String of the Target Type that this Capability extends. TargetType *string `json:"targetType,omitempty" azure:"ro"` // READ-ONLY; String of the URN for this Capability Type. Urn *string `json:"urn,omitempty" azure:"ro"` }
CapabilityProperties - Model that represents the Capability properties model.
func (CapabilityProperties) MarshalJSON ¶ added in v0.6.0
func (c CapabilityProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapabilityProperties.
func (*CapabilityProperties) UnmarshalJSON ¶ added in v0.6.0
func (c *CapabilityProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapabilityProperties.
type CapabilityType ¶
type CapabilityType struct { // Location of the Capability Type resource. Location *string `json:"location,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The properties of the capability type resource. Properties *CapabilityTypeProperties `json:"properties,omitempty" azure:"ro"` // READ-ONLY; The system metadata properties of the capability type resource. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
CapabilityType - Model that represents a Capability Type resource.
func (CapabilityType) MarshalJSON ¶
func (c CapabilityType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapabilityType.
func (*CapabilityType) UnmarshalJSON ¶ added in v0.6.0
func (c *CapabilityType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapabilityType.
type CapabilityTypeListResult ¶
type CapabilityTypeListResult struct { // READ-ONLY; URL to retrieve the next page of Capability Type resources. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; List of Capability Type resources. Value []*CapabilityType `json:"value,omitempty" azure:"ro"` }
CapabilityTypeListResult - Model that represents a list of Capability Type resources and a link for pagination.
func (CapabilityTypeListResult) MarshalJSON ¶
func (c CapabilityTypeListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapabilityTypeListResult.
func (*CapabilityTypeListResult) UnmarshalJSON ¶ added in v0.6.0
func (c *CapabilityTypeListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapabilityTypeListResult.
type CapabilityTypeProperties ¶
type CapabilityTypeProperties struct { // READ-ONLY; Localized string of the description. Description *string `json:"description,omitempty" azure:"ro"` // READ-ONLY; Localized string of the display name. DisplayName *string `json:"displayName,omitempty" azure:"ro"` // READ-ONLY; URL to retrieve JSON schema of the Capability Type parameters. ParametersSchema *string `json:"parametersSchema,omitempty" azure:"ro"` // READ-ONLY; String of the Publisher that this Capability Type extends. Publisher *string `json:"publisher,omitempty" azure:"ro"` // READ-ONLY; String of the Target Type that this Capability Type extends. TargetType *string `json:"targetType,omitempty" azure:"ro"` // READ-ONLY; String of the URN for this Capability Type. Urn *string `json:"urn,omitempty" azure:"ro"` }
CapabilityTypeProperties - Model that represents the Capability Type properties model.
func (CapabilityTypeProperties) MarshalJSON ¶ added in v0.6.0
func (c CapabilityTypeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapabilityTypeProperties.
func (*CapabilityTypeProperties) UnmarshalJSON ¶ added in v0.6.0
func (c *CapabilityTypeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapabilityTypeProperties.
type CapabilityTypesClient ¶
type CapabilityTypesClient struct {
// contains filtered or unexported fields
}
CapabilityTypesClient contains the methods for the CapabilityTypes group. Don't use this type directly, use NewCapabilityTypesClient() instead.
func NewCapabilityTypesClient ¶
func NewCapabilityTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapabilityTypesClient, error)
NewCapabilityTypesClient creates a new instance of CapabilityTypesClient with the specified values.
- subscriptionID - GUID that represents an Azure subscription ID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*CapabilityTypesClient) Get ¶
func (client *CapabilityTypesClient) Get(ctx context.Context, locationName string, targetTypeName string, capabilityTypeName string, options *CapabilityTypesClientGetOptions) (CapabilityTypesClientGetResponse, error)
Get - Get a Capability Type resource for given Target Type and location. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- locationName - String that represents a Location resource name.
- targetTypeName - String that represents a Target Type resource name.
- capabilityTypeName - String that represents a Capability Type resource name.
- options - CapabilityTypesClientGetOptions contains the optional parameters for the CapabilityTypesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/GetACapabilityType.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCapabilityTypesClient().Get(ctx, "westus2", "Microsoft-VirtualMachine", "Shutdown-1.0", 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.CapabilityType = armchaos.CapabilityType{ // Name: to.Ptr("Shutdown-1.0"), // Type: to.Ptr("Microsoft.Chaos/locations/targetTypes/capabilityTypes"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0"), // Properties: &armchaos.CapabilityTypeProperties{ // Description: to.Ptr("Shutdown an Azure Virtual Machine for a defined period of time."), // DisplayName: to.Ptr("Shutdown VM"), // ParametersSchema: to.Ptr("https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json"), // Publisher: to.Ptr("Microsoft"), // TargetType: to.Ptr("VirtualMachine"), // Urn: to.Ptr("urn:csci:microsoft:virtualMachine:shutdown/1.0"), // }, // } }
Output:
func (*CapabilityTypesClient) NewListPager ¶ added in v0.4.0
func (client *CapabilityTypesClient) NewListPager(locationName string, targetTypeName string, options *CapabilityTypesClientListOptions) *runtime.Pager[CapabilityTypesClientListResponse]
NewListPager - Get a list of Capability Type resources for given Target Type and location.
Generated from API version 2021-09-15-preview
- locationName - String that represents a Location resource name.
- targetTypeName - String that represents a Target Type resource name.
- options - CapabilityTypesClientListOptions contains the optional parameters for the CapabilityTypesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/ListCapabilityTypes.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCapabilityTypesClient().NewListPager("westus2", "Microsoft-VirtualMachine", &armchaos.CapabilityTypesClientListOptions{ContinuationToken: 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.CapabilityTypeListResult = armchaos.CapabilityTypeListResult{ // Value: []*armchaos.CapabilityType{ // { // Name: to.Ptr("Shutdown-1.0"), // Type: to.Ptr("Microsoft.Chaos/locations/targetTypes/capabilityTypes"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0"), // Properties: &armchaos.CapabilityTypeProperties{ // Description: to.Ptr("Shutdown an Azure Virtual Machine for a defined period of time."), // DisplayName: to.Ptr("Shutdown VM"), // ParametersSchema: to.Ptr("https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json"), // Publisher: to.Ptr("Microsoft"), // TargetType: to.Ptr("VirtualMachine"), // Urn: to.Ptr("urn:csci:microsoft:virtualMachine:shutdown/1.0"), // }, // }}, // } } }
Output:
type CapabilityTypesClientGetOptions ¶ added in v0.2.0
type CapabilityTypesClientGetOptions struct { }
CapabilityTypesClientGetOptions contains the optional parameters for the CapabilityTypesClient.Get method.
type CapabilityTypesClientGetResponse ¶ added in v0.2.0
type CapabilityTypesClientGetResponse struct {
CapabilityType
}
CapabilityTypesClientGetResponse contains the response from method CapabilityTypesClient.Get.
type CapabilityTypesClientListOptions ¶ added in v0.2.0
type CapabilityTypesClientListOptions struct { // String that sets the continuation token. ContinuationToken *string }
CapabilityTypesClientListOptions contains the optional parameters for the CapabilityTypesClient.NewListPager method.
type CapabilityTypesClientListResponse ¶ added in v0.2.0
type CapabilityTypesClientListResponse struct {
CapabilityTypeListResult
}
CapabilityTypesClientListResponse contains the response from method CapabilityTypesClient.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 - GUID that represents an Azure subscription ID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewCapabilitiesClient ¶ added in v0.6.0
func (c *ClientFactory) NewCapabilitiesClient() *CapabilitiesClient
func (*ClientFactory) NewCapabilityTypesClient ¶ added in v0.6.0
func (c *ClientFactory) NewCapabilityTypesClient() *CapabilityTypesClient
func (*ClientFactory) NewExperimentsClient ¶ added in v0.6.0
func (c *ClientFactory) NewExperimentsClient() *ExperimentsClient
func (*ClientFactory) NewOperationsClient ¶ added in v0.6.0
func (c *ClientFactory) NewOperationsClient() *OperationsClient
func (*ClientFactory) NewTargetTypesClient ¶ added in v0.6.0
func (c *ClientFactory) NewTargetTypesClient() *TargetTypesClient
func (*ClientFactory) NewTargetsClient ¶ added in v0.6.0
func (c *ClientFactory) NewTargetsClient() *TargetsClient
type ContinuousAction ¶ added in v0.2.0
type ContinuousAction struct { // REQUIRED; ISO8601 formatted string that represents a duration. Duration *string `json:"duration,omitempty"` // REQUIRED; String that represents a Capability URN. Name *string `json:"name,omitempty"` // REQUIRED; List of key value pairs. Parameters []*KeyValuePair `json:"parameters,omitempty"` // REQUIRED; String that represents a selector. SelectorID *string `json:"selectorId,omitempty"` // REQUIRED; Enum that discriminates between action models. Type *string `json:"type,omitempty"` }
ContinuousAction - Model that represents a continuous action.
func (*ContinuousAction) GetAction ¶ added in v0.2.0
func (c *ContinuousAction) GetAction() *Action
GetAction implements the ActionClassification interface for type ContinuousAction.
func (ContinuousAction) MarshalJSON ¶ added in v0.2.0
func (c ContinuousAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContinuousAction.
func (*ContinuousAction) UnmarshalJSON ¶ added in v0.2.0
func (c *ContinuousAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousAction.
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 DelayAction ¶ added in v0.2.0
type DelayAction struct { // REQUIRED; ISO8601 formatted string that represents a duration. Duration *string `json:"duration,omitempty"` // REQUIRED; String that represents a Capability URN. Name *string `json:"name,omitempty"` // REQUIRED; Enum that discriminates between action models. Type *string `json:"type,omitempty"` }
DelayAction - Model that represents a delay action.
func (*DelayAction) GetAction ¶ added in v0.2.0
func (d *DelayAction) GetAction() *Action
GetAction implements the ActionClassification interface for type DelayAction.
func (DelayAction) MarshalJSON ¶ added in v0.2.0
func (d DelayAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DelayAction.
func (*DelayAction) UnmarshalJSON ¶ added in v0.2.0
func (d *DelayAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DelayAction.
type DiscreteAction ¶ added in v0.2.0
type DiscreteAction struct { // REQUIRED; String that represents a Capability URN. Name *string `json:"name,omitempty"` // REQUIRED; List of key value pairs. Parameters []*KeyValuePair `json:"parameters,omitempty"` // REQUIRED; String that represents a selector. SelectorID *string `json:"selectorId,omitempty"` // REQUIRED; Enum that discriminates between action models. Type *string `json:"type,omitempty"` }
DiscreteAction - Model that represents a discrete action.
func (*DiscreteAction) GetAction ¶ added in v0.2.0
func (d *DiscreteAction) GetAction() *Action
GetAction implements the ActionClassification interface for type DiscreteAction.
func (DiscreteAction) MarshalJSON ¶ added in v0.2.0
func (d DiscreteAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiscreteAction.
func (*DiscreteAction) UnmarshalJSON ¶ added in v0.2.0
func (d *DiscreteAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiscreteAction.
type ErrorAdditionalInfo ¶
type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. Info any `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` }
ErrorAdditionalInfo - The resource management error additional info.
func (ErrorAdditionalInfo) MarshalJSON ¶ added in v0.6.0
func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.
func (*ErrorAdditionalInfo) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.
type ErrorDetail ¶
type ErrorDetail struct { // READ-ONLY; The error additional info. AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` // READ-ONLY; The error code. Code *string `json:"code,omitempty" azure:"ro"` // READ-ONLY; The error details. Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` // READ-ONLY; The error message. Message *string `json:"message,omitempty" azure:"ro"` // READ-ONLY; The error target. Target *string `json:"target,omitempty" azure:"ro"` }
ErrorDetail - The error detail.
func (ErrorDetail) MarshalJSON ¶
func (e ErrorDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorDetail.
func (*ErrorDetail) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.
type ErrorResponse ¶
type ErrorResponse struct { // The error object. Error *ErrorDetail `json:"error,omitempty"` }
ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
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 Experiment ¶
type Experiment struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` // REQUIRED; The properties of the experiment resource. Properties *ExperimentProperties `json:"properties,omitempty"` // The identity of the experiment resource. Identity *ResourceIdentity `json:"identity,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The system metadata of the experiment resource. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
Experiment - Model that represents a Experiment resource.
func (Experiment) MarshalJSON ¶
func (e Experiment) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Experiment.
func (*Experiment) UnmarshalJSON ¶ added in v0.6.0
func (e *Experiment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Experiment.
type ExperimentCancelOperationResult ¶
type ExperimentCancelOperationResult struct { // READ-ONLY; String of the Experiment name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; URL to retrieve the Experiment status. StatusURL *string `json:"statusUrl,omitempty" azure:"ro"` }
ExperimentCancelOperationResult - Model that represents the result of a cancel Experiment operation.
func (ExperimentCancelOperationResult) MarshalJSON ¶ added in v0.6.0
func (e ExperimentCancelOperationResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentCancelOperationResult.
func (*ExperimentCancelOperationResult) UnmarshalJSON ¶ added in v0.6.0
func (e *ExperimentCancelOperationResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentCancelOperationResult.
type ExperimentExecutionActionTargetDetailsError ¶
type ExperimentExecutionActionTargetDetailsError struct { // READ-ONLY; The error code. Code *string `json:"code,omitempty" azure:"ro"` // READ-ONLY; The error message Message *string `json:"message,omitempty" azure:"ro"` }
ExperimentExecutionActionTargetDetailsError - Model that represents the Experiment action target details error model.
func (ExperimentExecutionActionTargetDetailsError) MarshalJSON ¶ added in v0.6.0
func (e ExperimentExecutionActionTargetDetailsError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentExecutionActionTargetDetailsError.
func (*ExperimentExecutionActionTargetDetailsError) UnmarshalJSON ¶ added in v0.6.0
func (e *ExperimentExecutionActionTargetDetailsError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentExecutionActionTargetDetailsError.
type ExperimentExecutionActionTargetDetailsProperties ¶
type ExperimentExecutionActionTargetDetailsProperties struct { // READ-ONLY; The error of the action. Error *ExperimentExecutionActionTargetDetailsError `json:"error,omitempty" azure:"ro"` // READ-ONLY; The status of the execution. Status *string `json:"status,omitempty" azure:"ro"` // READ-ONLY; The target for the action. Target *string `json:"target,omitempty" azure:"ro"` // READ-ONLY; String that represents the completed date time. TargetCompletedTime *time.Time `json:"targetCompletedTime,omitempty" azure:"ro"` // READ-ONLY; String that represents the failed date time. TargetFailedTime *time.Time `json:"targetFailedTime,omitempty" azure:"ro"` }
ExperimentExecutionActionTargetDetailsProperties - Model that represents the Experiment action target details properties model.
func (ExperimentExecutionActionTargetDetailsProperties) MarshalJSON ¶
func (e ExperimentExecutionActionTargetDetailsProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentExecutionActionTargetDetailsProperties.
func (*ExperimentExecutionActionTargetDetailsProperties) UnmarshalJSON ¶
func (e *ExperimentExecutionActionTargetDetailsProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentExecutionActionTargetDetailsProperties.
type ExperimentExecutionDetails ¶
type ExperimentExecutionDetails struct { // READ-ONLY; String of the fully qualified resource ID. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; String of the resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The properties of the experiment execution details. Properties *ExperimentExecutionDetailsProperties `json:"properties,omitempty" azure:"ro"` // READ-ONLY; String of the resource type. Type *string `json:"type,omitempty" azure:"ro"` }
ExperimentExecutionDetails - Model that represents the execution details of a Experiment.
func (ExperimentExecutionDetails) MarshalJSON ¶ added in v0.6.0
func (e ExperimentExecutionDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentExecutionDetails.
func (*ExperimentExecutionDetails) UnmarshalJSON ¶ added in v0.6.0
func (e *ExperimentExecutionDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentExecutionDetails.
type ExperimentExecutionDetailsListResult ¶
type ExperimentExecutionDetailsListResult struct { // READ-ONLY; URL to retrieve the next page of Experiment execution details. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; List of Experiment execution details. Value []*ExperimentExecutionDetails `json:"value,omitempty" azure:"ro"` }
ExperimentExecutionDetailsListResult - Model that represents a list of Experiment execution details and a link for pagination.
func (ExperimentExecutionDetailsListResult) MarshalJSON ¶
func (e ExperimentExecutionDetailsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentExecutionDetailsListResult.
func (*ExperimentExecutionDetailsListResult) UnmarshalJSON ¶ added in v0.6.0
func (e *ExperimentExecutionDetailsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentExecutionDetailsListResult.
type ExperimentExecutionDetailsProperties ¶
type ExperimentExecutionDetailsProperties struct { // READ-ONLY; String that represents the created date time. CreatedDateTime *time.Time `json:"createdDateTime,omitempty" azure:"ro"` // READ-ONLY; The id of the experiment. ExperimentID *string `json:"experimentId,omitempty" azure:"ro"` // READ-ONLY; The reason why the execution failed. FailureReason *string `json:"failureReason,omitempty" azure:"ro"` // READ-ONLY; String that represents the last action date time. LastActionDateTime *time.Time `json:"lastActionDateTime,omitempty" azure:"ro"` // READ-ONLY; The information of the experiment run. RunInformation *ExperimentExecutionDetailsPropertiesRunInformation `json:"runInformation,omitempty" azure:"ro"` // READ-ONLY; String that represents the start date time. StartDateTime *time.Time `json:"startDateTime,omitempty" azure:"ro"` // READ-ONLY; The value of the status of the experiment execution. Status *string `json:"status,omitempty" azure:"ro"` // READ-ONLY; String that represents the stop date time. StopDateTime *time.Time `json:"stopDateTime,omitempty" azure:"ro"` }
ExperimentExecutionDetailsProperties - Model that represents the Experiment execution details properties model.
func (ExperimentExecutionDetailsProperties) MarshalJSON ¶
func (e ExperimentExecutionDetailsProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentExecutionDetailsProperties.
func (*ExperimentExecutionDetailsProperties) UnmarshalJSON ¶
func (e *ExperimentExecutionDetailsProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentExecutionDetailsProperties.
type ExperimentExecutionDetailsPropertiesRunInformation ¶
type ExperimentExecutionDetailsPropertiesRunInformation struct { // READ-ONLY; The steps of the experiment run. Steps []*StepStatus `json:"steps,omitempty" azure:"ro"` }
ExperimentExecutionDetailsPropertiesRunInformation - The information of the experiment run.
func (ExperimentExecutionDetailsPropertiesRunInformation) MarshalJSON ¶
func (e ExperimentExecutionDetailsPropertiesRunInformation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentExecutionDetailsPropertiesRunInformation.
func (*ExperimentExecutionDetailsPropertiesRunInformation) UnmarshalJSON ¶ added in v0.6.0
func (e *ExperimentExecutionDetailsPropertiesRunInformation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentExecutionDetailsPropertiesRunInformation.
type ExperimentListResult ¶
type ExperimentListResult struct { // READ-ONLY; URL to retrieve the next page of Experiment resources. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; List of Experiment resources. Value []*Experiment `json:"value,omitempty" azure:"ro"` }
ExperimentListResult - Model that represents a list of Experiment resources and a link for pagination.
func (ExperimentListResult) MarshalJSON ¶
func (e ExperimentListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentListResult.
func (*ExperimentListResult) UnmarshalJSON ¶ added in v0.6.0
func (e *ExperimentListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentListResult.
type ExperimentProperties ¶
type ExperimentProperties struct { // REQUIRED; List of selectors. Selectors []*Selector `json:"selectors,omitempty"` // REQUIRED; List of steps. Steps []*Step `json:"steps,omitempty"` // A boolean value that indicates if experiment should be started on creation or not. StartOnCreation *bool `json:"startOnCreation,omitempty"` }
ExperimentProperties - Model that represents the Experiment properties model.
func (ExperimentProperties) MarshalJSON ¶
func (e ExperimentProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentProperties.
func (*ExperimentProperties) UnmarshalJSON ¶ added in v0.6.0
func (e *ExperimentProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentProperties.
type ExperimentStartOperationResult ¶
type ExperimentStartOperationResult struct { // READ-ONLY; String of the Experiment name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; URL to retrieve the Experiment status. StatusURL *string `json:"statusUrl,omitempty" azure:"ro"` }
ExperimentStartOperationResult - Model that represents the result of a start Experiment operation.
func (ExperimentStartOperationResult) MarshalJSON ¶ added in v0.6.0
func (e ExperimentStartOperationResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentStartOperationResult.
func (*ExperimentStartOperationResult) UnmarshalJSON ¶ added in v0.6.0
func (e *ExperimentStartOperationResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentStartOperationResult.
type ExperimentStatus ¶
type ExperimentStatus struct { // The properties of experiment execution status. Properties *ExperimentStatusProperties `json:"properties,omitempty"` // READ-ONLY; String of the fully qualified resource ID. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; String of the resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; String of the resource type. Type *string `json:"type,omitempty" azure:"ro"` }
ExperimentStatus - Model that represents the status of a Experiment.
func (ExperimentStatus) MarshalJSON ¶ added in v0.6.0
func (e ExperimentStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentStatus.
func (*ExperimentStatus) UnmarshalJSON ¶ added in v0.6.0
func (e *ExperimentStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentStatus.
type ExperimentStatusListResult ¶
type ExperimentStatusListResult struct { // READ-ONLY; URL to retrieve the next page of Experiment statuses. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; List of Experiment statuses. Value []*ExperimentStatus `json:"value,omitempty" azure:"ro"` }
ExperimentStatusListResult - Model that represents a list of Experiment statuses and a link for pagination.
func (ExperimentStatusListResult) MarshalJSON ¶
func (e ExperimentStatusListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentStatusListResult.
func (*ExperimentStatusListResult) UnmarshalJSON ¶ added in v0.6.0
func (e *ExperimentStatusListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentStatusListResult.
type ExperimentStatusProperties ¶
type ExperimentStatusProperties struct { // READ-ONLY; String that represents the created date time of a Experiment. CreatedDateUTC *time.Time `json:"createdDateUtc,omitempty" azure:"ro"` // READ-ONLY; String that represents the end date time of a Experiment. EndDateUTC *time.Time `json:"endDateUtc,omitempty" azure:"ro"` // READ-ONLY; String that represents the status of a Experiment. Status *string `json:"status,omitempty" azure:"ro"` }
ExperimentStatusProperties - Model that represents the Experiment status properties model.
func (ExperimentStatusProperties) MarshalJSON ¶
func (e ExperimentStatusProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExperimentStatusProperties.
func (*ExperimentStatusProperties) UnmarshalJSON ¶
func (e *ExperimentStatusProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExperimentStatusProperties.
type ExperimentsClient ¶
type ExperimentsClient struct {
// contains filtered or unexported fields
}
ExperimentsClient contains the methods for the Experiments group. Don't use this type directly, use NewExperimentsClient() instead.
func NewExperimentsClient ¶
func NewExperimentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExperimentsClient, error)
NewExperimentsClient creates a new instance of ExperimentsClient with the specified values.
- subscriptionID - GUID that represents an Azure subscription ID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ExperimentsClient) BeginCancel ¶
func (client *ExperimentsClient) BeginCancel(ctx context.Context, resourceGroupName string, experimentName string, options *ExperimentsClientBeginCancelOptions) (*runtime.Poller[ExperimentsClientCancelResponse], error)
BeginCancel - Cancel a running Experiment resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- experimentName - String that represents a Experiment resource name.
- options - ExperimentsClientBeginCancelOptions contains the optional parameters for the ExperimentsClient.BeginCancel method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/CancelAExperiment.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewExperimentsClient().BeginCancel(ctx, "exampleRG", "exampleExperiment", 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 (*ExperimentsClient) BeginCreateOrUpdate ¶
func (client *ExperimentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, experimentName string, experiment Experiment, options *ExperimentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExperimentsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update a Experiment resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- experimentName - String that represents a Experiment resource name.
- experiment - Experiment resource to be created or updated.
- options - ExperimentsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExperimentsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/CreateOrUpdateAExperiment.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/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewExperimentsClient().BeginCreateOrUpdate(ctx, "exampleRG", "exampleExperiment", armchaos.Experiment{ Location: to.Ptr("centraluseuap"), Identity: &armchaos.ResourceIdentity{ Type: to.Ptr(armchaos.ResourceIdentityTypeSystemAssigned), }, Properties: &armchaos.ExperimentProperties{ Selectors: []*armchaos.Selector{ { Type: to.Ptr(armchaos.SelectorTypeList), ID: to.Ptr("selector1"), Targets: []*armchaos.TargetReference{ { Type: to.Ptr("ChaosTarget"), ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine"), }}, }}, Steps: []*armchaos.Step{ { Name: to.Ptr("step1"), Branches: []*armchaos.Branch{ { Name: to.Ptr("branch1"), Actions: []armchaos.ActionClassification{ &armchaos.Action{ Name: to.Ptr("urn:csci:provider:providername:Shutdown/1.0"), Type: to.Ptr("Continuous"), }}, }}, }}, }, }, 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.Experiment = armchaos.Experiment{ // Name: to.Ptr("exampleExperiment"), // Type: to.Ptr("Microsoft.Chaos/experiments"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment"), // Location: to.Ptr("centraluseuap"), // Identity: &armchaos.ResourceIdentity{ // Type: to.Ptr(armchaos.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("d04ab567-2c07-43ef-a7f4-4527626b7f56"), // TenantID: to.Ptr("8c3e2fb2-fe7a-4bf1-b779-d73990782fe6"), // }, // Properties: &armchaos.ExperimentProperties{ // Selectors: []*armchaos.Selector{ // { // Type: to.Ptr(armchaos.SelectorTypeList), // ID: to.Ptr("selector1"), // Targets: []*armchaos.TargetReference{ // { // Type: to.Ptr("ChaosTarget"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine"), // }}, // }}, // Steps: []*armchaos.Step{ // { // Name: to.Ptr("step1"), // Branches: []*armchaos.Branch{ // { // Name: to.Ptr("branch1"), // Actions: []armchaos.ActionClassification{ // &armchaos.Action{ // Name: to.Ptr("urn:csci:provider:providername:Shutdown/1.0"), // Type: to.Ptr("Continuous"), // }}, // }}, // }}, // }, // SystemData: &armchaos.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // CreatedBy: to.Ptr("User"), // CreatedByType: to.Ptr(armchaos.CreatedByType("b3a41dba-4415-4d36-9ee8-e5eaa86db976")), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // LastModifiedBy: to.Ptr("User"), // LastModifiedByType: to.Ptr(armchaos.CreatedByType("b3a41dba-4415-4d36-9ee8-e5eaa86db976")), // }, // } }
Output:
func (*ExperimentsClient) Delete ¶
func (client *ExperimentsClient) Delete(ctx context.Context, resourceGroupName string, experimentName string, options *ExperimentsClientDeleteOptions) (ExperimentsClientDeleteResponse, error)
Delete - Delete a Experiment resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- experimentName - String that represents a Experiment resource name.
- options - ExperimentsClientDeleteOptions contains the optional parameters for the ExperimentsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/DeleteAExperiment.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewExperimentsClient().Delete(ctx, "exampleRG", "exampleExperiment", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*ExperimentsClient) Get ¶
func (client *ExperimentsClient) Get(ctx context.Context, resourceGroupName string, experimentName string, options *ExperimentsClientGetOptions) (ExperimentsClientGetResponse, error)
Get - Get a Experiment resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- experimentName - String that represents a Experiment resource name.
- options - ExperimentsClientGetOptions contains the optional parameters for the ExperimentsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/GetAExperiment.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewExperimentsClient().Get(ctx, "exampleRG", "exampleExperiment", 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.Experiment = armchaos.Experiment{ // Name: to.Ptr("exampleExperiment"), // Type: to.Ptr("Microsoft.Chaos/experiments"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment"), // Location: to.Ptr("centraluseuap"), // Identity: &armchaos.ResourceIdentity{ // Type: to.Ptr(armchaos.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("d04ab567-2c07-43ef-a7f4-4527626b7f56"), // TenantID: to.Ptr("8c3e2fb2-fe7a-4bf1-b779-d73990782fe6"), // }, // Properties: &armchaos.ExperimentProperties{ // Selectors: []*armchaos.Selector{ // { // Type: to.Ptr(armchaos.SelectorTypeList), // ID: to.Ptr("selector1"), // Targets: []*armchaos.TargetReference{ // { // Type: to.Ptr("ChaosTarget"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine"), // }}, // }}, // Steps: []*armchaos.Step{ // { // Name: to.Ptr("step1"), // Branches: []*armchaos.Branch{ // { // Name: to.Ptr("branch1"), // Actions: []armchaos.ActionClassification{ // &armchaos.Action{ // Name: to.Ptr("urn:csci:provider:providername:Shutdown/1.0"), // Type: to.Ptr("Continuous"), // }}, // }}, // }}, // }, // SystemData: &armchaos.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // CreatedBy: to.Ptr("User"), // CreatedByType: to.Ptr(armchaos.CreatedByType("b3a41dba-4415-4d36-9ee8-e5eaa86db976")), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // LastModifiedBy: to.Ptr("User"), // LastModifiedByType: to.Ptr(armchaos.CreatedByType("b3a41dba-4415-4d36-9ee8-e5eaa86db976")), // }, // } }
Output:
func (*ExperimentsClient) GetExecutionDetails ¶
func (client *ExperimentsClient) GetExecutionDetails(ctx context.Context, resourceGroupName string, experimentName string, executionDetailsID string, options *ExperimentsClientGetExecutionDetailsOptions) (ExperimentsClientGetExecutionDetailsResponse, error)
GetExecutionDetails - Get an execution detail of a Experiment resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- experimentName - String that represents a Experiment resource name.
- executionDetailsID - GUID that represents a Experiment execution detail.
- options - ExperimentsClientGetExecutionDetailsOptions contains the optional parameters for the ExperimentsClient.GetExecutionDetails method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/GetAExperimentExecutionDetails.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewExperimentsClient().GetExecutionDetails(ctx, "exampleRG", "exampleExperiment", "f24500ad-744e-4a26-864b-b76199eac333", 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.ExperimentExecutionDetails = armchaos.ExperimentExecutionDetails{ // Name: to.Ptr("f24500ad-744e-4a26-864b-b76199eac333"), // Type: to.Ptr("Microsoft.Chaos/experiments/executionDetails"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executionDetails/f24500ad-744e-4a26-864b-b76199eac333"), // } }
Output:
func (*ExperimentsClient) GetStatus ¶
func (client *ExperimentsClient) GetStatus(ctx context.Context, resourceGroupName string, experimentName string, statusID string, options *ExperimentsClientGetStatusOptions) (ExperimentsClientGetStatusResponse, error)
GetStatus - Get a status of a Experiment resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- experimentName - String that represents a Experiment resource name.
- statusID - GUID that represents a Experiment status.
- options - ExperimentsClientGetStatusOptions contains the optional parameters for the ExperimentsClient.GetStatus method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/GetAExperimentStatus.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewExperimentsClient().GetStatus(ctx, "exampleRG", "exampleExperiment", "50734542-2e64-4e08-814c-cc0e7475f7e4", 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.ExperimentStatus = armchaos.ExperimentStatus{ // Name: to.Ptr("50734542-2e64-4e08-814c-cc0e7475f7e4"), // Type: to.Ptr("Microsoft.Chaos/experiments/statuses"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/statuses/50734542-2e64-4e08-814c-cc0e7475f7e4"), // Properties: &armchaos.ExperimentStatusProperties{ // CreatedDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // EndDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T01:00:00.0Z"); return t}()), // Status: to.Ptr("Successful"), // }, // } }
Output:
func (*ExperimentsClient) NewListAllPager ¶ added in v0.4.0
func (client *ExperimentsClient) NewListAllPager(options *ExperimentsClientListAllOptions) *runtime.Pager[ExperimentsClientListAllResponse]
NewListAllPager - Get a list of Experiment resources in a subscription.
Generated from API version 2021-09-15-preview
- options - ExperimentsClientListAllOptions contains the optional parameters for the ExperimentsClient.NewListAllPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/ListExperimentsInASubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewExperimentsClient().NewListAllPager(&armchaos.ExperimentsClientListAllOptions{Running: nil, ContinuationToken: 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.ExperimentListResult = armchaos.ExperimentListResult{ // Value: []*armchaos.Experiment{ // { // Name: to.Ptr("exampleExperiment"), // Type: to.Ptr("Microsoft.Chaos/experiments"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment"), // Location: to.Ptr("centraluseuap"), // Identity: &armchaos.ResourceIdentity{ // Type: to.Ptr(armchaos.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("d04ab567-2c07-43ef-a7f4-4527626b7f56"), // TenantID: to.Ptr("8c3e2fb2-fe7a-4bf1-b779-d73990782fe6"), // }, // Properties: &armchaos.ExperimentProperties{ // Selectors: []*armchaos.Selector{ // { // Type: to.Ptr(armchaos.SelectorTypeList), // ID: to.Ptr("selector1"), // Targets: []*armchaos.TargetReference{ // { // Type: to.Ptr("ChaosTarget"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine"), // }}, // }}, // Steps: []*armchaos.Step{ // { // Name: to.Ptr("step1"), // Branches: []*armchaos.Branch{ // { // Name: to.Ptr("branch1"), // Actions: []armchaos.ActionClassification{ // &armchaos.Action{ // Name: to.Ptr("urn:csci:provider:providername:Shutdown/1.0"), // Type: to.Ptr("Continuous"), // }}, // }}, // }}, // }, // SystemData: &armchaos.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // CreatedBy: to.Ptr("User"), // CreatedByType: to.Ptr(armchaos.CreatedByType("b3a41dba-4415-4d36-9ee8-e5eaa86db976")), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // LastModifiedBy: to.Ptr("User"), // LastModifiedByType: to.Ptr(armchaos.CreatedByType("b3a41dba-4415-4d36-9ee8-e5eaa86db976")), // }, // }}, // } } }
Output:
func (*ExperimentsClient) NewListAllStatusesPager ¶ added in v0.4.0
func (client *ExperimentsClient) NewListAllStatusesPager(resourceGroupName string, experimentName string, options *ExperimentsClientListAllStatusesOptions) *runtime.Pager[ExperimentsClientListAllStatusesResponse]
NewListAllStatusesPager - Get a list of statuses of a Experiment resource.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- experimentName - String that represents a Experiment resource name.
- options - ExperimentsClientListAllStatusesOptions contains the optional parameters for the ExperimentsClient.NewListAllStatusesPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/ListExperimentStatuses.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewExperimentsClient().NewListAllStatusesPager("exampleRG", "exampleExperiment", 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.ExperimentStatusListResult = armchaos.ExperimentStatusListResult{ // Value: []*armchaos.ExperimentStatus{ // { // Name: to.Ptr("50734542-2e64-4e08-814c-cc0e7475f7e4"), // Type: to.Ptr("Microsoft.Chaos/experiments/statuses"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/statuses/50734542-2e64-4e08-814c-cc0e7475f7e4"), // Properties: &armchaos.ExperimentStatusProperties{ // CreatedDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // EndDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T01:00:00.0Z"); return t}()), // Status: to.Ptr("Successful"), // }, // }}, // } } }
Output:
func (*ExperimentsClient) NewListExecutionDetailsPager ¶ added in v0.4.0
func (client *ExperimentsClient) NewListExecutionDetailsPager(resourceGroupName string, experimentName string, options *ExperimentsClientListExecutionDetailsOptions) *runtime.Pager[ExperimentsClientListExecutionDetailsResponse]
NewListExecutionDetailsPager - Get a list of execution details of a Experiment resource.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- experimentName - String that represents a Experiment resource name.
- options - ExperimentsClientListExecutionDetailsOptions contains the optional parameters for the ExperimentsClient.NewListExecutionDetailsPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/ListExperimentExecutionsDetails.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewExperimentsClient().NewListExecutionDetailsPager("exampleRG", "exampleExperiment", 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.ExperimentExecutionDetailsListResult = armchaos.ExperimentExecutionDetailsListResult{ // Value: []*armchaos.ExperimentExecutionDetails{ // { // Name: to.Ptr("f24500ad-744e-4a26-864b-b76199eac333"), // Type: to.Ptr("Microsoft.Chaos/experiments/executionDetails"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executionDetails/f24500ad-744e-4a26-864b-b76199eac333"), // Properties: &armchaos.ExperimentExecutionDetailsProperties{ // CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T21:52:42.917983Z"); return t}()), // ExperimentID: to.Ptr("f24500ad-744e-4a26-864b-b76199eac333"), // FailureReason: to.Ptr("Dependency failure"), // LastActionDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T21:52:52.2552574Z"); return t}()), // RunInformation: &armchaos.ExperimentExecutionDetailsPropertiesRunInformation{ // Steps: []*armchaos.StepStatus{ // { // Branches: []*armchaos.BranchStatus{ // { // Actions: []*armchaos.ActionStatus{ // { // ActionID: to.Ptr("59499d33-6751-4b6e-a1f6-58f4d56a040a"), // ActionName: to.Ptr("urn:provider:agent-v2:Microsoft.Azure.Chaos.Fault.CPUPressureAllProcessors"), // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T13:56:13.6270153-08:00"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T13:56:13.6270153-08:00"); return t}()), // Status: to.Ptr("failed"), // Targets: []*armchaos.ExperimentExecutionActionTargetDetailsProperties{ // { // Status: to.Ptr("succeeded"), // Target: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/VM1"), // TargetCompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T17:30:55+00:00"); return t}()), // TargetFailedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T16:30:55+00:00"); return t}()), // }}, // }}, // BranchID: to.Ptr("FirstBranch"), // BranchName: to.Ptr("FirstBranch"), // Status: to.Ptr("failed"), // }}, // Status: to.Ptr("failed"), // StepID: to.Ptr("FirstStep"), // StepName: to.Ptr("FirstStep"), // }}, // }, // StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T21:52:52.2552574Z"); return t}()), // Status: to.Ptr("failed"), // StopDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T21:56:18.9281956Z"); return t}()), // }, // }, // { // Name: to.Ptr("14d98367-52ef-4596-be4f-53fc81bbfc33"), // Type: to.Ptr("Microsoft.Chaos/experiments/executionDetails"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executionDetails/14d98367-52ef-4596-be4f-53fc81bbfc33"), // Properties: &armchaos.ExperimentExecutionDetailsProperties{ // CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T21:52:42.917983Z"); return t}()), // ExperimentID: to.Ptr("14d98367-52ef-4596-be4f-53fc81bbfc33"), // FailureReason: to.Ptr(""), // LastActionDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T21:52:52.2552574Z"); return t}()), // RunInformation: &armchaos.ExperimentExecutionDetailsPropertiesRunInformation{ // Steps: []*armchaos.StepStatus{ // { // Branches: []*armchaos.BranchStatus{ // { // Actions: []*armchaos.ActionStatus{ // { // ActionID: to.Ptr("59499d33-6751-4b6e-a1f6-58f4d56a040a"), // ActionName: to.Ptr("urn:provider:agent-v2:Microsoft.Azure.Chaos.Fault.CPUPressureAllProcessors"), // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T13:56:13.6270153-08:00"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T13:56:13.6270153-08:00"); return t}()), // Status: to.Ptr("success"), // Targets: []*armchaos.ExperimentExecutionActionTargetDetailsProperties{ // { // Status: to.Ptr("succeeded"), // Target: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/VM1"), // TargetCompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T17:30:55+00:00"); return t}()), // TargetFailedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T16:30:55+00:00"); return t}()), // }}, // }}, // BranchID: to.Ptr("FirstBranch"), // BranchName: to.Ptr("FirstBranch"), // Status: to.Ptr("success"), // }}, // Status: to.Ptr("success"), // StepID: to.Ptr("FirstStep"), // StepName: to.Ptr("FirstStep"), // }}, // }, // StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T21:52:52.2552574Z"); return t}()), // Status: to.Ptr("success"), // StopDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T21:56:18.9281956Z"); return t}()), // }, // }}, // } } }
Output:
func (*ExperimentsClient) NewListPager ¶ added in v0.4.0
func (client *ExperimentsClient) NewListPager(resourceGroupName string, options *ExperimentsClientListOptions) *runtime.Pager[ExperimentsClientListResponse]
NewListPager - Get a list of Experiment resources in a resource group.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- options - ExperimentsClientListOptions contains the optional parameters for the ExperimentsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/ListExperimentsInAResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewExperimentsClient().NewListPager("exampleRG", &armchaos.ExperimentsClientListOptions{Running: nil, ContinuationToken: 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.ExperimentListResult = armchaos.ExperimentListResult{ // Value: []*armchaos.Experiment{ // { // Name: to.Ptr("exampleExperiment"), // Type: to.Ptr("Microsoft.Chaos/experiments"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment"), // Location: to.Ptr("centraluseuap"), // Identity: &armchaos.ResourceIdentity{ // Type: to.Ptr(armchaos.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("d04ab567-2c07-43ef-a7f4-4527626b7f56"), // TenantID: to.Ptr("8c3e2fb2-fe7a-4bf1-b779-d73990782fe6"), // }, // Properties: &armchaos.ExperimentProperties{ // Selectors: []*armchaos.Selector{ // { // Type: to.Ptr(armchaos.SelectorTypeList), // ID: to.Ptr("selector1"), // Targets: []*armchaos.TargetReference{ // { // Type: to.Ptr("ChaosTarget"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine"), // }}, // }}, // Steps: []*armchaos.Step{ // { // Name: to.Ptr("step1"), // Branches: []*armchaos.Branch{ // { // Name: to.Ptr("branch1"), // Actions: []armchaos.ActionClassification{ // &armchaos.Action{ // Name: to.Ptr("urn:csci:provider:providername:Shutdown/1.0"), // Type: to.Ptr("Continuous"), // }}, // }}, // }}, // }, // SystemData: &armchaos.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // CreatedBy: to.Ptr("User"), // CreatedByType: to.Ptr(armchaos.CreatedByType("b3a41dba-4415-4d36-9ee8-e5eaa86db976")), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // LastModifiedBy: to.Ptr("User"), // LastModifiedByType: to.Ptr(armchaos.CreatedByType("b3a41dba-4415-4d36-9ee8-e5eaa86db976")), // }, // }}, // } } }
Output:
func (*ExperimentsClient) Start ¶
func (client *ExperimentsClient) Start(ctx context.Context, resourceGroupName string, experimentName string, options *ExperimentsClientStartOptions) (ExperimentsClientStartResponse, error)
Start - Start a Experiment resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- experimentName - String that represents a Experiment resource name.
- options - ExperimentsClientStartOptions contains the optional parameters for the ExperimentsClient.Start method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/StartAExperiment.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewExperimentsClient().Start(ctx, "exampleRG", "exampleExperiment", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
type ExperimentsClientBeginCancelOptions ¶ added in v0.2.0
type ExperimentsClientBeginCancelOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ExperimentsClientBeginCancelOptions contains the optional parameters for the ExperimentsClient.BeginCancel method.
type ExperimentsClientBeginCreateOrUpdateOptions ¶ added in v0.2.0
type ExperimentsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ExperimentsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExperimentsClient.BeginCreateOrUpdate method.
type ExperimentsClientCancelResponse ¶ added in v0.2.0
type ExperimentsClientCancelResponse struct {
ExperimentCancelOperationResult
}
ExperimentsClientCancelResponse contains the response from method ExperimentsClient.BeginCancel.
type ExperimentsClientCreateOrUpdateResponse ¶ added in v0.2.0
type ExperimentsClientCreateOrUpdateResponse struct {
Experiment
}
ExperimentsClientCreateOrUpdateResponse contains the response from method ExperimentsClient.BeginCreateOrUpdate.
type ExperimentsClientDeleteOptions ¶ added in v0.2.0
type ExperimentsClientDeleteOptions struct { }
ExperimentsClientDeleteOptions contains the optional parameters for the ExperimentsClient.Delete method.
type ExperimentsClientDeleteResponse ¶ added in v0.2.0
type ExperimentsClientDeleteResponse struct { }
ExperimentsClientDeleteResponse contains the response from method ExperimentsClient.Delete.
type ExperimentsClientGetExecutionDetailsOptions ¶ added in v0.2.0
type ExperimentsClientGetExecutionDetailsOptions struct { }
ExperimentsClientGetExecutionDetailsOptions contains the optional parameters for the ExperimentsClient.GetExecutionDetails method.
type ExperimentsClientGetExecutionDetailsResponse ¶ added in v0.2.0
type ExperimentsClientGetExecutionDetailsResponse struct {
ExperimentExecutionDetails
}
ExperimentsClientGetExecutionDetailsResponse contains the response from method ExperimentsClient.GetExecutionDetails.
type ExperimentsClientGetOptions ¶ added in v0.2.0
type ExperimentsClientGetOptions struct { }
ExperimentsClientGetOptions contains the optional parameters for the ExperimentsClient.Get method.
type ExperimentsClientGetResponse ¶ added in v0.2.0
type ExperimentsClientGetResponse struct {
Experiment
}
ExperimentsClientGetResponse contains the response from method ExperimentsClient.Get.
type ExperimentsClientGetStatusOptions ¶ added in v0.2.0
type ExperimentsClientGetStatusOptions struct { }
ExperimentsClientGetStatusOptions contains the optional parameters for the ExperimentsClient.GetStatus method.
type ExperimentsClientGetStatusResponse ¶ added in v0.2.0
type ExperimentsClientGetStatusResponse struct {
ExperimentStatus
}
ExperimentsClientGetStatusResponse contains the response from method ExperimentsClient.GetStatus.
type ExperimentsClientListAllOptions ¶ added in v0.2.0
type ExperimentsClientListAllOptions struct { // String that sets the continuation token. ContinuationToken *string // Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then // the results will not be filtered. Running *bool }
ExperimentsClientListAllOptions contains the optional parameters for the ExperimentsClient.NewListAllPager method.
type ExperimentsClientListAllResponse ¶ added in v0.2.0
type ExperimentsClientListAllResponse struct {
ExperimentListResult
}
ExperimentsClientListAllResponse contains the response from method ExperimentsClient.NewListAllPager.
type ExperimentsClientListAllStatusesOptions ¶ added in v0.2.0
type ExperimentsClientListAllStatusesOptions struct { }
ExperimentsClientListAllStatusesOptions contains the optional parameters for the ExperimentsClient.NewListAllStatusesPager method.
type ExperimentsClientListAllStatusesResponse ¶ added in v0.2.0
type ExperimentsClientListAllStatusesResponse struct {
ExperimentStatusListResult
}
ExperimentsClientListAllStatusesResponse contains the response from method ExperimentsClient.NewListAllStatusesPager.
type ExperimentsClientListExecutionDetailsOptions ¶ added in v0.2.0
type ExperimentsClientListExecutionDetailsOptions struct { }
ExperimentsClientListExecutionDetailsOptions contains the optional parameters for the ExperimentsClient.NewListExecutionDetailsPager method.
type ExperimentsClientListExecutionDetailsResponse ¶ added in v0.2.0
type ExperimentsClientListExecutionDetailsResponse struct {
ExperimentExecutionDetailsListResult
}
ExperimentsClientListExecutionDetailsResponse contains the response from method ExperimentsClient.NewListExecutionDetailsPager.
type ExperimentsClientListOptions ¶ added in v0.2.0
type ExperimentsClientListOptions struct { // String that sets the continuation token. ContinuationToken *string // Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then // the results will not be filtered. Running *bool }
ExperimentsClientListOptions contains the optional parameters for the ExperimentsClient.NewListPager method.
type ExperimentsClientListResponse ¶ added in v0.2.0
type ExperimentsClientListResponse struct {
ExperimentListResult
}
ExperimentsClientListResponse contains the response from method ExperimentsClient.NewListPager.
type ExperimentsClientStartOptions ¶ added in v0.2.0
type ExperimentsClientStartOptions struct { }
ExperimentsClientStartOptions contains the optional parameters for the ExperimentsClient.Start method.
type ExperimentsClientStartResponse ¶ added in v0.2.0
type ExperimentsClientStartResponse struct {
ExperimentStartOperationResult
}
ExperimentsClientStartResponse contains the response from method ExperimentsClient.Start.
type KeyValuePair ¶ added in v0.2.0
type KeyValuePair struct { // REQUIRED; The name of the setting for the action. Key *string `json:"key,omitempty"` // REQUIRED; The value of the setting for the action. Value *string `json:"value,omitempty"` }
KeyValuePair - A map to describe the settings of an action.
func (KeyValuePair) MarshalJSON ¶ added in v0.6.0
func (k KeyValuePair) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type KeyValuePair.
func (*KeyValuePair) UnmarshalJSON ¶ added in v0.6.0
func (k *KeyValuePair) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type KeyValuePair.
type Operation ¶
type Operation struct { // Localized display information for this particular operation. Display *OperationDisplay `json:"display,omitempty"` // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` // 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 `json:"isDataAction,omitempty" azure:"ro"` // 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 `json:"name,omitempty" azure:"ro"` // 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 `json:"origin,omitempty" azure:"ro"` }
Operation - Details of a REST API operation, returned from the Resource Provider Operations API
func (Operation) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶ added in v0.6.0
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 `json:"description,omitempty" azure:"ro"` // 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 `json:"operation,omitempty" azure:"ro"` // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft // Compute". Provider *string `json:"provider,omitempty" azure:"ro"` // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job // Schedule Collections". Resource *string `json:"resource,omitempty" azure:"ro"` }
OperationDisplay - Localized display information for this particular operation.
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 OperationListResult ¶
type OperationListResult struct { // READ-ONLY; URL to get the next set of operation list results (if there are any). NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; List of operations supported by the resource provider Value []*Operation `json:"value,omitempty" azure:"ro"` }
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 ¶ added in v0.6.0
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) NewListAllPager ¶ added in v0.4.0
func (client *OperationsClient) NewListAllPager(options *OperationsClientListAllOptions) *runtime.Pager[OperationsClientListAllResponse]
NewListAllPager - Get a list all available Operations.
Generated from API version 2021-09-15-preview
- options - OperationsClientListAllOptions contains the optional parameters for the OperationsClient.NewListAllPager method.
type OperationsClientListAllOptions ¶ added in v0.2.0
type OperationsClientListAllOptions struct { }
OperationsClientListAllOptions contains the optional parameters for the OperationsClient.NewListAllPager method.
type OperationsClientListAllResponse ¶ added in v0.2.0
type OperationsClientListAllResponse struct {
OperationListResult
}
OperationsClientListAllResponse contains the response from method OperationsClient.NewListAllPager.
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 Resource ¶
type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
Resource - Common fields that are returned in the response for all Azure Resource Manager resources
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
type ResourceIdentity ¶
type ResourceIdentity struct { // REQUIRED; String of the resource identity type. Type *ResourceIdentityType `json:"type,omitempty"` // READ-ONLY; GUID that represents the principal ID of this resource identity. PrincipalID *string `json:"principalId,omitempty" azure:"ro"` // READ-ONLY; GUID that represents the tenant ID of this resource identity. TenantID *string `json:"tenantId,omitempty" azure:"ro"` }
ResourceIdentity - The managed identity of a resource.
func (ResourceIdentity) MarshalJSON ¶ added in v0.6.0
func (r ResourceIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceIdentity.
func (*ResourceIdentity) UnmarshalJSON ¶ added in v0.6.0
func (r *ResourceIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceIdentity.
type ResourceIdentityType ¶
type ResourceIdentityType string
ResourceIdentityType - String of the resource identity type.
const ( ResourceIdentityTypeNone ResourceIdentityType = "None" ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" )
func PossibleResourceIdentityTypeValues ¶
func PossibleResourceIdentityTypeValues() []ResourceIdentityType
PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type.
type Selector ¶
type Selector struct { // REQUIRED; String of the selector ID. ID *string `json:"id,omitempty"` // REQUIRED; List of Target references. Targets []*TargetReference `json:"targets,omitempty"` // REQUIRED; Enum of the selector type. Type *SelectorType `json:"type,omitempty"` }
Selector - Model that represents a selector in the Experiment resource.
func (Selector) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Selector.
func (*Selector) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Selector.
type SelectorType ¶
type SelectorType string
SelectorType - Enum of the selector type.
const ( SelectorTypePercent SelectorType = "Percent" SelectorTypeRandom SelectorType = "Random" SelectorTypeTag SelectorType = "Tag" SelectorTypeList SelectorType = "List" )
func PossibleSelectorTypeValues ¶
func PossibleSelectorTypeValues() []SelectorType
PossibleSelectorTypeValues returns the possible values for the SelectorType const type.
type Step ¶
type Step struct { // REQUIRED; List of branches. Branches []*Branch `json:"branches,omitempty"` // REQUIRED; String of the step name. Name *string `json:"name,omitempty"` }
Step - Model that represents a step in the Experiment resource.
func (Step) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Step.
func (*Step) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Step.
type StepStatus ¶
type StepStatus struct { // READ-ONLY; The array of branches. Branches []*BranchStatus `json:"branches,omitempty" azure:"ro"` // READ-ONLY; The value of the status of the step. Status *string `json:"status,omitempty" azure:"ro"` // READ-ONLY; The id of the step. StepID *string `json:"stepId,omitempty" azure:"ro"` // READ-ONLY; The name of the step. StepName *string `json:"stepName,omitempty" azure:"ro"` }
StepStatus - Model that represents the a list of branches and branch statuses.
func (StepStatus) MarshalJSON ¶
func (s StepStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StepStatus.
func (*StepStatus) UnmarshalJSON ¶ added in v0.6.0
func (s *StepStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StepStatus.
type SystemData ¶
type SystemData struct { // The timestamp of resource creation (UTC). CreatedAt *time.Time `json:"createdAt,omitempty"` // The identity that created the resource. CreatedBy *string `json:"createdBy,omitempty"` // The type of identity that created the resource. CreatedByType *CreatedByType `json:"createdByType,omitempty"` // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` // The identity that last modified the resource. LastModifiedBy *string `json:"lastModifiedBy,omitempty"` // The type of identity that last modified the resource. LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` }
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 Target ¶
type Target struct { // REQUIRED; The properties of the target resource. Properties map[string]any `json:"properties,omitempty"` // Location of the target resource. Location *string `json:"location,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The system metadata of the target resource. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
Target - Model that represents a Target resource.
func (Target) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Target.
func (*Target) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Target.
type TargetListResult ¶
type TargetListResult struct { // READ-ONLY; URL to retrieve the next page of Target resources. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; List of Target resources. Value []*Target `json:"value,omitempty" azure:"ro"` }
TargetListResult - Model that represents a list of Target resources and a link for pagination.
func (TargetListResult) MarshalJSON ¶
func (t TargetListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TargetListResult.
func (*TargetListResult) UnmarshalJSON ¶ added in v0.6.0
func (t *TargetListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TargetListResult.
type TargetReference ¶
type TargetReference struct { // REQUIRED; String of the resource ID of a Target resource. ID *string `json:"id,omitempty"` // CONSTANT; Enum of the Target reference type. // Field has constant value "ChaosTarget", any specified value is ignored. Type *string `json:"type,omitempty"` }
TargetReference - Model that represents a reference to a Target in the selector.
func (TargetReference) MarshalJSON ¶ added in v0.6.0
func (t TargetReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TargetReference.
func (*TargetReference) UnmarshalJSON ¶ added in v0.6.0
func (t *TargetReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TargetReference.
type TargetType ¶
type TargetType struct { // REQUIRED; The properties of the target type resource. Properties *TargetTypeProperties `json:"properties,omitempty"` // Location of the Target Type resource. Location *string `json:"location,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The system metadata properties of the target type resource. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
TargetType - Model that represents a Target Type resource.
func (TargetType) MarshalJSON ¶
func (t TargetType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TargetType.
func (*TargetType) UnmarshalJSON ¶ added in v0.6.0
func (t *TargetType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TargetType.
type TargetTypeListResult ¶
type TargetTypeListResult struct { // READ-ONLY; URL to retrieve the next page of Target Type resources. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; List of Target Type resources. Value []*TargetType `json:"value,omitempty" azure:"ro"` }
TargetTypeListResult - Model that represents a list of Target Type resources and a link for pagination.
func (TargetTypeListResult) MarshalJSON ¶
func (t TargetTypeListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TargetTypeListResult.
func (*TargetTypeListResult) UnmarshalJSON ¶ added in v0.6.0
func (t *TargetTypeListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TargetTypeListResult.
type TargetTypeProperties ¶
type TargetTypeProperties struct { // READ-ONLY; Localized string of the description. Description *string `json:"description,omitempty" azure:"ro"` // READ-ONLY; Localized string of the display name. DisplayName *string `json:"displayName,omitempty" azure:"ro"` // READ-ONLY; URL to retrieve JSON schema of the Target Type properties. PropertiesSchema *string `json:"propertiesSchema,omitempty" azure:"ro"` // READ-ONLY; List of resource types this Target Type can extend. ResourceTypes []*string `json:"resourceTypes,omitempty" azure:"ro"` }
TargetTypeProperties - Model that represents the base Target Type properties model.
func (TargetTypeProperties) MarshalJSON ¶
func (t TargetTypeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TargetTypeProperties.
func (*TargetTypeProperties) UnmarshalJSON ¶ added in v0.6.0
func (t *TargetTypeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TargetTypeProperties.
type TargetTypesClient ¶
type TargetTypesClient struct {
// contains filtered or unexported fields
}
TargetTypesClient contains the methods for the TargetTypes group. Don't use this type directly, use NewTargetTypesClient() instead.
func NewTargetTypesClient ¶
func NewTargetTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TargetTypesClient, error)
NewTargetTypesClient creates a new instance of TargetTypesClient with the specified values.
- subscriptionID - GUID that represents an Azure subscription ID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*TargetTypesClient) Get ¶
func (client *TargetTypesClient) Get(ctx context.Context, locationName string, targetTypeName string, options *TargetTypesClientGetOptions) (TargetTypesClientGetResponse, error)
Get - Get a Target Type resources for given location. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- locationName - String that represents a Location resource name.
- targetTypeName - String that represents a Target Type resource name.
- options - TargetTypesClientGetOptions contains the optional parameters for the TargetTypesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/GetATargetType.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewTargetTypesClient().Get(ctx, "westus2", "Microsoft-Agent", 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.TargetType = armchaos.TargetType{ // Name: to.Ptr("Microsoft-Agent"), // Type: to.Ptr("Microsoft.Chaos/locations/targetTypes"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-Agent"), // Location: to.Ptr("centraluseuap"), // Properties: &armchaos.TargetTypeProperties{ // Description: to.Ptr("A target represents Chaos Agent."), // DisplayName: to.Ptr("Chaos Agent"), // PropertiesSchema: to.Ptr("https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine.json"), // ResourceTypes: []*string{ // to.Ptr("Microsoft.Compute/virtualMachines"), // to.Ptr("Microsoft.Compute/virtualMachineScaleSets")}, // }, // } }
Output:
func (*TargetTypesClient) NewListPager ¶ added in v0.4.0
func (client *TargetTypesClient) NewListPager(locationName string, options *TargetTypesClientListOptions) *runtime.Pager[TargetTypesClientListResponse]
NewListPager - Get a list of Target Type resources for given location.
Generated from API version 2021-09-15-preview
- locationName - String that represents a Location resource name.
- options - TargetTypesClientListOptions contains the optional parameters for the TargetTypesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/ListTargetTypes.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewTargetTypesClient().NewListPager("westus2", &armchaos.TargetTypesClientListOptions{ContinuationToken: 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.TargetTypeListResult = armchaos.TargetTypeListResult{ // Value: []*armchaos.TargetType{ // { // Name: to.Ptr("Microsoft-Agent"), // Type: to.Ptr("Microsoft.Chaos/locations/targetTypes"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-Agent"), // Location: to.Ptr("centraluseuap"), // Properties: &armchaos.TargetTypeProperties{ // Description: to.Ptr("A target represents Chaos Agent."), // DisplayName: to.Ptr("Chaos Agent"), // PropertiesSchema: to.Ptr("https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine.json"), // ResourceTypes: []*string{ // to.Ptr("Microsoft.Compute/virtualMachines"), // to.Ptr("Microsoft.Compute/virtualMachineScaleSets")}, // }, // }}, // } } }
Output:
type TargetTypesClientGetOptions ¶ added in v0.2.0
type TargetTypesClientGetOptions struct { }
TargetTypesClientGetOptions contains the optional parameters for the TargetTypesClient.Get method.
type TargetTypesClientGetResponse ¶ added in v0.2.0
type TargetTypesClientGetResponse struct {
TargetType
}
TargetTypesClientGetResponse contains the response from method TargetTypesClient.Get.
type TargetTypesClientListOptions ¶ added in v0.2.0
type TargetTypesClientListOptions struct { // String that sets the continuation token. ContinuationToken *string }
TargetTypesClientListOptions contains the optional parameters for the TargetTypesClient.NewListPager method.
type TargetTypesClientListResponse ¶ added in v0.2.0
type TargetTypesClientListResponse struct {
TargetTypeListResult
}
TargetTypesClientListResponse contains the response from method TargetTypesClient.NewListPager.
type TargetsClient ¶
type TargetsClient struct {
// contains filtered or unexported fields
}
TargetsClient contains the methods for the Targets group. Don't use this type directly, use NewTargetsClient() instead.
func NewTargetsClient ¶
func NewTargetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TargetsClient, error)
NewTargetsClient creates a new instance of TargetsClient with the specified values.
- subscriptionID - GUID that represents an Azure subscription ID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*TargetsClient) CreateOrUpdate ¶
func (client *TargetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, parentProviderNamespace string, parentResourceType string, parentResourceName string, targetName string, target Target, options *TargetsClientCreateOrUpdateOptions) (TargetsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update a Target resource that extends a tracked regional resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- parentProviderNamespace - String that represents a resource provider namespace.
- parentResourceType - String that represents a resource type.
- parentResourceName - String that represents a resource name.
- targetName - String that represents a Target resource name.
- target - Target resource to be created or updated.
- options - TargetsClientCreateOrUpdateOptions contains the optional parameters for the TargetsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/CreateOrUpdateATarget.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewTargetsClient().CreateOrUpdate(ctx, "exampleRG", "Microsoft.Compute", "virtualMachines", "exampleVM", "Microsoft-Agent", armchaos.Target{ Properties: map[string]any{ "identities": []any{ map[string]any{ "type": "CertificateSubjectIssuer", "subject": "CN=example.subject", }, }, }, }, 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.Target = armchaos.Target{ // Name: to.Ptr("Microsoft-Agent"), // Type: to.Ptr("Microsoft.Chaos/targets"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-Agent"), // Location: to.Ptr("centraluseuap"), // Properties: map[string]any{ // "agentProfileId": "ac4e8251-fdc9-4277-8e87-dc57fe5794cf", // "identities": []any{ // map[string]any{ // "type": "CertificateSubjectIssuer", // "subject": "CN=example.subject", // }, // }, // }, // SystemData: &armchaos.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // }, // } }
Output:
func (*TargetsClient) Delete ¶
func (client *TargetsClient) Delete(ctx context.Context, resourceGroupName string, parentProviderNamespace string, parentResourceType string, parentResourceName string, targetName string, options *TargetsClientDeleteOptions) (TargetsClientDeleteResponse, error)
Delete - Delete a Target resource that extends a tracked regional resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- parentProviderNamespace - String that represents a resource provider namespace.
- parentResourceType - String that represents a resource type.
- parentResourceName - String that represents a resource name.
- targetName - String that represents a Target resource name.
- options - TargetsClientDeleteOptions contains the optional parameters for the TargetsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/DeleteATarget.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewTargetsClient().Delete(ctx, "exampleRG", "Microsoft.Compute", "virtualMachines", "exampleVM", "Microsoft-Agent", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*TargetsClient) Get ¶
func (client *TargetsClient) Get(ctx context.Context, resourceGroupName string, parentProviderNamespace string, parentResourceType string, parentResourceName string, targetName string, options *TargetsClientGetOptions) (TargetsClientGetResponse, error)
Get - Get a Target resource that extends a tracked regional resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- parentProviderNamespace - String that represents a resource provider namespace.
- parentResourceType - String that represents a resource type.
- parentResourceName - String that represents a resource name.
- targetName - String that represents a Target resource name.
- options - TargetsClientGetOptions contains the optional parameters for the TargetsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/GetATarget.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewTargetsClient().Get(ctx, "exampleRG", "Microsoft.Compute", "virtualMachines", "exampleVM", "Microsoft-Agent", 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.Target = armchaos.Target{ // Name: to.Ptr("Microsoft-Agent"), // Type: to.Ptr("Microsoft.Chaos/targets"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-Agent"), // Location: to.Ptr("centraluseuap"), // Properties: map[string]any{ // "agentProfileId": "ac4e8251-fdc9-4277-8e87-dc57fe5794cf", // "identities": []any{ // map[string]any{ // "type": "CertificateSubjectIssuer", // "subject": "CN=example.subject", // }, // }, // }, // SystemData: &armchaos.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // }, // } }
Output:
func (*TargetsClient) NewListPager ¶ added in v0.4.0
func (client *TargetsClient) NewListPager(resourceGroupName string, parentProviderNamespace string, parentResourceType string, parentResourceName string, options *TargetsClientListOptions) *runtime.Pager[TargetsClientListResponse]
NewListPager - Get a list of Target resources that extend a tracked regional resource.
Generated from API version 2021-09-15-preview
- resourceGroupName - String that represents an Azure resource group.
- parentProviderNamespace - String that represents a resource provider namespace.
- parentResourceType - String that represents a resource type.
- parentResourceName - String that represents a resource name.
- options - TargetsClientListOptions contains the optional parameters for the TargetsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/examples/ListTargets.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewTargetsClient().NewListPager("exampleRG", "Microsoft.Compute", "virtualMachines", "exampleVM", &armchaos.TargetsClientListOptions{ContinuationToken: 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.TargetListResult = armchaos.TargetListResult{ // Value: []*armchaos.Target{ // { // Name: to.Ptr("Microsoft-Agent"), // Type: to.Ptr("Microsoft.Chaos/targets"), // ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-Agent"), // Location: to.Ptr("centraluseuap"), // Properties: map[string]any{ // "agentProfileId": "ac4e8251-fdc9-4277-8e87-dc57fe5794cf", // "identities": []any{ // map[string]any{ // "type": "CertificateSubjectIssuer", // "subject": "CN=example.subject", // }, // }, // }, // SystemData: &armchaos.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()), // }, // }}, // } } }
Output:
type TargetsClientCreateOrUpdateOptions ¶ added in v0.2.0
type TargetsClientCreateOrUpdateOptions struct { }
TargetsClientCreateOrUpdateOptions contains the optional parameters for the TargetsClient.CreateOrUpdate method.
type TargetsClientCreateOrUpdateResponse ¶ added in v0.2.0
type TargetsClientCreateOrUpdateResponse struct {
Target
}
TargetsClientCreateOrUpdateResponse contains the response from method TargetsClient.CreateOrUpdate.
type TargetsClientDeleteOptions ¶ added in v0.2.0
type TargetsClientDeleteOptions struct { }
TargetsClientDeleteOptions contains the optional parameters for the TargetsClient.Delete method.
type TargetsClientDeleteResponse ¶ added in v0.2.0
type TargetsClientDeleteResponse struct { }
TargetsClientDeleteResponse contains the response from method TargetsClient.Delete.
type TargetsClientGetOptions ¶ added in v0.2.0
type TargetsClientGetOptions struct { }
TargetsClientGetOptions contains the optional parameters for the TargetsClient.Get method.
type TargetsClientGetResponse ¶ added in v0.2.0
type TargetsClientGetResponse struct {
Target
}
TargetsClientGetResponse contains the response from method TargetsClient.Get.
type TargetsClientListOptions ¶ added in v0.2.0
type TargetsClientListOptions struct { // String that sets the continuation token. ContinuationToken *string }
TargetsClientListOptions contains the optional parameters for the TargetsClient.NewListPager method.
type TargetsClientListResponse ¶ added in v0.2.0
type TargetsClientListResponse struct {
TargetListResult
}
TargetsClientListResponse contains the response from method TargetsClient.NewListPager.
type TrackedResource ¶
type TrackedResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
func (TrackedResource) MarshalJSON ¶
func (t TrackedResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TrackedResource.
func (*TrackedResource) UnmarshalJSON ¶ added in v0.6.0
func (t *TrackedResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.