Documentation
¶
Index ¶
- type ActionType
- type BaseExportModel
- type BaseExportModelClassification
- type ClientFactory
- type ErrorAdditionalInfo
- type ErrorAdditionalInfoInfo
- type ErrorDetail
- type ExportQuery
- type ExportResource
- type ExportResourceGroup
- type ExportResult
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationStatus
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Origin
- type ResourceProvisioningState
- type TargetProvider
- type TerraformClient
- type TerraformClientBeginExportTerraformOptions
- type TerraformClientExportTerraformResponse
- type Type
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType string
ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
const ( // ActionTypeInternal - Actions are for internal-only APIs. ActionTypeInternal ActionType = "Internal" )
func PossibleActionTypeValues ¶
func PossibleActionTypeValues() []ActionType
PossibleActionTypeValues returns the possible values for the ActionType const type.
type BaseExportModel ¶
type BaseExportModel struct { // REQUIRED; The parameter type Type *Type // Whether to output all non-computed properties in the generated Terraform configuration? This probably needs manual modifications // to make it valid FullProperties *bool // Mask sensitive attributes in the Terraform configuration MaskSensitive *bool // The target Azure Terraform Provider TargetProvider *TargetProvider }
BaseExportModel - The base export parameter
func (*BaseExportModel) GetBaseExportModel ¶
func (b *BaseExportModel) GetBaseExportModel() *BaseExportModel
GetBaseExportModel implements the BaseExportModelClassification interface for type BaseExportModel.
func (BaseExportModel) MarshalJSON ¶
func (b BaseExportModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BaseExportModel.
func (*BaseExportModel) UnmarshalJSON ¶
func (b *BaseExportModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BaseExportModel.
type BaseExportModelClassification ¶
type BaseExportModelClassification interface { // GetBaseExportModel returns the BaseExportModel content of the underlying type. GetBaseExportModel() *BaseExportModel }
BaseExportModelClassification provides polymorphic access to related types. Call the interface's GetBaseExportModel() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *BaseExportModel, *ExportQuery, *ExportResource, *ExportResourceGroup
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewOperationsClient ¶
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
func (*ClientFactory) NewTerraformClient ¶
func (c *ClientFactory) NewTerraformClient() *TerraformClient
NewTerraformClient creates a new instance of TerraformClient.
type ErrorAdditionalInfo ¶
type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. Info *ErrorAdditionalInfoInfo // READ-ONLY; The additional info type. Type *string }
ErrorAdditionalInfo - The resource management error additional info.
func (ErrorAdditionalInfo) MarshalJSON ¶
func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.
func (*ErrorAdditionalInfo) UnmarshalJSON ¶
func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.
type ErrorAdditionalInfoInfo ¶
type ErrorAdditionalInfoInfo struct { }
type ErrorDetail ¶
type ErrorDetail struct { // READ-ONLY; The error additional info. AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. Code *string // READ-ONLY; The error details. Details []*ErrorDetail // READ-ONLY; The error message. Message *string // READ-ONLY; The error target. Target *string }
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 ¶
func (e *ErrorDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.
type ExportQuery ¶
type ExportQuery struct { // REQUIRED; The ARG where predicate. Note that you can combine multiple conditions in one `where` predicate, e.g. `resourceGroup // =~ "my-rg" and type =~ "microsoft.network/virtualnetworks"` Query *string // CONSTANT; The parameter type // Field has constant value TypeExportQuery, any specified value is ignored. Type *Type // Whether to output all non-computed properties in the generated Terraform configuration? This probably needs manual modifications // to make it valid FullProperties *bool // Mask sensitive attributes in the Terraform configuration MaskSensitive *bool // The name pattern of the Terraform resources NamePattern *string // Whether to recursively list child resources of the query result Recursive *bool // The target Azure Terraform Provider TargetProvider *TargetProvider }
ExportQuery - Export parameter for resources queried by ARG (Azure Resource Graph)
func (*ExportQuery) GetBaseExportModel ¶
func (e *ExportQuery) GetBaseExportModel() *BaseExportModel
GetBaseExportModel implements the BaseExportModelClassification interface for type ExportQuery.
func (ExportQuery) MarshalJSON ¶
func (e ExportQuery) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportQuery.
func (*ExportQuery) UnmarshalJSON ¶
func (e *ExportQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExportQuery.
type ExportResource ¶
type ExportResource struct { // REQUIRED; The id of the resource to be exported ResourceIDs []*string // CONSTANT; The parameter type // Field has constant value TypeExportResource, any specified value is ignored. Type *Type // Whether to output all non-computed properties in the generated Terraform configuration? This probably needs manual modifications // to make it valid FullProperties *bool // Mask sensitive attributes in the Terraform configuration MaskSensitive *bool // The name pattern of the Terraform resources NamePattern *string // The Terraform resource name. Only works when `resourceIds` contains only one item. ResourceName *string // The Terraform resource type. Only works when `resourceIds` contains only one item. ResourceType *string // The target Azure Terraform Provider TargetProvider *TargetProvider }
ExportResource - Export parameter for individual resources.
func (*ExportResource) GetBaseExportModel ¶
func (e *ExportResource) GetBaseExportModel() *BaseExportModel
GetBaseExportModel implements the BaseExportModelClassification interface for type ExportResource.
func (ExportResource) MarshalJSON ¶
func (e ExportResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportResource.
func (*ExportResource) UnmarshalJSON ¶
func (e *ExportResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExportResource.
type ExportResourceGroup ¶
type ExportResourceGroup struct { // REQUIRED; The name of the resource group to be exported ResourceGroupName *string // CONSTANT; The parameter type // Field has constant value TypeExportResourceGroup, any specified value is ignored. Type *Type // Whether to output all non-computed properties in the generated Terraform configuration? This probably needs manual modifications // to make it valid FullProperties *bool // Mask sensitive attributes in the Terraform configuration MaskSensitive *bool // The name pattern of the Terraform resources NamePattern *string // The target Azure Terraform Provider TargetProvider *TargetProvider }
ExportResourceGroup - Export parameter for a resource group
func (*ExportResourceGroup) GetBaseExportModel ¶
func (e *ExportResourceGroup) GetBaseExportModel() *BaseExportModel
GetBaseExportModel implements the BaseExportModelClassification interface for type ExportResourceGroup.
func (ExportResourceGroup) MarshalJSON ¶
func (e ExportResourceGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportResourceGroup.
func (*ExportResourceGroup) UnmarshalJSON ¶
func (e *ExportResourceGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExportResourceGroup.
type ExportResult ¶
type ExportResult struct { // The Terraform configuration content Configuration *string // A list of errors derived during exporting each resource Errors []*ErrorDetail // A list of Azure resources which are not exported to Terraform due to there is no corresponding resources in Terraform SkippedResources []*string }
ExportResult - The Terraform export result
func (ExportResult) MarshalJSON ¶
func (e ExportResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportResult.
func (*ExportResult) UnmarshalJSON ¶
func (e *ExportResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExportResult.
type Operation ¶
type Operation struct { // Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. ActionType *ActionType // READ-ONLY; Localized display information for this particular operation. Display *OperationDisplay // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure // Resource Manager/control-plane operations. IsDataAction *bool // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", // "Microsoft.Compute/virtualMachines/capture/action" Name *string // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" Origin *Origin }
Operation - Details of a REST API operation, returned from the Resource Provider Operations API
func (Operation) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct { // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. Description *string // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual // Machine", "Restart Virtual Machine". Operation *string // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft // Compute". Provider *string // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job // Schedule Collections". Resource *string }
OperationDisplay - Localized display information for and operation.
func (OperationDisplay) MarshalJSON ¶
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationListResult ¶
type OperationListResult struct { // REQUIRED; The Operation items on this page Value []*Operation // The link to the next page of items NextLink *string }
OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
func (OperationListResult) MarshalJSON ¶
func (o OperationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResult.
func (*OperationListResult) UnmarshalJSON ¶
func (o *OperationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
type OperationStatus ¶
type OperationStatus struct { // REQUIRED; The operation status Status *ResourceProvisioningState // READ-ONLY; The unique identifier for the operationStatus resource ID *string // READ-ONLY; Operation complete time EndTime *time.Time // READ-ONLY; Errors that occurred if the operation ended with Canceled or Failed status Error *ErrorDetail // READ-ONLY; The name of the operationStatus resource Name *string // READ-ONLY; The progress made toward completing the operation PercentComplete *float64 // READ-ONLY; RP-specific properties for the operationStatus resource, only appears when operation ended with Succeeded status Properties *ExportResult // READ-ONLY; Operation start time StartTime *time.Time }
OperationStatus - The status of the LRO operation.
func (OperationStatus) MarshalJSON ¶
func (o OperationStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationStatus.
func (*OperationStatus) UnmarshalJSON ¶
func (o *OperationStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus.
type OperationsClient ¶
type OperationsClient struct {
// contains filtered or unexported fields
}
OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.
func NewOperationsClient ¶
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)
NewOperationsClient creates a new instance of OperationsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*OperationsClient) NewListPager ¶
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - List the operations for the provider
Generated from API version 2023-07-01-preview
- options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example ¶
Generated from example definition: 2023-07-01-preview/ListOperations.json
package main import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/terraform/armterraform" "log" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armterraform.NewClientFactory("<subscriptionID>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page = armterraform.OperationsClientListResponse{ // OperationListResult: armterraform.OperationListResult{ // Value: []*armterraform.Operation{ // { // Name: to.Ptr("Microsoft.AzureTerraform/operations/read"), // Display: &armterraform.OperationDisplay{ // Provider: to.Ptr("Microsoft AzureTerraform"), // Resource: to.Ptr("Azure Terraform Resource Provider"), // Operation: to.Ptr("ListOperations"), // Description: to.Ptr("Lists all of the available RP operations."), // }, // }, // { // Name: to.Ptr("Microsoft.AzureTerraform/exportTerraform/action"), // Display: &armterraform.OperationDisplay{ // Provider: to.Ptr("Microsoft AzureTerraform"), // Resource: to.Ptr("Azure Terraform Resource Provider"), // Operation: to.Ptr("ExportTerraform"), // Description: to.Ptr("Exports the Terraform configuration used for the specified scope."), // }, // }, // }, // }, // } } }
type OperationsClientListOptions ¶
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
type OperationsClientListResponse ¶
type OperationsClientListResponse struct { // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult }
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type Origin ¶
type Origin string
Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
const ( // OriginSystem - Indicates the operation is initiated by a system. OriginSystem Origin = "system" // OriginUser - Indicates the operation is initiated by a user. OriginUser Origin = "user" // OriginUserSystem - Indicates the operation is initiated by a user or system. OriginUserSystem Origin = "user,system" )
func PossibleOriginValues ¶
func PossibleOriginValues() []Origin
PossibleOriginValues returns the possible values for the Origin const type.
type ResourceProvisioningState ¶
type ResourceProvisioningState string
ResourceProvisioningState - The provisioning state of a resource type.
const ( // ResourceProvisioningStateCanceled - Resource creation was canceled. ResourceProvisioningStateCanceled ResourceProvisioningState = "Canceled" // ResourceProvisioningStateFailed - Resource creation failed. ResourceProvisioningStateFailed ResourceProvisioningState = "Failed" // ResourceProvisioningStateSucceeded - Resource has been created. ResourceProvisioningStateSucceeded ResourceProvisioningState = "Succeeded" )
func PossibleResourceProvisioningStateValues ¶
func PossibleResourceProvisioningStateValues() []ResourceProvisioningState
PossibleResourceProvisioningStateValues returns the possible values for the ResourceProvisioningState const type.
type TargetProvider ¶
type TargetProvider string
TargetProvider - The target Azure Terraform Provider
const ( // TargetProviderAzapi - https://registry.terraform.io/providers/Azure/azapi/latest TargetProviderAzapi TargetProvider = "azapi" // TargetProviderAzurerm - https://registry.terraform.io/providers/hashicorp/azurerm/latest TargetProviderAzurerm TargetProvider = "azurerm" )
func PossibleTargetProviderValues ¶
func PossibleTargetProviderValues() []TargetProvider
PossibleTargetProviderValues returns the possible values for the TargetProvider const type.
type TerraformClient ¶
type TerraformClient struct {
// contains filtered or unexported fields
}
TerraformClient contains the methods for the Terraform group. Don't use this type directly, use NewTerraformClient() instead.
func NewTerraformClient ¶
func NewTerraformClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TerraformClient, error)
NewTerraformClient creates a new instance of TerraformClient with the specified values.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*TerraformClient) BeginExportTerraform ¶
func (client *TerraformClient) BeginExportTerraform(ctx context.Context, body BaseExportModelClassification, options *TerraformClientBeginExportTerraformOptions) (*runtime.Poller[TerraformClientExportTerraformResponse], error)
BeginExportTerraform - Exports the Terraform configuration of the specified resource(s). If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- body - The request body
- options - TerraformClientBeginExportTerraformOptions contains the optional parameters for the TerraformClient.BeginExportTerraform method.
Example ¶
Generated from example definition: 2023-07-01-preview/ExportTerraform.json
package main import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/terraform/armterraform" "log" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armterraform.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } // armterraform.ExportResourceGroup{ // Type: to.Ptr(armterraform.TypeExportResourceGroup), // ResourceGroupName: to.Ptr("rg1"), // } var b armterraform.BaseExportModelClassification poller, err := clientFactory.NewTerraformClient().BeginExportTerraform(ctx, b, 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) } }
type TerraformClientBeginExportTerraformOptions ¶
type TerraformClientBeginExportTerraformOptions struct { // Resumes the long-running operation from the provided token. ResumeToken string }
TerraformClientBeginExportTerraformOptions contains the optional parameters for the TerraformClient.BeginExportTerraform method.
type TerraformClientExportTerraformResponse ¶
type TerraformClientExportTerraformResponse struct { // The status of the LRO operation. OperationStatus }
TerraformClientExportTerraformResponse contains the response from method TerraformClient.BeginExportTerraform.