managementpolicies

package
v0.20231214.1160726 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/storage/2022-09-01/managementpolicies Documentation

The managementpolicies SDK allows for interaction with the Azure Resource Manager Service storage (API Version 2022-09-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/storage/2022-09-01/managementpolicies"

Client Initialization

client := managementpolicies.NewManagementPoliciesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ManagementPoliciesClient.CreateOrUpdate

ctx := context.TODO()
id := managementpolicies.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountValue")

payload := managementpolicies.ManagementPolicy{
	// ...
}


read, err := client.CreateOrUpdate(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ManagementPoliciesClient.Delete

ctx := context.TODO()
id := managementpolicies.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountValue")

read, err := client.Delete(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ManagementPoliciesClient.Get

ctx := context.TODO()
id := managementpolicies.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForRuleType

func PossibleValuesForRuleType() []string

Types

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ManagementPolicy
}

type DateAfterCreation

type DateAfterCreation struct {
	DaysAfterCreationGreaterThan       float64  `json:"daysAfterCreationGreaterThan"`
	DaysAfterLastTierChangeGreaterThan *float64 `json:"daysAfterLastTierChangeGreaterThan,omitempty"`
}

type DateAfterModification

type DateAfterModification struct {
	DaysAfterCreationGreaterThan       *float64 `json:"daysAfterCreationGreaterThan,omitempty"`
	DaysAfterLastAccessTimeGreaterThan *float64 `json:"daysAfterLastAccessTimeGreaterThan,omitempty"`
	DaysAfterLastTierChangeGreaterThan *float64 `json:"daysAfterLastTierChangeGreaterThan,omitempty"`
	DaysAfterModificationGreaterThan   *float64 `json:"daysAfterModificationGreaterThan,omitempty"`
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ManagementPolicy
}

type ManagementPoliciesClient

type ManagementPoliciesClient struct {
	Client *resourcemanager.Client
}

func NewManagementPoliciesClientWithBaseURI

func NewManagementPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*ManagementPoliciesClient, error)

func (ManagementPoliciesClient) CreateOrUpdate

CreateOrUpdate ...

func (ManagementPoliciesClient) Delete

Delete ...

func (ManagementPoliciesClient) Get

Get ...

type ManagementPolicy

type ManagementPolicy struct {
	Id         *string                     `json:"id,omitempty"`
	Name       *string                     `json:"name,omitempty"`
	Properties *ManagementPolicyProperties `json:"properties,omitempty"`
	Type       *string                     `json:"type,omitempty"`
}

type ManagementPolicyAction

type ManagementPolicyAction struct {
	BaseBlob *ManagementPolicyBaseBlob `json:"baseBlob,omitempty"`
	Snapshot *ManagementPolicySnapShot `json:"snapshot,omitempty"`
	Version  *ManagementPolicyVersion  `json:"version,omitempty"`
}

type ManagementPolicyBaseBlob

type ManagementPolicyBaseBlob struct {
	Delete                      *DateAfterModification `json:"delete,omitempty"`
	EnableAutoTierToHotFromCool *bool                  `json:"enableAutoTierToHotFromCool,omitempty"`
	TierToArchive               *DateAfterModification `json:"tierToArchive,omitempty"`
	TierToCold                  *DateAfterModification `json:"tierToCold,omitempty"`
	TierToCool                  *DateAfterModification `json:"tierToCool,omitempty"`
	TierToHot                   *DateAfterModification `json:"tierToHot,omitempty"`
}

type ManagementPolicyDefinition

type ManagementPolicyDefinition struct {
	Actions ManagementPolicyAction  `json:"actions"`
	Filters *ManagementPolicyFilter `json:"filters,omitempty"`
}

type ManagementPolicyFilter

type ManagementPolicyFilter struct {
	BlobIndexMatch *[]TagFilter `json:"blobIndexMatch,omitempty"`
	BlobTypes      []string     `json:"blobTypes"`
	PrefixMatch    *[]string    `json:"prefixMatch,omitempty"`
}

type ManagementPolicyProperties

type ManagementPolicyProperties struct {
	LastModifiedTime *string                `json:"lastModifiedTime,omitempty"`
	Policy           ManagementPolicySchema `json:"policy"`
}

func (*ManagementPolicyProperties) GetLastModifiedTimeAsTime

func (o *ManagementPolicyProperties) GetLastModifiedTimeAsTime() (*time.Time, error)

func (*ManagementPolicyProperties) SetLastModifiedTimeAsTime

func (o *ManagementPolicyProperties) SetLastModifiedTimeAsTime(input time.Time)

type ManagementPolicyRule

type ManagementPolicyRule struct {
	Definition ManagementPolicyDefinition `json:"definition"`
	Enabled    *bool                      `json:"enabled,omitempty"`
	Name       string                     `json:"name"`
	Type       RuleType                   `json:"type"`
}

type ManagementPolicySchema

type ManagementPolicySchema struct {
	Rules []ManagementPolicyRule `json:"rules"`
}

type ManagementPolicySnapShot

type ManagementPolicySnapShot struct {
	Delete        *DateAfterCreation `json:"delete,omitempty"`
	TierToArchive *DateAfterCreation `json:"tierToArchive,omitempty"`
	TierToCold    *DateAfterCreation `json:"tierToCold,omitempty"`
	TierToCool    *DateAfterCreation `json:"tierToCool,omitempty"`
	TierToHot     *DateAfterCreation `json:"tierToHot,omitempty"`
}

type ManagementPolicyVersion

type ManagementPolicyVersion struct {
	Delete        *DateAfterCreation `json:"delete,omitempty"`
	TierToArchive *DateAfterCreation `json:"tierToArchive,omitempty"`
	TierToCold    *DateAfterCreation `json:"tierToCold,omitempty"`
	TierToCool    *DateAfterCreation `json:"tierToCool,omitempty"`
	TierToHot     *DateAfterCreation `json:"tierToHot,omitempty"`
}

type RuleType

type RuleType string
const (
	RuleTypeLifecycle RuleType = "Lifecycle"
)

func (*RuleType) UnmarshalJSON added in v0.20231114.1115341

func (s *RuleType) UnmarshalJSON(bytes []byte) error

type TagFilter

type TagFilter struct {
	Name  string `json:"name"`
	Op    string `json:"op"`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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