resources

package
v0.20240731.1170959 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/resources/2015-11-01/resources Documentation

The resources SDK allows for interaction with the Azure Resource Manager Service resources (API Version 2015-11-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/resources/2015-11-01/resources"

Client Initialization

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

Example Usage: ResourcesClient.CheckExistence

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

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.CreateOrUpdate

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

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


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

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

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

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

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.List

ctx := context.TODO()
id := commonids.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 := commonids.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 := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckExistenceOperationResponse

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

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type GenericResource

type GenericResource struct {
	Id         *string            `json:"id,omitempty"`
	Location   string             `json:"location"`
	Name       *string            `json:"name,omitempty"`
	Plan       *Plan              `json:"plan,omitempty"`
	Properties *interface{}       `json:"properties,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"`
	Location          string             `json:"location"`
	Name              *string            `json:"name,omitempty"`
	Plan              *Plan              `json:"plan,omitempty"`
	Properties        *interface{}       `json:"properties,omitempty"`
	ProvisioningState *string            `json:"provisioningState,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
	Location          *string
	Name              *string
	Properties        *interface{}
	ProvisioningState *string
	Type              *string
}

func (GenericResourceExpandedOperationPredicate) Matches

type GetOperationResponse

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

type ListCompleteResult

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

type ListCustomPager added in v0.20240628.1153531

type ListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListCustomPager) NextPageLink() *odata.Link

type ListOperationOptions

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

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders

func (o ListOperationOptions) ToHeaders() *client.Headers

func (ListOperationOptions) ToOData

func (o ListOperationOptions) ToOData() *odata.Query

func (ListOperationOptions) ToQuery

type ListOperationResponse

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

type MoveResourcesOperationResponse

type MoveResourcesOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

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"`
}

type ResourcesClient

type ResourcesClient struct {
	Client *resourcemanager.Client
}

func NewResourcesClientWithBaseURI

func NewResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*ResourcesClient, error)

func (ResourcesClient) CheckExistence

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

CheckExistence ...

func (ResourcesClient) CreateOrUpdate

CreateOrUpdate ...

func (ResourcesClient) Delete

Delete ...

func (ResourcesClient) Get

Get ...

func (ResourcesClient) List

List ...

func (ResourcesClient) ListComplete

ListComplete retrieves all the results into a single object

func (ResourcesClient) ListCompleteMatchingPredicate

func (c ResourcesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions, predicate GenericResourceExpandedOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies 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) UpdateThenPoll

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

UpdateThenPoll performs Update then polls until it's completed

type ResourcesMoveInfo

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

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *GenericResource
}

Jump to

Keyboard shortcuts

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