resources

package
v0.20230106.1100451 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MPL-2.0 Imports: 13 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/resources/2020-10-01/resources Documentation

The resources SDK allows for interaction with the Azure Resource Manager Service resources (API Version 2020-10-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/resources/2020-10-01/resources"

Client Initialization

client := resources.NewResourcesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ResourcesClient.CheckExistence

ctx := context.TODO()
id := resources.NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceProviderNamespaceValue", "parentResourcePathValue", "resourceTypeValue", "resourceValue")

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

Example Usage: ResourcesClient.CheckExistenceById

ctx := context.TODO()
id := resources.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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

Example Usage: ResourcesClient.CreateOrUpdate

ctx := context.TODO()
id := resources.NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceProviderNamespaceValue", "parentResourcePathValue", "resourceTypeValue", "resourceValue")

payload := resources.GenericResource{
	// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: ResourcesClient.CreateOrUpdateById

ctx := context.TODO()
id := resources.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

payload := resources.GenericResource{
	// ...
}


if err := client.CreateOrUpdateByIdThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: ResourcesClient.Delete

ctx := context.TODO()
id := resources.NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceProviderNamespaceValue", "parentResourcePathValue", "resourceTypeValue", "resourceValue")

if err := client.DeleteThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: ResourcesClient.DeleteById

ctx := context.TODO()
id := resources.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

if err := client.DeleteByIdThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: ResourcesClient.Get

ctx := context.TODO()
id := resources.NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceProviderNamespaceValue", "parentResourcePathValue", "resourceTypeValue", "resourceValue")

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: ResourcesClient.GetById

ctx := context.TODO()
id := resources.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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

Example Usage: ResourcesClient.List

ctx := context.TODO()
id := resources.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

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

Example Usage: ResourcesClient.MoveResources

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

payload := resources.ResourcesMoveInfo{
	// ...
}


if err := client.MoveResourcesThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: ResourcesClient.Update

ctx := context.TODO()
id := resources.NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceProviderNamespaceValue", "parentResourcePathValue", "resourceTypeValue", "resourceValue")

payload := resources.GenericResource{
	// ...
}


if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: ResourcesClient.UpdateById

ctx := context.TODO()
id := resources.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

payload := resources.GenericResource{
	// ...
}


if err := client.UpdateByIdThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: ResourcesClient.ValidateMoveResources

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

payload := resources.ResourcesMoveInfo{
	// ...
}


if err := client.ValidateMoveResourcesThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateResourceID

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

ValidateResourceID checks that 'input' can be parsed as a Resource ID

Types

type CheckExistenceByIdOperationResponse

type CheckExistenceByIdOperationResponse struct {
	HttpResponse *http.Response
}

type CheckExistenceOperationResponse

type CheckExistenceOperationResponse struct {
	HttpResponse *http.Response
}

type CreateOrUpdateByIdOperationResponse

type CreateOrUpdateByIdOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type DeleteByIdOperationResponse

type DeleteByIdOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type GenericResource

type GenericResource struct {
	Id         *string                            `json:"id,omitempty"`
	Identity   *identity.SystemAndUserAssignedMap `json:"identity,omitempty"`
	Kind       *string                            `json:"kind,omitempty"`
	Location   *string                            `json:"location,omitempty"`
	ManagedBy  *string                            `json:"managedBy,omitempty"`
	Name       *string                            `json:"name,omitempty"`
	Plan       *Plan                              `json:"plan,omitempty"`
	Properties *interface{}                       `json:"properties,omitempty"`
	Sku        *Sku                               `json:"sku,omitempty"`
	Tags       *map[string]string                 `json:"tags,omitempty"`
	Type       *string                            `json:"type,omitempty"`
}

type GenericResourceExpanded

type GenericResourceExpanded struct {
	ChangedTime       *string                            `json:"changedTime,omitempty"`
	CreatedTime       *string                            `json:"createdTime,omitempty"`
	Id                *string                            `json:"id,omitempty"`
	Identity          *identity.SystemAndUserAssignedMap `json:"identity,omitempty"`
	Kind              *string                            `json:"kind,omitempty"`
	Location          *string                            `json:"location,omitempty"`
	ManagedBy         *string                            `json:"managedBy,omitempty"`
	Name              *string                            `json:"name,omitempty"`
	Plan              *Plan                              `json:"plan,omitempty"`
	Properties        *interface{}                       `json:"properties,omitempty"`
	ProvisioningState *string                            `json:"provisioningState,omitempty"`
	Sku               *Sku                               `json:"sku,omitempty"`
	Tags              *map[string]string                 `json:"tags,omitempty"`
	Type              *string                            `json:"type,omitempty"`
}

func (*GenericResourceExpanded) GetChangedTimeAsTime

func (o *GenericResourceExpanded) GetChangedTimeAsTime() (*time.Time, error)

func (*GenericResourceExpanded) GetCreatedTimeAsTime

func (o *GenericResourceExpanded) GetCreatedTimeAsTime() (*time.Time, error)

func (*GenericResourceExpanded) SetChangedTimeAsTime

func (o *GenericResourceExpanded) SetChangedTimeAsTime(input time.Time)

func (*GenericResourceExpanded) SetCreatedTimeAsTime

func (o *GenericResourceExpanded) SetCreatedTimeAsTime(input time.Time)

type GenericResourceExpandedOperationPredicate

type GenericResourceExpandedOperationPredicate struct {
	ChangedTime       *string
	CreatedTime       *string
	Id                *string
	Kind              *string
	Location          *string
	ManagedBy         *string
	Name              *string
	Properties        *interface{}
	ProvisioningState *string
	Type              *string
}

func (GenericResourceExpandedOperationPredicate) Matches

type GetByIdOperationResponse

type GetByIdOperationResponse struct {
	HttpResponse *http.Response
	Model        *GenericResource
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	Model        *GenericResource
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []GenericResourceExpanded
}

type ListOperationOptions

type ListOperationOptions struct {
	Expand *string
	Filter *string
	Top    *int64
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]GenericResourceExpanded
	// contains filtered or unexported fields
}

func (ListOperationResponse) HasMore

func (r ListOperationResponse) HasMore() bool

func (ListOperationResponse) LoadMore

func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error)

type MoveResourcesOperationResponse

type MoveResourcesOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type Plan

type Plan struct {
	Name          *string `json:"name,omitempty"`
	Product       *string `json:"product,omitempty"`
	PromotionCode *string `json:"promotionCode,omitempty"`
	Publisher     *string `json:"publisher,omitempty"`
	Version       *string `json:"version,omitempty"`
}

type ResourceId

type ResourceId struct {
	SubscriptionId            string
	ResourceGroupName         string
	ResourceProviderNamespace string
	ParentResourcePath        string
	ResourceType              string
	ResourceName              string
}

ResourceId is a struct representing the Resource ID for a Resource

func NewResourceID

func NewResourceID(subscriptionId string, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) ResourceId

NewResourceID returns a new ResourceId struct

func ParseResourceID

func ParseResourceID(input string) (*ResourceId, error)

ParseResourceID parses 'input' into a ResourceId

func ParseResourceIDInsensitively

func ParseResourceIDInsensitively(input string) (*ResourceId, error)

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

func (ResourceId) ID

func (id ResourceId) ID() string

ID returns the formatted Resource ID

func (ResourceId) Segments

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

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

func (ResourceId) String

func (id ResourceId) String() string

String returns a human-readable description of this Resource ID

type ResourcesClient

type ResourcesClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewResourcesClientWithBaseURI

func NewResourcesClientWithBaseURI(endpoint string) ResourcesClient

func (ResourcesClient) CheckExistence

func (c ResourcesClient) CheckExistence(ctx context.Context, id ResourceId) (result CheckExistenceOperationResponse, err error)

CheckExistence ...

func (ResourcesClient) CheckExistenceById

func (c ResourcesClient) CheckExistenceById(ctx context.Context, id commonids.ScopeId) (result CheckExistenceByIdOperationResponse, err error)

CheckExistenceById ...

func (ResourcesClient) CreateOrUpdate

func (c ResourcesClient) CreateOrUpdate(ctx context.Context, id ResourceId, input GenericResource) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (ResourcesClient) CreateOrUpdateById

func (c ResourcesClient) CreateOrUpdateById(ctx context.Context, id commonids.ScopeId, input GenericResource) (result CreateOrUpdateByIdOperationResponse, err error)

CreateOrUpdateById ...

func (ResourcesClient) CreateOrUpdateByIdThenPoll

func (c ResourcesClient) CreateOrUpdateByIdThenPoll(ctx context.Context, id commonids.ScopeId, input GenericResource) error

CreateOrUpdateByIdThenPoll performs CreateOrUpdateById then polls until it's completed

func (ResourcesClient) CreateOrUpdateThenPoll

func (c ResourcesClient) CreateOrUpdateThenPoll(ctx context.Context, id ResourceId, input GenericResource) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (ResourcesClient) Delete

func (c ResourcesClient) Delete(ctx context.Context, id ResourceId) (result DeleteOperationResponse, err error)

Delete ...

func (ResourcesClient) DeleteById

DeleteById ...

func (ResourcesClient) DeleteByIdThenPoll

func (c ResourcesClient) DeleteByIdThenPoll(ctx context.Context, id commonids.ScopeId) error

DeleteByIdThenPoll performs DeleteById then polls until it's completed

func (ResourcesClient) DeleteThenPoll

func (c ResourcesClient) DeleteThenPoll(ctx context.Context, id ResourceId) error

DeleteThenPoll performs Delete then polls until it's completed

func (ResourcesClient) Get

func (c ResourcesClient) Get(ctx context.Context, id ResourceId) (result GetOperationResponse, err error)

Get ...

func (ResourcesClient) GetById

GetById ...

func (ResourcesClient) List

List ...

func (ResourcesClient) ListComplete

ListComplete retrieves all of the results into a single object

func (ResourcesClient) ListCompleteMatchingPredicate

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (ResourcesClient) MoveResources

MoveResources ...

func (ResourcesClient) MoveResourcesThenPoll

func (c ResourcesClient) MoveResourcesThenPoll(ctx context.Context, id commonids.ResourceGroupId, input ResourcesMoveInfo) error

MoveResourcesThenPoll performs MoveResources then polls until it's completed

func (ResourcesClient) Update

Update ...

func (ResourcesClient) UpdateById

UpdateById ...

func (ResourcesClient) UpdateByIdThenPoll

func (c ResourcesClient) UpdateByIdThenPoll(ctx context.Context, id commonids.ScopeId, input GenericResource) error

UpdateByIdThenPoll performs UpdateById then polls until it's completed

func (ResourcesClient) UpdateThenPoll

func (c ResourcesClient) UpdateThenPoll(ctx context.Context, id ResourceId, input GenericResource) error

UpdateThenPoll performs Update then polls until it's completed

func (ResourcesClient) ValidateMoveResources

ValidateMoveResources ...

func (ResourcesClient) ValidateMoveResourcesThenPoll

func (c ResourcesClient) ValidateMoveResourcesThenPoll(ctx context.Context, id commonids.ResourceGroupId, input ResourcesMoveInfo) error

ValidateMoveResourcesThenPoll performs ValidateMoveResources then polls until it's completed

type ResourcesMoveInfo

type ResourcesMoveInfo struct {
	Resources           *[]string `json:"resources,omitempty"`
	TargetResourceGroup *string   `json:"targetResourceGroup,omitempty"`
}

type Sku

type Sku struct {
	Capacity *int64  `json:"capacity,omitempty"`
	Family   *string `json:"family,omitempty"`
	Model    *string `json:"model,omitempty"`
	Name     *string `json:"name,omitempty"`
	Size     *string `json:"size,omitempty"`
	Tier     *string `json:"tier,omitempty"`
}

type UpdateByIdOperationResponse

type UpdateByIdOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type ValidateMoveResourcesOperationResponse

type ValidateMoveResourcesOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

Jump to

Keyboard shortcuts

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