backuppolicies

package
v0.20240612.1122027 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2024-04-01/backuppolicies Documentation

The backuppolicies SDK allows for interaction with the Azure Resource Manager Service dataprotection (API Version 2024-04-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/dataprotection/2024-04-01/backuppolicies"

Client Initialization

client := backuppolicies.NewBackupPoliciesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: BackupPoliciesClient.CreateOrUpdate

ctx := context.TODO()
id := backuppolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultValue", "backupPolicyValue")

payload := backuppolicies.BaseBackupPolicyResource{
	// ...
}


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: BackupPoliciesClient.Delete

ctx := context.TODO()
id := backuppolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultValue", "backupPolicyValue")

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: BackupPoliciesClient.Get

ctx := context.TODO()
id := backuppolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultValue", "backupPolicyValue")

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
}

Example Usage: BackupPoliciesClient.List

ctx := context.TODO()
id := backuppolicies.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultValue")

// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForAbsoluteMarker

func PossibleValuesForAbsoluteMarker() []string

func PossibleValuesForDataStoreTypes

func PossibleValuesForDataStoreTypes() []string

func PossibleValuesForDayOfWeek

func PossibleValuesForDayOfWeek() []string

func PossibleValuesForMonth

func PossibleValuesForMonth() []string

func PossibleValuesForWeekNumber

func PossibleValuesForWeekNumber() []string

func ValidateBackupPolicyID

func ValidateBackupPolicyID(input interface{}, key string) (warnings []string, errors []error)

ValidateBackupPolicyID checks that 'input' can be parsed as a Backup Policy ID

func ValidateBackupVaultID

func ValidateBackupVaultID(input interface{}, key string) (warnings []string, errors []error)

ValidateBackupVaultID checks that 'input' can be parsed as a Backup Vault ID

Types

type AbsoluteDeleteOption

type AbsoluteDeleteOption struct {

	// Fields inherited from DeleteOption
	Duration string `json:"duration"`
}

func (AbsoluteDeleteOption) MarshalJSON

func (s AbsoluteDeleteOption) MarshalJSON() ([]byte, error)

type AbsoluteMarker

type AbsoluteMarker string
const (
	AbsoluteMarkerAllBackup    AbsoluteMarker = "AllBackup"
	AbsoluteMarkerFirstOfDay   AbsoluteMarker = "FirstOfDay"
	AbsoluteMarkerFirstOfMonth AbsoluteMarker = "FirstOfMonth"
	AbsoluteMarkerFirstOfWeek  AbsoluteMarker = "FirstOfWeek"
	AbsoluteMarkerFirstOfYear  AbsoluteMarker = "FirstOfYear"
)

func (*AbsoluteMarker) UnmarshalJSON

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

type AdhocBasedTaggingCriteria

type AdhocBasedTaggingCriteria struct {
	TagInfo *RetentionTag `json:"tagInfo,omitempty"`
}

type AdhocBasedTriggerContext

type AdhocBasedTriggerContext struct {
	TaggingCriteria AdhocBasedTaggingCriteria `json:"taggingCriteria"`
}

func (AdhocBasedTriggerContext) MarshalJSON

func (s AdhocBasedTriggerContext) MarshalJSON() ([]byte, error)

type AzureBackupParams

type AzureBackupParams struct {
	BackupType string `json:"backupType"`
}

func (AzureBackupParams) MarshalJSON

func (s AzureBackupParams) MarshalJSON() ([]byte, error)

type AzureBackupRule

type AzureBackupRule struct {
	BackupParameters BackupParameters  `json:"backupParameters"`
	DataStore        DataStoreInfoBase `json:"dataStore"`
	Trigger          TriggerContext    `json:"trigger"`

	// Fields inherited from BasePolicyRule
	Name string `json:"name"`
}

func (AzureBackupRule) MarshalJSON

func (s AzureBackupRule) MarshalJSON() ([]byte, error)

func (*AzureBackupRule) UnmarshalJSON

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

type AzureRetentionRule

type AzureRetentionRule struct {
	IsDefault  *bool             `json:"isDefault,omitempty"`
	Lifecycles []SourceLifeCycle `json:"lifecycles"`

	// Fields inherited from BasePolicyRule
	Name string `json:"name"`
}

func (AzureRetentionRule) MarshalJSON

func (s AzureRetentionRule) MarshalJSON() ([]byte, error)

type BackupCriteria

type BackupCriteria interface {
}

type BackupParameters

type BackupParameters interface {
}

type BackupPoliciesClient

type BackupPoliciesClient struct {
	Client *resourcemanager.Client
}

func NewBackupPoliciesClientWithBaseURI

func NewBackupPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*BackupPoliciesClient, error)

func (BackupPoliciesClient) CreateOrUpdate

CreateOrUpdate ...

func (BackupPoliciesClient) Delete

Delete ...

func (BackupPoliciesClient) Get

Get ...

func (BackupPoliciesClient) List

List ...

func (BackupPoliciesClient) ListComplete

ListComplete retrieves all the results into a single object

func (BackupPoliciesClient) ListCompleteMatchingPredicate

func (c BackupPoliciesClient) ListCompleteMatchingPredicate(ctx context.Context, id BackupVaultId, predicate BaseBackupPolicyResourceOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type BackupPolicy

type BackupPolicy struct {
	PolicyRules []BasePolicyRule `json:"policyRules"`

	// Fields inherited from BaseBackupPolicy
	DatasourceTypes []string `json:"datasourceTypes"`
}

func (BackupPolicy) MarshalJSON

func (s BackupPolicy) MarshalJSON() ([]byte, error)

func (*BackupPolicy) UnmarshalJSON

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

type BackupPolicyId

type BackupPolicyId struct {
	SubscriptionId    string
	ResourceGroupName string
	BackupVaultName   string
	BackupPolicyName  string
}

BackupPolicyId is a struct representing the Resource ID for a Backup Policy

func NewBackupPolicyID

func NewBackupPolicyID(subscriptionId string, resourceGroupName string, backupVaultName string, backupPolicyName string) BackupPolicyId

NewBackupPolicyID returns a new BackupPolicyId struct

func ParseBackupPolicyID

func ParseBackupPolicyID(input string) (*BackupPolicyId, error)

ParseBackupPolicyID parses 'input' into a BackupPolicyId

func ParseBackupPolicyIDInsensitively

func ParseBackupPolicyIDInsensitively(input string) (*BackupPolicyId, error)

ParseBackupPolicyIDInsensitively parses 'input' case-insensitively into a BackupPolicyId note: this method should only be used for API response data and not user input

func (*BackupPolicyId) FromParseResult

func (id *BackupPolicyId) FromParseResult(input resourceids.ParseResult) error

func (BackupPolicyId) ID

func (id BackupPolicyId) ID() string

ID returns the formatted Backup Policy ID

func (BackupPolicyId) Segments

func (id BackupPolicyId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Backup Policy ID

func (BackupPolicyId) String

func (id BackupPolicyId) String() string

String returns a human-readable description of this Backup Policy ID

type BackupSchedule

type BackupSchedule struct {
	RepeatingTimeIntervals []string `json:"repeatingTimeIntervals"`
	TimeZone               *string  `json:"timeZone,omitempty"`
}

type BackupVaultId

type BackupVaultId struct {
	SubscriptionId    string
	ResourceGroupName string
	BackupVaultName   string
}

BackupVaultId is a struct representing the Resource ID for a Backup Vault

func NewBackupVaultID

func NewBackupVaultID(subscriptionId string, resourceGroupName string, backupVaultName string) BackupVaultId

NewBackupVaultID returns a new BackupVaultId struct

func ParseBackupVaultID

func ParseBackupVaultID(input string) (*BackupVaultId, error)

ParseBackupVaultID parses 'input' into a BackupVaultId

func ParseBackupVaultIDInsensitively

func ParseBackupVaultIDInsensitively(input string) (*BackupVaultId, error)

ParseBackupVaultIDInsensitively parses 'input' case-insensitively into a BackupVaultId note: this method should only be used for API response data and not user input

func (*BackupVaultId) FromParseResult

func (id *BackupVaultId) FromParseResult(input resourceids.ParseResult) error

func (BackupVaultId) ID

func (id BackupVaultId) ID() string

ID returns the formatted Backup Vault ID

func (BackupVaultId) Segments

func (id BackupVaultId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Backup Vault ID

func (BackupVaultId) String

func (id BackupVaultId) String() string

String returns a human-readable description of this Backup Vault ID

type BaseBackupPolicy

type BaseBackupPolicy interface {
}

type BaseBackupPolicyResource

type BaseBackupPolicyResource struct {
	Id         *string                `json:"id,omitempty"`
	Name       *string                `json:"name,omitempty"`
	Properties BaseBackupPolicy       `json:"properties"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

func (*BaseBackupPolicyResource) UnmarshalJSON

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

type BaseBackupPolicyResourceOperationPredicate

type BaseBackupPolicyResourceOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (BaseBackupPolicyResourceOperationPredicate) Matches

type BasePolicyRule

type BasePolicyRule interface {
}

type CopyOnExpiryOption

type CopyOnExpiryOption struct {
}

func (CopyOnExpiryOption) MarshalJSON

func (s CopyOnExpiryOption) MarshalJSON() ([]byte, error)

type CopyOption

type CopyOption interface {
}

type CreateOrUpdateOperationResponse

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

type CustomCopyOption

type CustomCopyOption struct {
	Duration *string `json:"duration,omitempty"`
}

func (CustomCopyOption) MarshalJSON

func (s CustomCopyOption) MarshalJSON() ([]byte, error)

type DataStoreInfoBase

type DataStoreInfoBase struct {
	DataStoreType DataStoreTypes `json:"dataStoreType"`
	ObjectType    string         `json:"objectType"`
}

type DataStoreTypes

type DataStoreTypes string
const (
	DataStoreTypesArchiveStore     DataStoreTypes = "ArchiveStore"
	DataStoreTypesOperationalStore DataStoreTypes = "OperationalStore"
	DataStoreTypesVaultStore       DataStoreTypes = "VaultStore"
)

func (*DataStoreTypes) UnmarshalJSON

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

type Day

type Day struct {
	Date   *int64 `json:"date,omitempty"`
	IsLast *bool  `json:"isLast,omitempty"`
}

type DayOfWeek

type DayOfWeek string
const (
	DayOfWeekFriday    DayOfWeek = "Friday"
	DayOfWeekMonday    DayOfWeek = "Monday"
	DayOfWeekSaturday  DayOfWeek = "Saturday"
	DayOfWeekSunday    DayOfWeek = "Sunday"
	DayOfWeekThursday  DayOfWeek = "Thursday"
	DayOfWeekTuesday   DayOfWeek = "Tuesday"
	DayOfWeekWednesday DayOfWeek = "Wednesday"
)

func (*DayOfWeek) UnmarshalJSON

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

type DeleteOperationResponse

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

type DeleteOption

type DeleteOption interface {
}

type GetOperationResponse

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

type ImmediateCopyOption

type ImmediateCopyOption struct {
}

func (ImmediateCopyOption) MarshalJSON

func (s ImmediateCopyOption) MarshalJSON() ([]byte, error)

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []BaseBackupPolicyResource
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]BaseBackupPolicyResource
}

type Month

type Month string
const (
	MonthApril     Month = "April"
	MonthAugust    Month = "August"
	MonthDecember  Month = "December"
	MonthFebruary  Month = "February"
	MonthJanuary   Month = "January"
	MonthJuly      Month = "July"
	MonthJune      Month = "June"
	MonthMarch     Month = "March"
	MonthMay       Month = "May"
	MonthNovember  Month = "November"
	MonthOctober   Month = "October"
	MonthSeptember Month = "September"
)

func (*Month) UnmarshalJSON

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

type RawBackupCriteriaImpl

type RawBackupCriteriaImpl struct {
	Type   string
	Values map[string]interface{}
}

RawBackupCriteriaImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RawBackupParametersImpl

type RawBackupParametersImpl struct {
	Type   string
	Values map[string]interface{}
}

RawBackupParametersImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RawBaseBackupPolicyImpl

type RawBaseBackupPolicyImpl struct {
	Type   string
	Values map[string]interface{}
}

RawBaseBackupPolicyImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RawBasePolicyRuleImpl

type RawBasePolicyRuleImpl struct {
	Type   string
	Values map[string]interface{}
}

RawBasePolicyRuleImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RawCopyOptionImpl

type RawCopyOptionImpl struct {
	Type   string
	Values map[string]interface{}
}

RawCopyOptionImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RawDeleteOptionImpl

type RawDeleteOptionImpl struct {
	Type   string
	Values map[string]interface{}
}

RawDeleteOptionImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RawTriggerContextImpl

type RawTriggerContextImpl struct {
	Type   string
	Values map[string]interface{}
}

RawTriggerContextImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RetentionTag

type RetentionTag struct {
	ETag    *string `json:"eTag,omitempty"`
	Id      *string `json:"id,omitempty"`
	TagName string  `json:"tagName"`
}

type ScheduleBasedBackupCriteria

type ScheduleBasedBackupCriteria struct {
	AbsoluteCriteria *[]AbsoluteMarker `json:"absoluteCriteria,omitempty"`
	DaysOfMonth      *[]Day            `json:"daysOfMonth,omitempty"`
	DaysOfTheWeek    *[]DayOfWeek      `json:"daysOfTheWeek,omitempty"`
	MonthsOfYear     *[]Month          `json:"monthsOfYear,omitempty"`
	ScheduleTimes    *[]string         `json:"scheduleTimes,omitempty"`
	WeeksOfTheMonth  *[]WeekNumber     `json:"weeksOfTheMonth,omitempty"`
}

func (ScheduleBasedBackupCriteria) MarshalJSON

func (s ScheduleBasedBackupCriteria) MarshalJSON() ([]byte, error)

type ScheduleBasedTriggerContext

type ScheduleBasedTriggerContext struct {
	Schedule        BackupSchedule    `json:"schedule"`
	TaggingCriteria []TaggingCriteria `json:"taggingCriteria"`
}

func (ScheduleBasedTriggerContext) MarshalJSON

func (s ScheduleBasedTriggerContext) MarshalJSON() ([]byte, error)

type SourceLifeCycle

type SourceLifeCycle struct {
	DeleteAfter                 DeleteOption         `json:"deleteAfter"`
	SourceDataStore             DataStoreInfoBase    `json:"sourceDataStore"`
	TargetDataStoreCopySettings *[]TargetCopySetting `json:"targetDataStoreCopySettings,omitempty"`
}

func (*SourceLifeCycle) UnmarshalJSON

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

type TaggingCriteria

type TaggingCriteria struct {
	Criteria        *[]BackupCriteria `json:"criteria,omitempty"`
	IsDefault       bool              `json:"isDefault"`
	TagInfo         RetentionTag      `json:"tagInfo"`
	TaggingPriority int64             `json:"taggingPriority"`
}

func (*TaggingCriteria) UnmarshalJSON

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

type TargetCopySetting

type TargetCopySetting struct {
	CopyAfter CopyOption        `json:"copyAfter"`
	DataStore DataStoreInfoBase `json:"dataStore"`
}

func (*TargetCopySetting) UnmarshalJSON

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

type TriggerContext

type TriggerContext interface {
}

type WeekNumber

type WeekNumber string
const (
	WeekNumberFirst  WeekNumber = "First"
	WeekNumberFourth WeekNumber = "Fourth"
	WeekNumberLast   WeekNumber = "Last"
	WeekNumberSecond WeekNumber = "Second"
	WeekNumberThird  WeekNumber = "Third"
)

func (*WeekNumber) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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