policy

package
v11.2.2-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package policy implements the Azure ARM Policy service API version 2016-12-01.

To manage and control access to your resources, you can define customized policies and assign them at a scope.

Index

Constants

View Source
const (
	// DefaultBaseURI is the default URI used for the service Policy
	DefaultBaseURI = "https://management.azure.com"
)

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

Types

type Assignment

type Assignment struct {
	autorest.Response     `json:"-"`
	*AssignmentProperties `json:"properties,omitempty"`
	ID                    *string `json:"id,omitempty"`
	Type                  *string `json:"type,omitempty"`
	Name                  *string `json:"name,omitempty"`
}

Assignment is the policy assignment.

type AssignmentListResult

type AssignmentListResult struct {
	autorest.Response `json:"-"`
	Value             *[]Assignment `json:"value,omitempty"`
	NextLink          *string       `json:"nextLink,omitempty"`
}

AssignmentListResult is list of policy assignments.

func (AssignmentListResult) AssignmentListResultPreparer

func (client AssignmentListResult) AssignmentListResultPreparer() (*http.Request, error)

AssignmentListResultPreparer prepares a request to retrieve the next set of results. It returns nil if no more results exist.

type AssignmentProperties

type AssignmentProperties struct {
	DisplayName        *string                 `json:"displayName,omitempty"`
	PolicyDefinitionID *string                 `json:"policyDefinitionId,omitempty"`
	Scope              *string                 `json:"scope,omitempty"`
	Parameters         *map[string]interface{} `json:"parameters,omitempty"`
	Description        *string                 `json:"description,omitempty"`
}

AssignmentProperties is the policy assignment properties.

type AssignmentsClient

type AssignmentsClient struct {
	ManagementClient
}

AssignmentsClient is the to manage and control access to your resources, you can define customized policies and assign them at a scope.

func NewAssignmentsClient

func NewAssignmentsClient(subscriptionID string) AssignmentsClient

NewAssignmentsClient creates an instance of the AssignmentsClient client.

func NewAssignmentsClientWithBaseURI

func NewAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) AssignmentsClient

NewAssignmentsClientWithBaseURI creates an instance of the AssignmentsClient client.

func (AssignmentsClient) Create

func (client AssignmentsClient) Create(scope string, policyAssignmentName string, parameters Assignment) (result Assignment, err error)

Create policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group.

scope is the scope of the policy assignment. policyAssignmentName is the name of the policy assignment. parameters is parameters for the policy assignment.

func (AssignmentsClient) CreateByID

func (client AssignmentsClient) CreateByID(policyAssignmentID string, parameters Assignment) (result Assignment, err error)

CreateByID policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.

policyAssignmentID is the ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. parameters is parameters for policy assignment.

func (AssignmentsClient) CreateByIDPreparer

func (client AssignmentsClient) CreateByIDPreparer(policyAssignmentID string, parameters Assignment) (*http.Request, error)

CreateByIDPreparer prepares the CreateByID request.

func (AssignmentsClient) CreateByIDResponder

func (client AssignmentsClient) CreateByIDResponder(resp *http.Response) (result Assignment, err error)

CreateByIDResponder handles the response to the CreateByID request. The method always closes the http.Response Body.

func (AssignmentsClient) CreateByIDSender

func (client AssignmentsClient) CreateByIDSender(req *http.Request) (*http.Response, error)

CreateByIDSender sends the CreateByID request. The method will close the http.Response Body if it receives an error.

func (AssignmentsClient) CreatePreparer

func (client AssignmentsClient) CreatePreparer(scope string, policyAssignmentName string, parameters Assignment) (*http.Request, error)

CreatePreparer prepares the Create request.

func (AssignmentsClient) CreateResponder

func (client AssignmentsClient) CreateResponder(resp *http.Response) (result Assignment, err error)

CreateResponder handles the response to the Create request. The method always closes the http.Response Body.

func (AssignmentsClient) CreateSender

func (client AssignmentsClient) CreateSender(req *http.Request) (*http.Response, error)

CreateSender sends the Create request. The method will close the http.Response Body if it receives an error.

func (AssignmentsClient) Delete

func (client AssignmentsClient) Delete(scope string, policyAssignmentName string) (result Assignment, err error)

Delete deletes a policy assignment.

scope is the scope of the policy assignment. policyAssignmentName is the name of the policy assignment to delete.

func (AssignmentsClient) DeleteByID

func (client AssignmentsClient) DeleteByID(policyAssignmentID string) (result Assignment, err error)

DeleteByID when providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.

policyAssignmentID is the ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.

func (AssignmentsClient) DeleteByIDPreparer

func (client AssignmentsClient) DeleteByIDPreparer(policyAssignmentID string) (*http.Request, error)

DeleteByIDPreparer prepares the DeleteByID request.

func (AssignmentsClient) DeleteByIDResponder

func (client AssignmentsClient) DeleteByIDResponder(resp *http.Response) (result Assignment, err error)

DeleteByIDResponder handles the response to the DeleteByID request. The method always closes the http.Response Body.

func (AssignmentsClient) DeleteByIDSender

func (client AssignmentsClient) DeleteByIDSender(req *http.Request) (*http.Response, error)

DeleteByIDSender sends the DeleteByID request. The method will close the http.Response Body if it receives an error.

func (AssignmentsClient) DeletePreparer

func (client AssignmentsClient) DeletePreparer(scope string, policyAssignmentName string) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (AssignmentsClient) DeleteResponder

func (client AssignmentsClient) DeleteResponder(resp *http.Response) (result Assignment, err error)

DeleteResponder handles the response to the Delete request. The method always closes the http.Response Body.

func (AssignmentsClient) DeleteSender

func (client AssignmentsClient) DeleteSender(req *http.Request) (*http.Response, error)

DeleteSender sends the Delete request. The method will close the http.Response Body if it receives an error.

func (AssignmentsClient) Get

func (client AssignmentsClient) Get(scope string, policyAssignmentName string) (result Assignment, err error)

Get gets a policy assignment.

scope is the scope of the policy assignment. policyAssignmentName is the name of the policy assignment to get.

func (AssignmentsClient) GetByID

func (client AssignmentsClient) GetByID(policyAssignmentID string) (result Assignment, err error)

GetByID when providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.

policyAssignmentID is the ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.

func (AssignmentsClient) GetByIDPreparer

func (client AssignmentsClient) GetByIDPreparer(policyAssignmentID string) (*http.Request, error)

GetByIDPreparer prepares the GetByID request.

func (AssignmentsClient) GetByIDResponder

func (client AssignmentsClient) GetByIDResponder(resp *http.Response) (result Assignment, err error)

GetByIDResponder handles the response to the GetByID request. The method always closes the http.Response Body.

func (AssignmentsClient) GetByIDSender

func (client AssignmentsClient) GetByIDSender(req *http.Request) (*http.Response, error)

GetByIDSender sends the GetByID request. The method will close the http.Response Body if it receives an error.

func (AssignmentsClient) GetPreparer

func (client AssignmentsClient) GetPreparer(scope string, policyAssignmentName string) (*http.Request, error)

GetPreparer prepares the Get request.

func (AssignmentsClient) GetResponder

func (client AssignmentsClient) GetResponder(resp *http.Response) (result Assignment, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (AssignmentsClient) GetSender

func (client AssignmentsClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (AssignmentsClient) List

func (client AssignmentsClient) List(filter string) (result AssignmentListResult, err error)

List gets all the policy assignments for a subscription.

filter is the filter to apply on the operation.

func (AssignmentsClient) ListComplete

func (client AssignmentsClient) ListComplete(filter string, cancel <-chan struct{}) (<-chan Assignment, <-chan error)

ListComplete gets all elements from the list without paging.

func (AssignmentsClient) ListForResource

func (client AssignmentsClient) ListForResource(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result AssignmentListResult, err error)

ListForResource gets policy assignments for a resource.

resourceGroupName is the name of the resource group containing the resource. The name is case insensitive. resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource path. resourceType is the resource type. resourceName is the name of the resource with policy assignments. filter is the filter to apply on the operation.

func (AssignmentsClient) ListForResourceComplete

func (client AssignmentsClient) ListForResourceComplete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string, cancel <-chan struct{}) (<-chan Assignment, <-chan error)

ListForResourceComplete gets all elements from the list without paging.

func (AssignmentsClient) ListForResourceGroup

func (client AssignmentsClient) ListForResourceGroup(resourceGroupName string, filter string) (result AssignmentListResult, err error)

ListForResourceGroup gets policy assignments for the resource group.

resourceGroupName is the name of the resource group that contains policy assignments. filter is the filter to apply on the operation.

func (AssignmentsClient) ListForResourceGroupComplete

func (client AssignmentsClient) ListForResourceGroupComplete(resourceGroupName string, filter string, cancel <-chan struct{}) (<-chan Assignment, <-chan error)

ListForResourceGroupComplete gets all elements from the list without paging.

func (AssignmentsClient) ListForResourceGroupNextResults

func (client AssignmentsClient) ListForResourceGroupNextResults(lastResults AssignmentListResult) (result AssignmentListResult, err error)

ListForResourceGroupNextResults retrieves the next set of results, if any.

func (AssignmentsClient) ListForResourceGroupPreparer

func (client AssignmentsClient) ListForResourceGroupPreparer(resourceGroupName string, filter string) (*http.Request, error)

ListForResourceGroupPreparer prepares the ListForResourceGroup request.

func (AssignmentsClient) ListForResourceGroupResponder

func (client AssignmentsClient) ListForResourceGroupResponder(resp *http.Response) (result AssignmentListResult, err error)

ListForResourceGroupResponder handles the response to the ListForResourceGroup request. The method always closes the http.Response Body.

func (AssignmentsClient) ListForResourceGroupSender

func (client AssignmentsClient) ListForResourceGroupSender(req *http.Request) (*http.Response, error)

ListForResourceGroupSender sends the ListForResourceGroup request. The method will close the http.Response Body if it receives an error.

func (AssignmentsClient) ListForResourceNextResults

func (client AssignmentsClient) ListForResourceNextResults(lastResults AssignmentListResult) (result AssignmentListResult, err error)

ListForResourceNextResults retrieves the next set of results, if any.

func (AssignmentsClient) ListForResourcePreparer

func (client AssignmentsClient) ListForResourcePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (*http.Request, error)

ListForResourcePreparer prepares the ListForResource request.

func (AssignmentsClient) ListForResourceResponder

func (client AssignmentsClient) ListForResourceResponder(resp *http.Response) (result AssignmentListResult, err error)

ListForResourceResponder handles the response to the ListForResource request. The method always closes the http.Response Body.

func (AssignmentsClient) ListForResourceSender

func (client AssignmentsClient) ListForResourceSender(req *http.Request) (*http.Response, error)

ListForResourceSender sends the ListForResource request. The method will close the http.Response Body if it receives an error.

func (AssignmentsClient) ListNextResults

func (client AssignmentsClient) ListNextResults(lastResults AssignmentListResult) (result AssignmentListResult, err error)

ListNextResults retrieves the next set of results, if any.

func (AssignmentsClient) ListPreparer

func (client AssignmentsClient) ListPreparer(filter string) (*http.Request, error)

ListPreparer prepares the List request.

func (AssignmentsClient) ListResponder

func (client AssignmentsClient) ListResponder(resp *http.Response) (result AssignmentListResult, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (AssignmentsClient) ListSender

func (client AssignmentsClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

type Definition

type Definition struct {
	autorest.Response     `json:"-"`
	*DefinitionProperties `json:"properties,omitempty"`
	ID                    *string `json:"id,omitempty"`
	Name                  *string `json:"name,omitempty"`
}

Definition is the policy definition.

type DefinitionListResult

type DefinitionListResult struct {
	autorest.Response `json:"-"`
	Value             *[]Definition `json:"value,omitempty"`
	NextLink          *string       `json:"nextLink,omitempty"`
}

DefinitionListResult is list of policy definitions.

func (DefinitionListResult) DefinitionListResultPreparer

func (client DefinitionListResult) DefinitionListResultPreparer() (*http.Request, error)

DefinitionListResultPreparer prepares a request to retrieve the next set of results. It returns nil if no more results exist.

type DefinitionProperties

type DefinitionProperties struct {
	PolicyType  Type                    `json:"policyType,omitempty"`
	Mode        Mode                    `json:"mode,omitempty"`
	DisplayName *string                 `json:"displayName,omitempty"`
	Description *string                 `json:"description,omitempty"`
	PolicyRule  *map[string]interface{} `json:"policyRule,omitempty"`
	Metadata    *map[string]interface{} `json:"metadata,omitempty"`
	Parameters  *map[string]interface{} `json:"parameters,omitempty"`
}

DefinitionProperties is the policy definition properties.

type DefinitionsClient

type DefinitionsClient struct {
	ManagementClient
}

DefinitionsClient is the to manage and control access to your resources, you can define customized policies and assign them at a scope.

func NewDefinitionsClient

func NewDefinitionsClient(subscriptionID string) DefinitionsClient

NewDefinitionsClient creates an instance of the DefinitionsClient client.

func NewDefinitionsClientWithBaseURI

func NewDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) DefinitionsClient

NewDefinitionsClientWithBaseURI creates an instance of the DefinitionsClient client.

func (DefinitionsClient) CreateOrUpdate

func (client DefinitionsClient) CreateOrUpdate(policyDefinitionName string, parameters Definition) (result Definition, err error)

CreateOrUpdate creates or updates a policy definition.

policyDefinitionName is the name of the policy definition to create. parameters is the policy definition properties.

func (DefinitionsClient) CreateOrUpdatePreparer

func (client DefinitionsClient) CreateOrUpdatePreparer(policyDefinitionName string, parameters Definition) (*http.Request, error)

CreateOrUpdatePreparer prepares the CreateOrUpdate request.

func (DefinitionsClient) CreateOrUpdateResponder

func (client DefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result Definition, err error)

CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always closes the http.Response Body.

func (DefinitionsClient) CreateOrUpdateSender

func (client DefinitionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error)

CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the http.Response Body if it receives an error.

func (DefinitionsClient) Delete

func (client DefinitionsClient) Delete(policyDefinitionName string) (result autorest.Response, err error)

Delete deletes a policy definition.

policyDefinitionName is the name of the policy definition to delete.

func (DefinitionsClient) DeletePreparer

func (client DefinitionsClient) DeletePreparer(policyDefinitionName string) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (DefinitionsClient) DeleteResponder

func (client DefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error)

DeleteResponder handles the response to the Delete request. The method always closes the http.Response Body.

func (DefinitionsClient) DeleteSender

func (client DefinitionsClient) DeleteSender(req *http.Request) (*http.Response, error)

DeleteSender sends the Delete request. The method will close the http.Response Body if it receives an error.

func (DefinitionsClient) Get

func (client DefinitionsClient) Get(policyDefinitionName string) (result Definition, err error)

Get gets the policy definition.

policyDefinitionName is the name of the policy definition to get.

func (DefinitionsClient) GetPreparer

func (client DefinitionsClient) GetPreparer(policyDefinitionName string) (*http.Request, error)

GetPreparer prepares the Get request.

func (DefinitionsClient) GetResponder

func (client DefinitionsClient) GetResponder(resp *http.Response) (result Definition, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (DefinitionsClient) GetSender

func (client DefinitionsClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (DefinitionsClient) List

func (client DefinitionsClient) List(filter string) (result DefinitionListResult, err error)

List gets all the policy definitions for a subscription.

filter is the filter to apply on the operation.

func (DefinitionsClient) ListComplete

func (client DefinitionsClient) ListComplete(filter string, cancel <-chan struct{}) (<-chan Definition, <-chan error)

ListComplete gets all elements from the list without paging.

func (DefinitionsClient) ListNextResults

func (client DefinitionsClient) ListNextResults(lastResults DefinitionListResult) (result DefinitionListResult, err error)

ListNextResults retrieves the next set of results, if any.

func (DefinitionsClient) ListPreparer

func (client DefinitionsClient) ListPreparer(filter string) (*http.Request, error)

ListPreparer prepares the List request.

func (DefinitionsClient) ListResponder

func (client DefinitionsClient) ListResponder(resp *http.Response) (result DefinitionListResult, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (DefinitionsClient) ListSender

func (client DefinitionsClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

type ManagementClient

type ManagementClient struct {
	autorest.Client
	BaseURI        string
	SubscriptionID string
}

ManagementClient is the base client for Policy.

func New

func New(subscriptionID string) ManagementClient

New creates an instance of the ManagementClient client.

func NewWithBaseURI

func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient

NewWithBaseURI creates an instance of the ManagementClient client.

type Mode

type Mode string

Mode enumerates the values for mode.

const (
	// All specifies the all state for mode.
	All Mode = "All"
	// Indexed specifies the indexed state for mode.
	Indexed Mode = "Indexed"
	// NotSpecified specifies the not specified state for mode.
	NotSpecified Mode = "NotSpecified"
)

type Type

type Type string

Type enumerates the values for type.

const (
	// TypeBuiltIn specifies the type built in state for type.
	TypeBuiltIn Type = "BuiltIn"
	// TypeCustom specifies the type custom state for type.
	TypeCustom Type = "Custom"
	// TypeNotSpecified specifies the type not specified state for type.
	TypeNotSpecified Type = "NotSpecified"
)

Jump to

Keyboard shortcuts

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