licenses

package
v0.20240715.1100358 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/hybridcompute/2024-05-20-preview/licenses Documentation

The licenses SDK allows for interaction with the Azure Resource Manager Service hybridcompute (API Version 2024-05-20-preview).

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/hybridcompute/2024-05-20-preview/licenses"

Client Initialization

client := licenses.NewLicensesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: LicensesClient.CreateOrUpdate

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

payload := licenses.License{
	// ...
}


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

Example Usage: LicensesClient.Delete

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

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

Example Usage: LicensesClient.Get

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

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: LicensesClient.ListByResourceGroup

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

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

Example Usage: LicensesClient.ListBySubscription

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

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

Example Usage: LicensesClient.Update

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

payload := licenses.LicenseUpdate{
	// ...
}


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

Example Usage: LicensesClient.ValidateLicense

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

payload := licenses.License{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForLicenseCoreType

func PossibleValuesForLicenseCoreType() []string

func PossibleValuesForLicenseEdition

func PossibleValuesForLicenseEdition() []string

func PossibleValuesForLicenseState

func PossibleValuesForLicenseState() []string

func PossibleValuesForLicenseTarget

func PossibleValuesForLicenseTarget() []string

func PossibleValuesForLicenseType

func PossibleValuesForLicenseType() []string

func PossibleValuesForProgramYear

func PossibleValuesForProgramYear() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func ValidateLicenseID

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

ValidateLicenseID checks that 'input' can be parsed as a License ID

Types

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *License
}

type DeleteOperationResponse

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

type GetOperationResponse

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

type License

type License struct {
	Id         *string                `json:"id,omitempty"`
	Location   string                 `json:"location"`
	Name       *string                `json:"name,omitempty"`
	Properties *LicenseProperties     `json:"properties,omitempty"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Tags       *map[string]string     `json:"tags,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type LicenseCoreType

type LicenseCoreType string
const (
	LicenseCoreTypePCore LicenseCoreType = "pCore"
	LicenseCoreTypeVCore LicenseCoreType = "vCore"
)

func (*LicenseCoreType) UnmarshalJSON

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

type LicenseDetails

type LicenseDetails struct {
	AssignedLicenses     *int64                  `json:"assignedLicenses,omitempty"`
	Edition              *LicenseEdition         `json:"edition,omitempty"`
	ImmutableId          *string                 `json:"immutableId,omitempty"`
	Processors           *int64                  `json:"processors,omitempty"`
	State                *LicenseState           `json:"state,omitempty"`
	Target               *LicenseTarget          `json:"target,omitempty"`
	Type                 *LicenseCoreType        `json:"type,omitempty"`
	VolumeLicenseDetails *[]VolumeLicenseDetails `json:"volumeLicenseDetails,omitempty"`
}

type LicenseEdition

type LicenseEdition string
const (
	LicenseEditionDatacenter LicenseEdition = "Datacenter"
	LicenseEditionStandard   LicenseEdition = "Standard"
)

func (*LicenseEdition) UnmarshalJSON

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

type LicenseId

type LicenseId struct {
	SubscriptionId    string
	ResourceGroupName string
	LicenseName       string
}

LicenseId is a struct representing the Resource ID for a License

func NewLicenseID

func NewLicenseID(subscriptionId string, resourceGroupName string, licenseName string) LicenseId

NewLicenseID returns a new LicenseId struct

func ParseLicenseID

func ParseLicenseID(input string) (*LicenseId, error)

ParseLicenseID parses 'input' into a LicenseId

func ParseLicenseIDInsensitively

func ParseLicenseIDInsensitively(input string) (*LicenseId, error)

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

func (*LicenseId) FromParseResult

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

func (LicenseId) ID

func (id LicenseId) ID() string

ID returns the formatted License ID

func (LicenseId) Segments

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

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

func (LicenseId) String

func (id LicenseId) String() string

String returns a human-readable description of this License ID

type LicenseOperationPredicate

type LicenseOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (LicenseOperationPredicate) Matches

func (p LicenseOperationPredicate) Matches(input License) bool

type LicenseProperties

type LicenseProperties struct {
	LicenseDetails    *LicenseDetails    `json:"licenseDetails,omitempty"`
	LicenseType       *LicenseType       `json:"licenseType,omitempty"`
	ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"`
	TenantId          *string            `json:"tenantId,omitempty"`
}

type LicenseState

type LicenseState string
const (
	LicenseStateActivated   LicenseState = "Activated"
	LicenseStateDeactivated LicenseState = "Deactivated"
)

func (*LicenseState) UnmarshalJSON

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

type LicenseTarget

type LicenseTarget string
const (
	LicenseTargetWindowsServerTwoZeroOneTwo     LicenseTarget = "Windows Server 2012"
	LicenseTargetWindowsServerTwoZeroOneTwoRTwo LicenseTarget = "Windows Server 2012 R2"
)

func (*LicenseTarget) UnmarshalJSON

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

type LicenseType

type LicenseType string
const (
	LicenseTypeESU LicenseType = "ESU"
)

func (*LicenseType) UnmarshalJSON

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

type LicenseUpdate

type LicenseUpdate struct {
	Properties *LicenseUpdateProperties `json:"properties,omitempty"`
	Tags       *map[string]string       `json:"tags,omitempty"`
}

type LicenseUpdateProperties

type LicenseUpdateProperties struct {
	LicenseDetails *LicenseUpdatePropertiesLicenseDetails `json:"licenseDetails,omitempty"`
	LicenseType    *LicenseType                           `json:"licenseType,omitempty"`
}

type LicenseUpdatePropertiesLicenseDetails

type LicenseUpdatePropertiesLicenseDetails struct {
	Edition    *LicenseEdition  `json:"edition,omitempty"`
	Processors *int64           `json:"processors,omitempty"`
	State      *LicenseState    `json:"state,omitempty"`
	Target     *LicenseTarget   `json:"target,omitempty"`
	Type       *LicenseCoreType `json:"type,omitempty"`
}

type LicensesClient

type LicensesClient struct {
	Client *resourcemanager.Client
}

func NewLicensesClientWithBaseURI

func NewLicensesClientWithBaseURI(sdkApi sdkEnv.Api) (*LicensesClient, error)

func (LicensesClient) CreateOrUpdate

func (c LicensesClient) CreateOrUpdate(ctx context.Context, id LicenseId, input License) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (LicensesClient) CreateOrUpdateThenPoll

func (c LicensesClient) CreateOrUpdateThenPoll(ctx context.Context, id LicenseId, input License) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (LicensesClient) Delete

func (c LicensesClient) Delete(ctx context.Context, id LicenseId) (result DeleteOperationResponse, err error)

Delete ...

func (LicensesClient) DeleteThenPoll

func (c LicensesClient) DeleteThenPoll(ctx context.Context, id LicenseId) error

DeleteThenPoll performs Delete then polls until it's completed

func (LicensesClient) Get

func (c LicensesClient) Get(ctx context.Context, id LicenseId) (result GetOperationResponse, err error)

Get ...

func (LicensesClient) ListByResourceGroup

ListByResourceGroup ...

func (LicensesClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (LicensesClient) ListByResourceGroupCompleteMatchingPredicate

func (c LicensesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate LicenseOperationPredicate) (result ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (LicensesClient) ListBySubscription

ListBySubscription ...

func (LicensesClient) ListBySubscriptionComplete

ListBySubscriptionComplete retrieves all the results into a single object

func (LicensesClient) ListBySubscriptionCompleteMatchingPredicate

func (c LicensesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate LicenseOperationPredicate) (result ListBySubscriptionCompleteResult, err error)

ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (LicensesClient) Update

func (c LicensesClient) Update(ctx context.Context, id LicenseId, input LicenseUpdate) (result UpdateOperationResponse, err error)

Update ...

func (LicensesClient) UpdateThenPoll

func (c LicensesClient) UpdateThenPoll(ctx context.Context, id LicenseId, input LicenseUpdate) error

UpdateThenPoll performs Update then polls until it's completed

func (LicensesClient) ValidateLicense

func (c LicensesClient) ValidateLicense(ctx context.Context, id commonids.SubscriptionId, input License) (result ValidateLicenseOperationResponse, err error)

ValidateLicense ...

func (LicensesClient) ValidateLicenseThenPoll

func (c LicensesClient) ValidateLicenseThenPoll(ctx context.Context, id commonids.SubscriptionId, input License) error

ValidateLicenseThenPoll performs ValidateLicense then polls until it's completed

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []License
}

type ListByResourceGroupCustomPager

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

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]License
}

type ListBySubscriptionCompleteResult

type ListBySubscriptionCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []License
}

type ListBySubscriptionCustomPager

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

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]License
}

type ProgramYear

type ProgramYear string
const (
	ProgramYearYearOne   ProgramYear = "Year 1"
	ProgramYearYearThree ProgramYear = "Year 3"
	ProgramYearYearTwo   ProgramYear = "Year 2"
)

func (*ProgramYear) UnmarshalJSON

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

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateAccepted  ProvisioningState = "Accepted"
	ProvisioningStateCanceled  ProvisioningState = "Canceled"
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateDeleted   ProvisioningState = "Deleted"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

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

type UpdateOperationResponse

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

type ValidateLicenseOperationResponse

type ValidateLicenseOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *License
}

type VolumeLicenseDetails

type VolumeLicenseDetails struct {
	InvoiceId   *string      `json:"invoiceId,omitempty"`
	ProgramYear *ProgramYear `json:"programYear,omitempty"`
}

Jump to

Keyboard shortcuts

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