Categorygithub.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armpolicy
modulepackage
0.9.0
Repository: https://github.com/azure/azure-sdk-for-go.git
Documentation: pkg.go.dev

# README

Azure Resource Policy Module for Go

PkgGoDev

The armpolicy module provides operations for working with Azure Resource Policy.

Source code

Getting started

Prerequisites

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

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Resource Policy module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armpolicy

Authorization

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

cred, err := azidentity.NewDefaultAzureCredential(nil)

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

Client Factory

Azure Resource Policy module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

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

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

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

Clients

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

client := clientFactory.NewDefinitionsClient()

Fakes

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

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

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Resource Policy label.

Contributing

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

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

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

# Packages

No description provided by the author

# Functions

NewAssignmentsClient creates a new instance of AssignmentsClient with the specified values.
NewClientFactory creates a new instance of ClientFactory with the specified values.
NewDataPolicyManifestsClient creates a new instance of DataPolicyManifestsClient with the specified values.
NewDefinitionsClient creates a new instance of DefinitionsClient with the specified values.
NewExemptionsClient creates a new instance of ExemptionsClient with the specified values.
NewSetDefinitionsClient creates a new instance of SetDefinitionsClient with the specified values.
NewVariablesClient creates a new instance of VariablesClient with the specified values.
NewVariableValuesClient creates a new instance of VariableValuesClient with the specified values.
PossibleAliasPathAttributesValues returns the possible values for the AliasPathAttributes const type.
PossibleAliasPathTokenTypeValues returns the possible values for the AliasPathTokenType const type.
PossibleAliasPatternTypeValues returns the possible values for the AliasPatternType const type.
PossibleAliasTypeValues returns the possible values for the AliasType const type.
PossibleAssignmentScopeValidationValues returns the possible values for the AssignmentScopeValidation const type.
PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
PossibleEnforcementModeValues returns the possible values for the EnforcementMode const type.
PossibleExemptionCategoryValues returns the possible values for the ExemptionCategory const type.
PossibleOverrideKindValues returns the possible values for the OverrideKind const type.
PossibleParameterTypeValues returns the possible values for the ParameterType const type.
PossiblePolicyTypeValues returns the possible values for the PolicyType const type.
PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type.
PossibleSelectorKindValues returns the possible values for the SelectorKind const type.

# Constants

AliasPathAttributesModifiable - The token that the alias path is referring to is modifiable by policies with 'modify' effect.
AliasPathAttributesNone - The token that the alias path is referring to has no attributes.
AliasPathTokenTypeAny - The token type can be anything.
AliasPathTokenTypeArray - The token type is array.
AliasPathTokenTypeBoolean - The token type is boolean.
AliasPathTokenTypeInteger - The token type is integer.
AliasPathTokenTypeNotSpecified - The token type is not specified.
AliasPathTokenTypeNumber - The token type is number.
AliasPathTokenTypeObject - The token type is object.
AliasPathTokenTypeString - The token type is string.
AliasPatternTypeExtract - Extract is the only allowed value.
AliasPatternTypeNotSpecified - NotSpecified is not allowed.
AliasTypeMask - Alias value is secret.
AliasTypeNotSpecified - Alias type is unknown (same as not providing alias type).
AliasTypePlainText - Alias value is not secret.
AssignmentScopeValidationDefault - This option will validate the exemption is at or under the assignment scope.
AssignmentScopeValidationDoNotValidate - This option will bypass the validation the exemption scope is at or under the policy assignment scope.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
EnforcementModeDefault - The policy effect is enforced during resource creation or update.
EnforcementModeDoNotEnforce - The policy effect is not enforced during resource creation or update.
ExemptionCategoryMitigated - This category of exemptions usually means the mitigation actions have been applied to the scope.
ExemptionCategoryWaiver - This category of exemptions usually means the scope is not applicable for the policy.
OverrideKindPolicyEffect - It will override the policy effect type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ResourceIdentityTypeNone - Indicates that no identity is associated with the resource or that the existing identity should be removed.
ResourceIdentityTypeSystemAssigned - Indicates that a system assigned identity is associated with the resource.
ResourceIdentityTypeUserAssigned - Indicates that a system assigned identity is associated with the resource.
SelectorKindPolicyDefinitionReferenceID - The selector kind to filter policies by the policy definition reference ID.
SelectorKindResourceLocation - The selector kind to filter policies by the resource location.
SelectorKindResourceType - The selector kind to filter policies by the resource type.
SelectorKindResourceWithoutLocation - The selector kind to filter policies by the resource without location.

# Structs

Alias - The alias type.
AliasPath - The type of the paths for alias.
No description provided by the author
AliasPattern - The type of the pattern for an alias path.
Assignment - The policy assignment.
AssignmentListResult - List of policy assignments.
AssignmentProperties - The policy assignment properties.
AssignmentsClient contains the methods for the PolicyAssignments group.
AssignmentsClientCreateByIDOptions contains the optional parameters for the AssignmentsClient.CreateByID method.
AssignmentsClientCreateByIDResponse contains the response from method AssignmentsClient.CreateByID.
AssignmentsClientCreateOptions contains the optional parameters for the AssignmentsClient.Create method.
AssignmentsClientCreateResponse contains the response from method AssignmentsClient.Create.
AssignmentsClientDeleteByIDOptions contains the optional parameters for the AssignmentsClient.DeleteByID method.
AssignmentsClientDeleteByIDResponse contains the response from method AssignmentsClient.DeleteByID.
AssignmentsClientDeleteOptions contains the optional parameters for the AssignmentsClient.Delete method.
AssignmentsClientDeleteResponse contains the response from method AssignmentsClient.Delete.
AssignmentsClientGetByIDOptions contains the optional parameters for the AssignmentsClient.GetByID method.
AssignmentsClientGetByIDResponse contains the response from method AssignmentsClient.GetByID.
AssignmentsClientGetOptions contains the optional parameters for the AssignmentsClient.Get method.
AssignmentsClientGetResponse contains the response from method AssignmentsClient.Get.
AssignmentsClientListForManagementGroupOptions contains the optional parameters for the AssignmentsClient.NewListForManagementGroupPager method.
AssignmentsClientListForManagementGroupResponse contains the response from method AssignmentsClient.NewListForManagementGroupPager.
AssignmentsClientListForResourceGroupOptions contains the optional parameters for the AssignmentsClient.NewListForResourceGroupPager method.
AssignmentsClientListForResourceGroupResponse contains the response from method AssignmentsClient.NewListForResourceGroupPager.
AssignmentsClientListForResourceOptions contains the optional parameters for the AssignmentsClient.NewListForResourcePager method.
AssignmentsClientListForResourceResponse contains the response from method AssignmentsClient.NewListForResourcePager.
AssignmentsClientListOptions contains the optional parameters for the AssignmentsClient.NewListPager method.
AssignmentsClientListResponse contains the response from method AssignmentsClient.NewListPager.
AssignmentsClientUpdateByIDOptions contains the optional parameters for the AssignmentsClient.UpdateByID method.
AssignmentsClientUpdateByIDResponse contains the response from method AssignmentsClient.UpdateByID.
AssignmentsClientUpdateOptions contains the optional parameters for the AssignmentsClient.Update method.
AssignmentsClientUpdateResponse contains the response from method AssignmentsClient.Update.
AssignmentUpdate - The policy assignment for Patch request.
AssignmentUpdateProperties - The policy assignment properties for Patch request.
ClientFactory is a client factory used to create any client in this module.
DataEffect - The data effect definition.
DataManifestCustomResourceFunctionDefinition - The custom resource function definition.
DataManifestResourceFunctionsDefinition - The resource functions supported by a manifest.
DataPolicyManifest - The data policy manifest.
DataPolicyManifestListResult - List of data policy manifests.
DataPolicyManifestProperties - The properties of the data policy manifest.
DataPolicyManifestsClient contains the methods for the DataPolicyManifests group.
DataPolicyManifestsClientGetByPolicyModeOptions contains the optional parameters for the DataPolicyManifestsClient.GetByPolicyMode method.
DataPolicyManifestsClientGetByPolicyModeResponse contains the response from method DataPolicyManifestsClient.GetByPolicyMode.
DataPolicyManifestsClientListOptions contains the optional parameters for the DataPolicyManifestsClient.NewListPager method.
DataPolicyManifestsClientListResponse contains the response from method DataPolicyManifestsClient.NewListPager.
Definition - The policy definition.
DefinitionGroup - The policy definition group.
DefinitionListResult - List of policy definitions.
DefinitionProperties - The policy definition properties.
DefinitionReference - The policy definition reference.
DefinitionsClient contains the methods for the PolicyDefinitions group.
DefinitionsClientCreateOrUpdateAtManagementGroupOptions contains the optional parameters for the DefinitionsClient.CreateOrUpdateAtManagementGroup method.
DefinitionsClientCreateOrUpdateAtManagementGroupResponse contains the response from method DefinitionsClient.CreateOrUpdateAtManagementGroup.
DefinitionsClientCreateOrUpdateOptions contains the optional parameters for the DefinitionsClient.CreateOrUpdate method.
DefinitionsClientCreateOrUpdateResponse contains the response from method DefinitionsClient.CreateOrUpdate.
DefinitionsClientDeleteAtManagementGroupOptions contains the optional parameters for the DefinitionsClient.DeleteAtManagementGroup method.
DefinitionsClientDeleteAtManagementGroupResponse contains the response from method DefinitionsClient.DeleteAtManagementGroup.
DefinitionsClientDeleteOptions contains the optional parameters for the DefinitionsClient.Delete method.
DefinitionsClientDeleteResponse contains the response from method DefinitionsClient.Delete.
DefinitionsClientGetAtManagementGroupOptions contains the optional parameters for the DefinitionsClient.GetAtManagementGroup method.
DefinitionsClientGetAtManagementGroupResponse contains the response from method DefinitionsClient.GetAtManagementGroup.
DefinitionsClientGetBuiltInOptions contains the optional parameters for the DefinitionsClient.GetBuiltIn method.
DefinitionsClientGetBuiltInResponse contains the response from method DefinitionsClient.GetBuiltIn.
DefinitionsClientGetOptions contains the optional parameters for the DefinitionsClient.Get method.
DefinitionsClientGetResponse contains the response from method DefinitionsClient.Get.
DefinitionsClientListBuiltInOptions contains the optional parameters for the DefinitionsClient.NewListBuiltInPager method.
DefinitionsClientListBuiltInResponse contains the response from method DefinitionsClient.NewListBuiltInPager.
DefinitionsClientListByManagementGroupOptions contains the optional parameters for the DefinitionsClient.NewListByManagementGroupPager method.
DefinitionsClientListByManagementGroupResponse contains the response from method DefinitionsClient.NewListByManagementGroupPager.
DefinitionsClientListOptions contains the optional parameters for the DefinitionsClient.NewListPager method.
DefinitionsClientListResponse contains the response from method DefinitionsClient.NewListPager.
Exemption - The policy exemption.
ExemptionListResult - List of policy exemptions.
ExemptionProperties - The policy exemption properties.
ExemptionsClient contains the methods for the PolicyExemptions group.
ExemptionsClientCreateOrUpdateOptions contains the optional parameters for the ExemptionsClient.CreateOrUpdate method.
ExemptionsClientCreateOrUpdateResponse contains the response from method ExemptionsClient.CreateOrUpdate.
ExemptionsClientDeleteOptions contains the optional parameters for the ExemptionsClient.Delete method.
ExemptionsClientDeleteResponse contains the response from method ExemptionsClient.Delete.
ExemptionsClientGetOptions contains the optional parameters for the ExemptionsClient.Get method.
ExemptionsClientGetResponse contains the response from method ExemptionsClient.Get.
ExemptionsClientListForManagementGroupOptions contains the optional parameters for the ExemptionsClient.NewListForManagementGroupPager method.
ExemptionsClientListForManagementGroupResponse contains the response from method ExemptionsClient.NewListForManagementGroupPager.
ExemptionsClientListForResourceGroupOptions contains the optional parameters for the ExemptionsClient.NewListForResourceGroupPager method.
ExemptionsClientListForResourceGroupResponse contains the response from method ExemptionsClient.NewListForResourceGroupPager.
ExemptionsClientListForResourceOptions contains the optional parameters for the ExemptionsClient.NewListForResourcePager method.
ExemptionsClientListForResourceResponse contains the response from method ExemptionsClient.NewListForResourcePager.
ExemptionsClientListOptions contains the optional parameters for the ExemptionsClient.NewListPager method.
ExemptionsClientListResponse contains the response from method ExemptionsClient.NewListPager.
ExemptionsClientUpdateOptions contains the optional parameters for the ExemptionsClient.Update method.
ExemptionsClientUpdateResponse contains the response from method ExemptionsClient.Update.
ExemptionUpdate - The policy exemption for Patch request.
ExemptionUpdateProperties - The policy exemption properties for Patch request.
Identity for the resource.
NonComplianceMessage - A message that describes why a resource is non-compliant with the policy.
Override - The policy property value override.
ParameterDefinitionsValue - The definition of a parameter that can be provided to the policy.
ParameterDefinitionsValueMetadata - General metadata for the parameter.
ParameterValuesValue - The value of a parameter.
ResourceSelector - The resource selector to filter policies by resource properties.
ResourceTypeAliases - The resource type aliases definition.
Selector - The selector expression.
SetDefinition - The policy set definition.
SetDefinitionListResult - List of policy set definitions.
SetDefinitionProperties - The policy set definition properties.
SetDefinitionsClient contains the methods for the PolicySetDefinitions group.
SetDefinitionsClientCreateOrUpdateAtManagementGroupOptions contains the optional parameters for the SetDefinitionsClient.CreateOrUpdateAtManagementGroup method.
SetDefinitionsClientCreateOrUpdateAtManagementGroupResponse contains the response from method SetDefinitionsClient.CreateOrUpdateAtManagementGroup.
SetDefinitionsClientCreateOrUpdateOptions contains the optional parameters for the SetDefinitionsClient.CreateOrUpdate method.
SetDefinitionsClientCreateOrUpdateResponse contains the response from method SetDefinitionsClient.CreateOrUpdate.
SetDefinitionsClientDeleteAtManagementGroupOptions contains the optional parameters for the SetDefinitionsClient.DeleteAtManagementGroup method.
SetDefinitionsClientDeleteAtManagementGroupResponse contains the response from method SetDefinitionsClient.DeleteAtManagementGroup.
SetDefinitionsClientDeleteOptions contains the optional parameters for the SetDefinitionsClient.Delete method.
SetDefinitionsClientDeleteResponse contains the response from method SetDefinitionsClient.Delete.
SetDefinitionsClientGetAtManagementGroupOptions contains the optional parameters for the SetDefinitionsClient.GetAtManagementGroup method.
SetDefinitionsClientGetAtManagementGroupResponse contains the response from method SetDefinitionsClient.GetAtManagementGroup.
SetDefinitionsClientGetBuiltInOptions contains the optional parameters for the SetDefinitionsClient.GetBuiltIn method.
SetDefinitionsClientGetBuiltInResponse contains the response from method SetDefinitionsClient.GetBuiltIn.
SetDefinitionsClientGetOptions contains the optional parameters for the SetDefinitionsClient.Get method.
SetDefinitionsClientGetResponse contains the response from method SetDefinitionsClient.Get.
SetDefinitionsClientListBuiltInOptions contains the optional parameters for the SetDefinitionsClient.NewListBuiltInPager method.
SetDefinitionsClientListBuiltInResponse contains the response from method SetDefinitionsClient.NewListBuiltInPager.
SetDefinitionsClientListByManagementGroupOptions contains the optional parameters for the SetDefinitionsClient.NewListByManagementGroupPager method.
SetDefinitionsClientListByManagementGroupResponse contains the response from method SetDefinitionsClient.NewListByManagementGroupPager.
SetDefinitionsClientListOptions contains the optional parameters for the SetDefinitionsClient.NewListPager method.
SetDefinitionsClientListResponse contains the response from method SetDefinitionsClient.NewListPager.
SystemData - Metadata pertaining to creation and last modification of the resource.
No description provided by the author
Variable - The variable.
VariableColumn - The variable column.
VariableListResult - List of variables.
VariableProperties - The variable properties.
VariablesClient contains the methods for the Variables group.
VariablesClientCreateOrUpdateAtManagementGroupOptions contains the optional parameters for the VariablesClient.CreateOrUpdateAtManagementGroup method.
VariablesClientCreateOrUpdateAtManagementGroupResponse contains the response from method VariablesClient.CreateOrUpdateAtManagementGroup.
VariablesClientCreateOrUpdateOptions contains the optional parameters for the VariablesClient.CreateOrUpdate method.
VariablesClientCreateOrUpdateResponse contains the response from method VariablesClient.CreateOrUpdate.
VariablesClientDeleteAtManagementGroupOptions contains the optional parameters for the VariablesClient.DeleteAtManagementGroup method.
VariablesClientDeleteAtManagementGroupResponse contains the response from method VariablesClient.DeleteAtManagementGroup.
VariablesClientDeleteOptions contains the optional parameters for the VariablesClient.Delete method.
VariablesClientDeleteResponse contains the response from method VariablesClient.Delete.
VariablesClientGetAtManagementGroupOptions contains the optional parameters for the VariablesClient.GetAtManagementGroup method.
VariablesClientGetAtManagementGroupResponse contains the response from method VariablesClient.GetAtManagementGroup.
VariablesClientGetOptions contains the optional parameters for the VariablesClient.Get method.
VariablesClientGetResponse contains the response from method VariablesClient.Get.
VariablesClientListForManagementGroupOptions contains the optional parameters for the VariablesClient.NewListForManagementGroupPager method.
VariablesClientListForManagementGroupResponse contains the response from method VariablesClient.NewListForManagementGroupPager.
VariablesClientListOptions contains the optional parameters for the VariablesClient.NewListPager method.
VariablesClientListResponse contains the response from method VariablesClient.NewListPager.
VariableValue - The variable value.
VariableValueColumnValue - The name value tuple for this variable value column.
VariableValueListResult - List of variable values.
VariableValueProperties - The variable value properties.
VariableValuesClient contains the methods for the VariableValues group.
VariableValuesClientCreateOrUpdateAtManagementGroupOptions contains the optional parameters for the VariableValuesClient.CreateOrUpdateAtManagementGroup method.
VariableValuesClientCreateOrUpdateAtManagementGroupResponse contains the response from method VariableValuesClient.CreateOrUpdateAtManagementGroup.
VariableValuesClientCreateOrUpdateOptions contains the optional parameters for the VariableValuesClient.CreateOrUpdate method.
VariableValuesClientCreateOrUpdateResponse contains the response from method VariableValuesClient.CreateOrUpdate.
VariableValuesClientDeleteAtManagementGroupOptions contains the optional parameters for the VariableValuesClient.DeleteAtManagementGroup method.
VariableValuesClientDeleteAtManagementGroupResponse contains the response from method VariableValuesClient.DeleteAtManagementGroup.
VariableValuesClientDeleteOptions contains the optional parameters for the VariableValuesClient.Delete method.
VariableValuesClientDeleteResponse contains the response from method VariableValuesClient.Delete.
VariableValuesClientGetAtManagementGroupOptions contains the optional parameters for the VariableValuesClient.GetAtManagementGroup method.
VariableValuesClientGetAtManagementGroupResponse contains the response from method VariableValuesClient.GetAtManagementGroup.
VariableValuesClientGetOptions contains the optional parameters for the VariableValuesClient.Get method.
VariableValuesClientGetResponse contains the response from method VariableValuesClient.Get.
VariableValuesClientListForManagementGroupOptions contains the optional parameters for the VariableValuesClient.NewListForManagementGroupPager method.
VariableValuesClientListForManagementGroupResponse contains the response from method VariableValuesClient.NewListForManagementGroupPager.
VariableValuesClientListOptions contains the optional parameters for the VariableValuesClient.NewListPager method.
VariableValuesClientListResponse contains the response from method VariableValuesClient.NewListPager.

# Type aliases

AliasPathAttributes - The attributes of the token that the alias path is referring to.
AliasPathTokenType - The type of the token that the alias path is referring to.
AliasPatternType - The type of alias pattern.
AliasType - The type of the alias.
AssignmentScopeValidation - The option whether validate the exemption is at or under the assignment scope.
CreatedByType - The type of identity that created the resource.
EnforcementMode - The policy assignment enforcement mode.
ExemptionCategory - The policy exemption category.
OverrideKind - The override kind.
ParameterType - The data type of the parameter.
PolicyType - The type of policy definition.
ResourceIdentityType - The identity type.
SelectorKind - The selector kind.