resourcegroups

package
v0.20241111.1164443 Latest Latest
Warning

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

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

README

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

The resourcegroups SDK allows for interaction with Azure Resource Manager 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/resourcegroups"

Client Initialization

client := resourcegroups.NewResourceGroupsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ResourceGroupsClient.CheckExistence

ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-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: ResourceGroupsClient.CreateOrUpdate

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

payload := resourcegroups.ResourceGroup{
	// ...
}


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

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

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

Example Usage: ResourceGroupsClient.Get

ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-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: ResourceGroupsClient.List

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

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

Example Usage: ResourceGroupsClient.ListResources

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

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

Example Usage: ResourceGroupsClient.Patch

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

payload := resourcegroups.ResourceGroup{
	// ...
}


read, err := client.Patch(ctx, id, payload)
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

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        *ResourceGroup
}

type DeleteOperationResponse

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

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        *ResourceGroup
}

type ListCompleteResult

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

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 {
	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        *[]ResourceGroup
}

type ListResourcesCompleteResult

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

type ListResourcesCustomPager added in v0.20240628.1153531

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

type ListResourcesOperationOptions

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

func DefaultListResourcesOperationOptions

func DefaultListResourcesOperationOptions() ListResourcesOperationOptions

func (ListResourcesOperationOptions) ToHeaders

func (ListResourcesOperationOptions) ToOData

func (ListResourcesOperationOptions) ToQuery

type ListResourcesOperationResponse

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

type PatchOperationResponse

type PatchOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ResourceGroup
}

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 ResourceGroup

type ResourceGroup struct {
	Id         *string                  `json:"id,omitempty"`
	Location   string                   `json:"location"`
	Name       *string                  `json:"name,omitempty"`
	Properties *ResourceGroupProperties `json:"properties,omitempty"`
	Tags       *map[string]string       `json:"tags,omitempty"`
}

type ResourceGroupOperationPredicate

type ResourceGroupOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
}

func (ResourceGroupOperationPredicate) Matches

type ResourceGroupProperties

type ResourceGroupProperties struct {
	ProvisioningState *string `json:"provisioningState,omitempty"`
}

type ResourceGroupsClient

type ResourceGroupsClient struct {
	Client *resourcemanager.Client
}

func NewResourceGroupsClientWithBaseURI

func NewResourceGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*ResourceGroupsClient, error)

func (ResourceGroupsClient) CheckExistence

CheckExistence ...

func (ResourceGroupsClient) CreateOrUpdate

CreateOrUpdate ...

func (ResourceGroupsClient) Delete

Delete ...

func (ResourceGroupsClient) DeleteThenPoll

DeleteThenPoll performs Delete then polls until it's completed

func (ResourceGroupsClient) Get

Get ...

func (ResourceGroupsClient) List

List ...

func (ResourceGroupsClient) ListComplete

ListComplete retrieves all the results into a single object

func (ResourceGroupsClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ResourceGroupsClient) ListResources

ListResources ...

func (ResourceGroupsClient) ListResourcesComplete

ListResourcesComplete retrieves all the results into a single object

func (ResourceGroupsClient) ListResourcesCompleteMatchingPredicate

ListResourcesCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ResourceGroupsClient) Patch

Patch ...

Jump to

Keyboard shortcuts

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