Documentation ¶
Index ¶
- type ClientFactory
- type ErrorDefinition
- type ErrorResponse
- type MultipleActivationKey
- type MultipleActivationKeyList
- type MultipleActivationKeyProperties
- type MultipleActivationKeyUpdate
- type MultipleActivationKeysClient
- func (client *MultipleActivationKeysClient) BeginCreate(ctx context.Context, resourceGroupName string, ...) (*runtime.Poller[MultipleActivationKeysClientCreateResponse], error)
- func (client *MultipleActivationKeysClient) Delete(ctx context.Context, resourceGroupName string, ...) (MultipleActivationKeysClientDeleteResponse, error)
- func (client *MultipleActivationKeysClient) Get(ctx context.Context, resourceGroupName string, ...) (MultipleActivationKeysClientGetResponse, error)
- func (client *MultipleActivationKeysClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[MultipleActivationKeysClientListByResourceGroupResponse]
- func (client *MultipleActivationKeysClient) NewListPager(options *MultipleActivationKeysClientListOptions) *runtime.Pager[MultipleActivationKeysClientListResponse]
- func (client *MultipleActivationKeysClient) Update(ctx context.Context, resourceGroupName string, ...) (MultipleActivationKeysClientUpdateResponse, error)
- type MultipleActivationKeysClientBeginCreateOptions
- type MultipleActivationKeysClientCreateResponse
- type MultipleActivationKeysClientDeleteOptions
- type MultipleActivationKeysClientDeleteResponse
- type MultipleActivationKeysClientGetOptions
- type MultipleActivationKeysClientGetResponse
- type MultipleActivationKeysClientListByResourceGroupOptions
- type MultipleActivationKeysClientListByResourceGroupResponse
- type MultipleActivationKeysClientListOptions
- type MultipleActivationKeysClientListResponse
- type MultipleActivationKeysClientUpdateOptions
- type MultipleActivationKeysClientUpdateResponse
- type Operation
- type OperationDisplay
- type OperationList
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type OsType
- type ProvisioningState
- type Resource
- type SupportType
- type TrackedResource
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientFactory ¶ added in v0.6.0
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶ added in v0.6.0
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewMultipleActivationKeysClient ¶ added in v0.6.0
func (c *ClientFactory) NewMultipleActivationKeysClient() *MultipleActivationKeysClient
NewMultipleActivationKeysClient creates a new instance of MultipleActivationKeysClient.
func (*ClientFactory) NewOperationsClient ¶ added in v0.6.0
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
type ErrorDefinition ¶
type ErrorDefinition struct { // READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code. Code *string // READ-ONLY; Internal error details. Details []*ErrorDefinition // READ-ONLY; Description of the error. Message *string }
ErrorDefinition - Error definition.
func (ErrorDefinition) MarshalJSON ¶
func (e ErrorDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorDefinition.
func (*ErrorDefinition) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDefinition.
type ErrorResponse ¶
type ErrorResponse struct { // The error details. Error *ErrorDefinition }
ErrorResponse - Error response.
func (ErrorResponse) MarshalJSON ¶ added in v0.6.0
func (e ErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponse.
func (*ErrorResponse) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.
type MultipleActivationKey ¶
type MultipleActivationKey struct { // REQUIRED; The geo-location where the resource lives Location *string // MAK key specific properties. Properties *MultipleActivationKeyProperties // Resource tags. Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
MultipleActivationKey - MAK key details.
func (MultipleActivationKey) MarshalJSON ¶
func (m MultipleActivationKey) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MultipleActivationKey.
func (*MultipleActivationKey) UnmarshalJSON ¶ added in v0.6.0
func (m *MultipleActivationKey) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MultipleActivationKey.
type MultipleActivationKeyList ¶
type MultipleActivationKeyList struct { // List of MAK keys. Value []*MultipleActivationKey // READ-ONLY; Link to the next page of resources. NextLink *string }
MultipleActivationKeyList - List of MAK keys.
func (MultipleActivationKeyList) MarshalJSON ¶
func (m MultipleActivationKeyList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MultipleActivationKeyList.
func (*MultipleActivationKeyList) UnmarshalJSON ¶ added in v0.6.0
func (m *MultipleActivationKeyList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MultipleActivationKeyList.
type MultipleActivationKeyProperties ¶
type MultipleActivationKeyProperties struct { // Agreement number under which the key is requested. AgreementNumber *string // Number of activations/servers using the MAK key. InstalledServerNumber *int32 // true if user has eligible on-premises Windows physical or virtual machines, and that the requested key will only be used // in their organization; false otherwise. IsEligible *bool // Type of OS for which the key is requested. OSType *OsType // Type of support SupportType *SupportType // READ-ONLY; End of support of security updates activated by the MAK key. ExpirationDate *time.Time // READ-ONLY; MAK 5x5 key. MultipleActivationKey *string // READ-ONLY ProvisioningState *ProvisioningState }
MultipleActivationKeyProperties - MAK key specific properties.
func (MultipleActivationKeyProperties) MarshalJSON ¶
func (m MultipleActivationKeyProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MultipleActivationKeyProperties.
func (*MultipleActivationKeyProperties) UnmarshalJSON ¶
func (m *MultipleActivationKeyProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MultipleActivationKeyProperties.
type MultipleActivationKeyUpdate ¶
MultipleActivationKeyUpdate - MAK key details.
func (MultipleActivationKeyUpdate) MarshalJSON ¶
func (m MultipleActivationKeyUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MultipleActivationKeyUpdate.
func (*MultipleActivationKeyUpdate) UnmarshalJSON ¶ added in v0.6.0
func (m *MultipleActivationKeyUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MultipleActivationKeyUpdate.
type MultipleActivationKeysClient ¶
type MultipleActivationKeysClient struct {
// contains filtered or unexported fields
}
MultipleActivationKeysClient contains the methods for the MultipleActivationKeys group. Don't use this type directly, use NewMultipleActivationKeysClient() instead.
func NewMultipleActivationKeysClient ¶
func NewMultipleActivationKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MultipleActivationKeysClient, error)
NewMultipleActivationKeysClient creates a new instance of MultipleActivationKeysClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*MultipleActivationKeysClient) BeginCreate ¶
func (client *MultipleActivationKeysClient) BeginCreate(ctx context.Context, resourceGroupName string, multipleActivationKeyName string, multipleActivationKey MultipleActivationKey, options *MultipleActivationKeysClientBeginCreateOptions) (*runtime.Poller[MultipleActivationKeysClientCreateResponse], error)
BeginCreate - Create a MAK key. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2019-09-16-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- multipleActivationKeyName - The name of the MAK key.
- multipleActivationKey - Details of the MAK key.
- options - MultipleActivationKeysClientBeginCreateOptions contains the optional parameters for the MultipleActivationKeysClient.BeginCreate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/windowsesu/resource-manager/Microsoft.WindowsESU/preview/2019-09-16-preview/examples/CreateMultipleActivationKey.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/windowsesu/armwindowsesu" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armwindowsesu.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewMultipleActivationKeysClient().BeginCreate(ctx, "testgr1", "server08-key-2019", armwindowsesu.MultipleActivationKey{ Location: to.Ptr("East US"), Properties: &armwindowsesu.MultipleActivationKeyProperties{ AgreementNumber: to.Ptr("1a2b45ag"), InstalledServerNumber: to.Ptr[int32](100), IsEligible: to.Ptr(true), OSType: to.Ptr(armwindowsesu.OsTypeWindowsServer2008), SupportType: to.Ptr(armwindowsesu.SupportTypeSupplementalServicing), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.MultipleActivationKey = armwindowsesu.MultipleActivationKey{ // Name: to.Ptr("server08-key-2019"), // Type: to.Ptr("Microsoft.WindowsESU/multipleActivationKeys"), // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testgr1/providers/Microsoft.WindowsESU/multipleActivationKeys/server08-key-2019"), // Location: to.Ptr("East US"), // Properties: &armwindowsesu.MultipleActivationKeyProperties{ // AgreementNumber: to.Ptr("1a2b45ag"), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-21T21:12:26.000Z"); return t}()), // InstalledServerNumber: to.Ptr[int32](100), // IsEligible: to.Ptr(true), // MultipleActivationKey: to.Ptr("aaaaa-bbbbb-ccccc-ddddd-eeeee"), // OSType: to.Ptr(armwindowsesu.OsTypeWindowsServer2008), // ProvisioningState: to.Ptr(armwindowsesu.ProvisioningStateSucceeded), // SupportType: to.Ptr(armwindowsesu.SupportTypeSupplementalServicing), // }, // } }
Output:
func (*MultipleActivationKeysClient) Delete ¶
func (client *MultipleActivationKeysClient) Delete(ctx context.Context, resourceGroupName string, multipleActivationKeyName string, options *MultipleActivationKeysClientDeleteOptions) (MultipleActivationKeysClientDeleteResponse, error)
Delete - Delete a MAK key. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2019-09-16-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- multipleActivationKeyName - The name of the MAK key.
- options - MultipleActivationKeysClientDeleteOptions contains the optional parameters for the MultipleActivationKeysClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/windowsesu/resource-manager/Microsoft.WindowsESU/preview/2019-09-16-preview/examples/DeleteMultipleActivationKey.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/windowsesu/armwindowsesu" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armwindowsesu.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewMultipleActivationKeysClient().Delete(ctx, "testgr1", "server08-key-2019", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*MultipleActivationKeysClient) Get ¶
func (client *MultipleActivationKeysClient) Get(ctx context.Context, resourceGroupName string, multipleActivationKeyName string, options *MultipleActivationKeysClientGetOptions) (MultipleActivationKeysClientGetResponse, error)
Get - Get a MAK key. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2019-09-16-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- multipleActivationKeyName - The name of the MAK key.
- options - MultipleActivationKeysClientGetOptions contains the optional parameters for the MultipleActivationKeysClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/windowsesu/resource-manager/Microsoft.WindowsESU/preview/2019-09-16-preview/examples/GetMultipleActivationKey.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/windowsesu/armwindowsesu" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armwindowsesu.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMultipleActivationKeysClient().Get(ctx, "testgr1", "server08-key-2019", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.MultipleActivationKey = armwindowsesu.MultipleActivationKey{ // Name: to.Ptr("server08-key-2019"), // Type: to.Ptr("Microsoft.WindowsESU/multipleActivationKeys"), // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testgr1/providers/Microsoft.WindowsESU/multipleActivationKeys/server08-key-2019"), // Location: to.Ptr("East US"), // Properties: &armwindowsesu.MultipleActivationKeyProperties{ // AgreementNumber: to.Ptr("1a2b45ag"), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-21T21:12:26.000Z"); return t}()), // InstalledServerNumber: to.Ptr[int32](100), // IsEligible: to.Ptr(true), // MultipleActivationKey: to.Ptr("aaaaa-bbbbb-ccccc-ddddd-eeeee"), // OSType: to.Ptr(armwindowsesu.OsTypeWindowsServer2008), // ProvisioningState: to.Ptr(armwindowsesu.ProvisioningStateSucceeded), // SupportType: to.Ptr(armwindowsesu.SupportTypeSupplementalServicing), // }, // } }
Output:
func (*MultipleActivationKeysClient) NewListByResourceGroupPager ¶ added in v0.4.0
func (client *MultipleActivationKeysClient) NewListByResourceGroupPager(resourceGroupName string, options *MultipleActivationKeysClientListByResourceGroupOptions) *runtime.Pager[MultipleActivationKeysClientListByResourceGroupResponse]
NewListByResourceGroupPager - List all Multiple Activation Keys (MAK) in a resource group.
Generated from API version 2019-09-16-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - MultipleActivationKeysClientListByResourceGroupOptions contains the optional parameters for the MultipleActivationKeysClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/windowsesu/resource-manager/Microsoft.WindowsESU/preview/2019-09-16-preview/examples/ListMultipleActivationKeysByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/windowsesu/armwindowsesu" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armwindowsesu.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewMultipleActivationKeysClient().NewListByResourceGroupPager("testrg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.MultipleActivationKeyList = armwindowsesu.MultipleActivationKeyList{ // Value: []*armwindowsesu.MultipleActivationKey{ // { // Name: to.Ptr("server08-key-2019"), // Type: to.Ptr("Microsoft.WindowsESU/multipleActivationKeys"), // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg1/providers/Microsoft.WindowsESU/multipleActivationKeys/server08-key-2019"), // Location: to.Ptr("East US"), // Properties: &armwindowsesu.MultipleActivationKeyProperties{ // AgreementNumber: to.Ptr("1a2b45ag"), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-21T21:12:26.000Z"); return t}()), // InstalledServerNumber: to.Ptr[int32](100), // IsEligible: to.Ptr(true), // MultipleActivationKey: to.Ptr("aaaaa-bbbbb-ccccc-ddddd-eeeee"), // OSType: to.Ptr(armwindowsesu.OsTypeWindowsServer2008), // ProvisioningState: to.Ptr(armwindowsesu.ProvisioningStateSucceeded), // SupportType: to.Ptr(armwindowsesu.SupportTypeSupplementalServicing), // }, // }, // { // Name: to.Ptr("server08r2-key-2019"), // Type: to.Ptr("Microsoft.WindowsESU/multipleActivationKeys"), // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg1/providers/Microsoft.WindowsESU/multipleActivationKeys/server08r2-key-2019"), // Location: to.Ptr("East US"), // Properties: &armwindowsesu.MultipleActivationKeyProperties{ // AgreementNumber: to.Ptr("1a2b45ag"), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T10:33:09.000Z"); return t}()), // InstalledServerNumber: to.Ptr[int32](100), // IsEligible: to.Ptr(true), // MultipleActivationKey: to.Ptr("aaaaa-bbbbb-ccccc-ddddd-eeeee"), // OSType: to.Ptr(armwindowsesu.OsTypeWindowsServer2008R2), // ProvisioningState: to.Ptr(armwindowsesu.ProvisioningStateSucceeded), // SupportType: to.Ptr(armwindowsesu.SupportTypeSupplementalServicing), // }, // }}, // } } }
Output:
func (*MultipleActivationKeysClient) NewListPager ¶ added in v0.4.0
func (client *MultipleActivationKeysClient) NewListPager(options *MultipleActivationKeysClientListOptions) *runtime.Pager[MultipleActivationKeysClientListResponse]
NewListPager - List all Multiple Activation Keys (MAK) created for a subscription.
Generated from API version 2019-09-16-preview
- options - MultipleActivationKeysClientListOptions contains the optional parameters for the MultipleActivationKeysClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/windowsesu/resource-manager/Microsoft.WindowsESU/preview/2019-09-16-preview/examples/ListMultipleActivationKeys.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/windowsesu/armwindowsesu" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armwindowsesu.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewMultipleActivationKeysClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.MultipleActivationKeyList = armwindowsesu.MultipleActivationKeyList{ // Value: []*armwindowsesu.MultipleActivationKey{ // { // Name: to.Ptr("server08-key-2019"), // Type: to.Ptr("Microsoft.WindowsESU/multipleActivationKeys"), // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg1/providers/Microsoft.WindowsESU/multipleActivationKeys/server08-key-2019"), // Location: to.Ptr("East US"), // Properties: &armwindowsesu.MultipleActivationKeyProperties{ // AgreementNumber: to.Ptr("1a2b45ag"), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-21T21:12:26.000Z"); return t}()), // InstalledServerNumber: to.Ptr[int32](100), // IsEligible: to.Ptr(true), // MultipleActivationKey: to.Ptr("aaaaa-bbbbb-ccccc-ddddd-eeeee"), // OSType: to.Ptr(armwindowsesu.OsTypeWindowsServer2008), // ProvisioningState: to.Ptr(armwindowsesu.ProvisioningStateSucceeded), // SupportType: to.Ptr(armwindowsesu.SupportTypeSupplementalServicing), // }, // }, // { // Name: to.Ptr("server08r2-key-2019"), // Type: to.Ptr("Microsoft.WindowsESU/multipleActivationKeys"), // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg1/providers/Microsoft.WindowsESU/multipleActivationKeys/server08r2-key-2019"), // Location: to.Ptr("East US"), // Properties: &armwindowsesu.MultipleActivationKeyProperties{ // AgreementNumber: to.Ptr("1a2b45ag"), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T10:33:09.000Z"); return t}()), // InstalledServerNumber: to.Ptr[int32](100), // IsEligible: to.Ptr(true), // MultipleActivationKey: to.Ptr("aaaaa-bbbbb-ccccc-ddddd-eeeee"), // OSType: to.Ptr(armwindowsesu.OsTypeWindowsServer2008R2), // ProvisioningState: to.Ptr(armwindowsesu.ProvisioningStateSucceeded), // SupportType: to.Ptr(armwindowsesu.SupportTypeSupplementalServicing), // }, // }}, // } } }
Output:
func (*MultipleActivationKeysClient) Update ¶
func (client *MultipleActivationKeysClient) Update(ctx context.Context, resourceGroupName string, multipleActivationKeyName string, multipleActivationKey MultipleActivationKeyUpdate, options *MultipleActivationKeysClientUpdateOptions) (MultipleActivationKeysClientUpdateResponse, error)
Update - Update a MAK key. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2019-09-16-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- multipleActivationKeyName - The name of the MAK key.
- multipleActivationKey - Details of the MAK key.
- options - MultipleActivationKeysClientUpdateOptions contains the optional parameters for the MultipleActivationKeysClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/windowsesu/resource-manager/Microsoft.WindowsESU/preview/2019-09-16-preview/examples/UpdateMultipleActivationKey.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/windowsesu/armwindowsesu" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armwindowsesu.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMultipleActivationKeysClient().Update(ctx, "testgr1", "server08-key-2019", armwindowsesu.MultipleActivationKeyUpdate{ Tags: map[string]*string{ "tag1": to.Ptr("value1"), "tag2": to.Ptr("value2"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.MultipleActivationKey = armwindowsesu.MultipleActivationKey{ // Name: to.Ptr("server08-key-2019"), // Type: to.Ptr("Microsoft.WindowsESU/multipleActivationKeys"), // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testgr1/providers/Microsoft.WindowsESU/multipleActivationKeys/server08-key-2019"), // Location: to.Ptr("East US"), // Tags: map[string]*string{ // "tag1": to.Ptr("value1"), // "tag2": to.Ptr("value2"), // }, // Properties: &armwindowsesu.MultipleActivationKeyProperties{ // AgreementNumber: to.Ptr("1a2b45ag"), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-21T21:12:26.000Z"); return t}()), // InstalledServerNumber: to.Ptr[int32](100), // IsEligible: to.Ptr(true), // MultipleActivationKey: to.Ptr("aaaaa-bbbbb-ccccc-ddddd-eeeee"), // OSType: to.Ptr(armwindowsesu.OsTypeWindowsServer2008), // ProvisioningState: to.Ptr(armwindowsesu.ProvisioningStateSucceeded), // SupportType: to.Ptr(armwindowsesu.SupportTypeSupplementalServicing), // }, // } }
Output:
type MultipleActivationKeysClientBeginCreateOptions ¶ added in v0.2.0
type MultipleActivationKeysClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
MultipleActivationKeysClientBeginCreateOptions contains the optional parameters for the MultipleActivationKeysClient.BeginCreate method.
type MultipleActivationKeysClientCreateResponse ¶ added in v0.2.0
type MultipleActivationKeysClientCreateResponse struct { // MAK key details. MultipleActivationKey }
MultipleActivationKeysClientCreateResponse contains the response from method MultipleActivationKeysClient.BeginCreate.
type MultipleActivationKeysClientDeleteOptions ¶ added in v0.2.0
type MultipleActivationKeysClientDeleteOptions struct { }
MultipleActivationKeysClientDeleteOptions contains the optional parameters for the MultipleActivationKeysClient.Delete method.
type MultipleActivationKeysClientDeleteResponse ¶ added in v0.2.0
type MultipleActivationKeysClientDeleteResponse struct { }
MultipleActivationKeysClientDeleteResponse contains the response from method MultipleActivationKeysClient.Delete.
type MultipleActivationKeysClientGetOptions ¶ added in v0.2.0
type MultipleActivationKeysClientGetOptions struct { }
MultipleActivationKeysClientGetOptions contains the optional parameters for the MultipleActivationKeysClient.Get method.
type MultipleActivationKeysClientGetResponse ¶ added in v0.2.0
type MultipleActivationKeysClientGetResponse struct { // MAK key details. MultipleActivationKey }
MultipleActivationKeysClientGetResponse contains the response from method MultipleActivationKeysClient.Get.
type MultipleActivationKeysClientListByResourceGroupOptions ¶ added in v0.2.0
type MultipleActivationKeysClientListByResourceGroupOptions struct { }
MultipleActivationKeysClientListByResourceGroupOptions contains the optional parameters for the MultipleActivationKeysClient.NewListByResourceGroupPager method.
type MultipleActivationKeysClientListByResourceGroupResponse ¶ added in v0.2.0
type MultipleActivationKeysClientListByResourceGroupResponse struct { // List of MAK keys. MultipleActivationKeyList }
MultipleActivationKeysClientListByResourceGroupResponse contains the response from method MultipleActivationKeysClient.NewListByResourceGroupPager.
type MultipleActivationKeysClientListOptions ¶ added in v0.2.0
type MultipleActivationKeysClientListOptions struct { }
MultipleActivationKeysClientListOptions contains the optional parameters for the MultipleActivationKeysClient.NewListPager method.
type MultipleActivationKeysClientListResponse ¶ added in v0.2.0
type MultipleActivationKeysClientListResponse struct { // List of MAK keys. MultipleActivationKeyList }
MultipleActivationKeysClientListResponse contains the response from method MultipleActivationKeysClient.NewListPager.
type MultipleActivationKeysClientUpdateOptions ¶ added in v0.2.0
type MultipleActivationKeysClientUpdateOptions struct { }
MultipleActivationKeysClientUpdateOptions contains the optional parameters for the MultipleActivationKeysClient.Update method.
type MultipleActivationKeysClientUpdateResponse ¶ added in v0.2.0
type MultipleActivationKeysClientUpdateResponse struct { // MAK key details. MultipleActivationKey }
MultipleActivationKeysClientUpdateResponse contains the response from method MultipleActivationKeysClient.Update.
type Operation ¶
type Operation struct { // Meta data about operation used for display in portal. Display *OperationDisplay // READ-ONLY; Name of the operation. Name *string }
Operation - REST API operation details.
func (Operation) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct { Description *string Operation *string Provider *string Resource *string }
OperationDisplay - Meta data about operation used for display in portal.
func (OperationDisplay) MarshalJSON ¶ added in v0.6.0
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationList ¶
type OperationList struct { // List of operations. Value []*Operation // READ-ONLY; Link to the next page of resources. NextLink *string }
OperationList - List of available REST API operations.
func (OperationList) MarshalJSON ¶
func (o OperationList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationList.
func (*OperationList) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationList.
type OperationsClient ¶
type OperationsClient struct {
// contains filtered or unexported fields
}
OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.
func NewOperationsClient ¶
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)
NewOperationsClient creates a new instance of OperationsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*OperationsClient) NewListPager ¶ added in v0.4.0
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - List all available Windows.ESU provider operations.
Generated from API version 2019-09-16-preview
- options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/windowsesu/resource-manager/Microsoft.WindowsESU/preview/2019-09-16-preview/examples/ListOperations.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/windowsesu/armwindowsesu" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armwindowsesu.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.OperationList = armwindowsesu.OperationList{ // Value: []*armwindowsesu.Operation{ // { // Name: to.Ptr("Microsoft.WindowsESU/multipleActivationKeys/Read"), // Display: &armwindowsesu.OperationDisplay{ // Description: to.Ptr("List MAK keys."), // Operation: to.Ptr("List MAK keys"), // Provider: to.Ptr("Microsoft Windows Extended Security Updates"), // Resource: to.Ptr("multipleActivationKey"), // }, // }}, // } } }
Output:
type OperationsClientListOptions ¶ added in v0.2.0
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
type OperationsClientListResponse ¶ added in v0.2.0
type OperationsClientListResponse struct { // List of available REST API operations. OperationList }
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type OsType ¶
type OsType string
OsType - Type of OS for which the key is requested.
func PossibleOsTypeValues ¶
func PossibleOsTypeValues() []OsType
PossibleOsTypeValues returns the possible values for the OsType const type.
type ProvisioningState ¶
type ProvisioningState string
const ( ProvisioningStateAccepted ProvisioningState = "Accepted" ProvisioningStateCanceled ProvisioningState = "Canceled" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateProvisioning ProvisioningState = "Provisioning" ProvisioningStateSucceeded ProvisioningState = "Succeeded" )
func PossibleProvisioningStateValues ¶
func PossibleProvisioningStateValues() []ProvisioningState
PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
type Resource ¶
type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
Resource - Common fields that are returned in the response for all Azure Resource Manager resources
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
type SupportType ¶
type SupportType string
SupportType - Type of support
const ( SupportTypePremiumAssurance SupportType = "PremiumAssurance" SupportTypeSupplementalServicing SupportType = "SupplementalServicing" )
func PossibleSupportTypeValues ¶
func PossibleSupportTypeValues() []SupportType
PossibleSupportTypeValues returns the possible values for the SupportType const type.
type TrackedResource ¶
type TrackedResource struct { // REQUIRED; The geo-location where the resource lives Location *string // Resource tags. Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
func (TrackedResource) MarshalJSON ¶
func (t TrackedResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TrackedResource.
func (*TrackedResource) UnmarshalJSON ¶ added in v0.6.0
func (t *TrackedResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.