armmaintenance

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 14 Imported by: 4

README

Azure Maintenance Module for Go

PkgGoDev

The armmaintenance module provides operations for working with Azure Maintenance.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Maintenance module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Maintenance. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Maintenance module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armmaintenance.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armmaintenance.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewApplyUpdatesClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Maintenance label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyUpdate

type ApplyUpdate struct {
	// Properties of the apply update
	Properties *ApplyUpdateProperties

	// READ-ONLY; Fully qualified identifier of the resource
	ID *string

	// READ-ONLY; Name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; Type of the resource
	Type *string
}

ApplyUpdate - Apply Update request

func (ApplyUpdate) MarshalJSON

func (a ApplyUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ApplyUpdate.

func (*ApplyUpdate) UnmarshalJSON added in v1.1.0

func (a *ApplyUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ApplyUpdate.

type ApplyUpdateForResourceGroupClient

type ApplyUpdateForResourceGroupClient struct {
	// contains filtered or unexported fields
}

ApplyUpdateForResourceGroupClient contains the methods for the ApplyUpdateForResourceGroup group. Don't use this type directly, use NewApplyUpdateForResourceGroupClient() instead.

func NewApplyUpdateForResourceGroupClient

func NewApplyUpdateForResourceGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplyUpdateForResourceGroupClient, error)

NewApplyUpdateForResourceGroupClient creates a new instance of ApplyUpdateForResourceGroupClient with the specified values.

  • subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ApplyUpdateForResourceGroupClient) NewListPager added in v0.4.0

NewListPager - Get Configuration records within a subscription and resource group

Generated from API version 2023-04-01

  • resourceGroupName - Resource Group Name
  • options - ApplyUpdateForResourceGroupClientListOptions contains the optional parameters for the ApplyUpdateForResourceGroupClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdatesResourceGroup_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewApplyUpdateForResourceGroupClient().NewListPager("examplerg", 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.ListApplyUpdate = armmaintenance.ListApplyUpdate{
		// 	Value: []*armmaintenance.ApplyUpdate{
		// 		{
		// 			Name: to.Ptr("e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
		// 			Type: to.Ptr("Microsoft.Maintenance/applyUpdates"),
		// 			ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/applyUpdates/e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
		// 			Properties: &armmaintenance.ApplyUpdateProperties{
		// 				ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1"),
		// 				Status: to.Ptr(armmaintenance.UpdateStatusCompleted),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ApplyUpdateForResourceGroupClientListOptions added in v0.2.0

type ApplyUpdateForResourceGroupClientListOptions struct {
}

ApplyUpdateForResourceGroupClientListOptions contains the optional parameters for the ApplyUpdateForResourceGroupClient.NewListPager method.

type ApplyUpdateForResourceGroupClientListResponse added in v0.2.0

type ApplyUpdateForResourceGroupClientListResponse struct {
	// Response for ApplyUpdate list
	ListApplyUpdate
}

ApplyUpdateForResourceGroupClientListResponse contains the response from method ApplyUpdateForResourceGroupClient.NewListPager.

type ApplyUpdateProperties

type ApplyUpdateProperties struct {
	// Last Update time
	LastUpdateTime *time.Time

	// The resourceId
	ResourceID *string

	// The status
	Status *UpdateStatus
}

ApplyUpdateProperties - Properties for apply update

func (ApplyUpdateProperties) MarshalJSON

func (a ApplyUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ApplyUpdateProperties.

func (*ApplyUpdateProperties) UnmarshalJSON

func (a *ApplyUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ApplyUpdateProperties.

type ApplyUpdatesClient

type ApplyUpdatesClient struct {
	// contains filtered or unexported fields
}

ApplyUpdatesClient contains the methods for the ApplyUpdates group. Don't use this type directly, use NewApplyUpdatesClient() instead.

func NewApplyUpdatesClient

func NewApplyUpdatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplyUpdatesClient, error)

NewApplyUpdatesClient creates a new instance of ApplyUpdatesClient with the specified values.

  • subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ApplyUpdatesClient) CreateOrUpdate

func (client *ApplyUpdatesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, options *ApplyUpdatesClientCreateOrUpdateOptions) (ApplyUpdatesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Apply maintenance updates to resource If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceType - Resource type
  • resourceName - Resource identifier
  • options - ApplyUpdatesClientCreateOrUpdateOptions contains the optional parameters for the ApplyUpdatesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewApplyUpdatesClient().CreateOrUpdate(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", 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.ApplyUpdate = armmaintenance.ApplyUpdate{
	// 	Name: to.Ptr("e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
	// 	Type: to.Ptr("Microsoft.Maintenance/applyUpdates"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/applyUpdates/e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
	// 	Properties: &armmaintenance.ApplyUpdateProperties{
	// 		ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1"),
	// 		Status: to.Ptr(armmaintenance.UpdateStatusPending),
	// 	},
	// }
}
Output:

func (*ApplyUpdatesClient) CreateOrUpdateParent

func (client *ApplyUpdatesClient) CreateOrUpdateParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, options *ApplyUpdatesClientCreateOrUpdateParentOptions) (ApplyUpdatesClientCreateOrUpdateParentResponse, error)

CreateOrUpdateParent - Apply maintenance updates to resource with parent If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceParentType - Resource parent type
  • resourceParentName - Resource parent identifier
  • resourceType - Resource type
  • resourceName - Resource identifier
  • options - ApplyUpdatesClientCreateOrUpdateParentOptions contains the optional parameters for the ApplyUpdatesClient.CreateOrUpdateParent method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_CreateOrUpdateParent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewApplyUpdatesClient().CreateOrUpdateParent(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdvm1", 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.ApplyUpdate = armmaintenance.ApplyUpdate{
	// 	Name: to.Ptr("e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
	// 	Type: to.Ptr("Microsoft.Maintenance/applyUpdates"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/virtualMachines/smdvm1/providers/Microsoft.Maintenance/applyUpdates/e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
	// 	Properties: &armmaintenance.ApplyUpdateProperties{
	// 		ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/virtualMachines/smdvm1"),
	// 		Status: to.Ptr(armmaintenance.UpdateStatusPending),
	// 	},
	// }
}
Output:

func (*ApplyUpdatesClient) Get

func (client *ApplyUpdatesClient) Get(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, applyUpdateName string, options *ApplyUpdatesClientGetOptions) (ApplyUpdatesClientGetResponse, error)

Get - Track maintenance updates to resource If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceType - Resource type
  • resourceName - Resource identifier
  • applyUpdateName - applyUpdate Id
  • options - ApplyUpdatesClientGetOptions contains the optional parameters for the ApplyUpdatesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewApplyUpdatesClient().Get(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "e9b9685d-78e4-44c4-a81c-64a14f9b87b6", 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.ApplyUpdate = armmaintenance.ApplyUpdate{
	// 	Name: to.Ptr("e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
	// 	Type: to.Ptr("Microsoft.Maintenance/applyUpdates"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/applyUpdates/e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
	// 	Properties: &armmaintenance.ApplyUpdateProperties{
	// 		ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1"),
	// 		Status: to.Ptr(armmaintenance.UpdateStatusCompleted),
	// 	},
	// }
}
Output:

func (*ApplyUpdatesClient) GetParent

func (client *ApplyUpdatesClient) GetParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, applyUpdateName string, options *ApplyUpdatesClientGetParentOptions) (ApplyUpdatesClientGetParentResponse, error)

GetParent - Track maintenance updates to resource with parent If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceParentType - Resource parent type
  • resourceParentName - Resource parent identifier
  • resourceType - Resource type
  • resourceName - Resource identifier
  • applyUpdateName - applyUpdate Id
  • options - ApplyUpdatesClientGetParentOptions contains the optional parameters for the ApplyUpdatesClient.GetParent method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_GetParent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewApplyUpdatesClient().GetParent(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdvm1", "e9b9685d-78e4-44c4-a81c-64a14f9b87b6", 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.ApplyUpdate = armmaintenance.ApplyUpdate{
	// 	Name: to.Ptr("e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
	// 	Type: to.Ptr("Microsoft.Maintenance/applyUpdates"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/virtualMachines/smdvm1/providers/Microsoft.Maintenance/applyUpdates/e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
	// 	Properties: &armmaintenance.ApplyUpdateProperties{
	// 		ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/virtualMachines/smdvm1"),
	// 		Status: to.Ptr(armmaintenance.UpdateStatusCompleted),
	// 	},
	// }
}
Output:

func (*ApplyUpdatesClient) NewListPager added in v0.4.0

NewListPager - Get Configuration records within a subscription

Generated from API version 2023-04-01

  • options - ApplyUpdatesClientListOptions contains the optional parameters for the ApplyUpdatesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ApplyUpdates_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewApplyUpdatesClient().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.ListApplyUpdate = armmaintenance.ListApplyUpdate{
		// 	Value: []*armmaintenance.ApplyUpdate{
		// 		{
		// 			Name: to.Ptr("e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
		// 			Type: to.Ptr("Microsoft.Maintenance/applyUpdates"),
		// 			ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/applyUpdates/e9b9685d-78e4-44c4-a81c-64a14f9b87b6"),
		// 			Properties: &armmaintenance.ApplyUpdateProperties{
		// 				ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1"),
		// 				Status: to.Ptr(armmaintenance.UpdateStatusCompleted),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ApplyUpdatesClientCreateOrUpdateOptions added in v0.2.0

type ApplyUpdatesClientCreateOrUpdateOptions struct {
}

ApplyUpdatesClientCreateOrUpdateOptions contains the optional parameters for the ApplyUpdatesClient.CreateOrUpdate method.

type ApplyUpdatesClientCreateOrUpdateParentOptions added in v0.2.0

type ApplyUpdatesClientCreateOrUpdateParentOptions struct {
}

ApplyUpdatesClientCreateOrUpdateParentOptions contains the optional parameters for the ApplyUpdatesClient.CreateOrUpdateParent method.

type ApplyUpdatesClientCreateOrUpdateParentResponse added in v0.2.0

type ApplyUpdatesClientCreateOrUpdateParentResponse struct {
	// Apply Update request
	ApplyUpdate
}

ApplyUpdatesClientCreateOrUpdateParentResponse contains the response from method ApplyUpdatesClient.CreateOrUpdateParent.

type ApplyUpdatesClientCreateOrUpdateResponse added in v0.2.0

type ApplyUpdatesClientCreateOrUpdateResponse struct {
	// Apply Update request
	ApplyUpdate
}

ApplyUpdatesClientCreateOrUpdateResponse contains the response from method ApplyUpdatesClient.CreateOrUpdate.

type ApplyUpdatesClientGetOptions added in v0.2.0

type ApplyUpdatesClientGetOptions struct {
}

ApplyUpdatesClientGetOptions contains the optional parameters for the ApplyUpdatesClient.Get method.

type ApplyUpdatesClientGetParentOptions added in v0.2.0

type ApplyUpdatesClientGetParentOptions struct {
}

ApplyUpdatesClientGetParentOptions contains the optional parameters for the ApplyUpdatesClient.GetParent method.

type ApplyUpdatesClientGetParentResponse added in v0.2.0

type ApplyUpdatesClientGetParentResponse struct {
	// Apply Update request
	ApplyUpdate
}

ApplyUpdatesClientGetParentResponse contains the response from method ApplyUpdatesClient.GetParent.

type ApplyUpdatesClientGetResponse added in v0.2.0

type ApplyUpdatesClientGetResponse struct {
	// Apply Update request
	ApplyUpdate
}

ApplyUpdatesClientGetResponse contains the response from method ApplyUpdatesClient.Get.

type ApplyUpdatesClientListOptions added in v0.2.0

type ApplyUpdatesClientListOptions struct {
}

ApplyUpdatesClientListOptions contains the optional parameters for the ApplyUpdatesClient.NewListPager method.

type ApplyUpdatesClientListResponse added in v0.2.0

type ApplyUpdatesClientListResponse struct {
	// Response for ApplyUpdate list
	ListApplyUpdate
}

ApplyUpdatesClientListResponse contains the response from method ApplyUpdatesClient.NewListPager.

type ClientFactory added in v1.1.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 v1.1.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 - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewApplyUpdateForResourceGroupClient added in v1.1.0

func (c *ClientFactory) NewApplyUpdateForResourceGroupClient() *ApplyUpdateForResourceGroupClient

NewApplyUpdateForResourceGroupClient creates a new instance of ApplyUpdateForResourceGroupClient.

func (*ClientFactory) NewApplyUpdatesClient added in v1.1.0

func (c *ClientFactory) NewApplyUpdatesClient() *ApplyUpdatesClient

NewApplyUpdatesClient creates a new instance of ApplyUpdatesClient.

func (*ClientFactory) NewConfigurationAssignmentsClient added in v1.1.0

func (c *ClientFactory) NewConfigurationAssignmentsClient() *ConfigurationAssignmentsClient

NewConfigurationAssignmentsClient creates a new instance of ConfigurationAssignmentsClient.

func (*ClientFactory) NewConfigurationAssignmentsForResourceGroupClient added in v1.2.0

func (c *ClientFactory) NewConfigurationAssignmentsForResourceGroupClient() *ConfigurationAssignmentsForResourceGroupClient

NewConfigurationAssignmentsForResourceGroupClient creates a new instance of ConfigurationAssignmentsForResourceGroupClient.

func (*ClientFactory) NewConfigurationAssignmentsForSubscriptionsClient added in v1.2.0

func (c *ClientFactory) NewConfigurationAssignmentsForSubscriptionsClient() *ConfigurationAssignmentsForSubscriptionsClient

NewConfigurationAssignmentsForSubscriptionsClient creates a new instance of ConfigurationAssignmentsForSubscriptionsClient.

func (*ClientFactory) NewConfigurationAssignmentsWithinSubscriptionClient added in v1.2.0

func (c *ClientFactory) NewConfigurationAssignmentsWithinSubscriptionClient() *ConfigurationAssignmentsWithinSubscriptionClient

NewConfigurationAssignmentsWithinSubscriptionClient creates a new instance of ConfigurationAssignmentsWithinSubscriptionClient.

func (*ClientFactory) NewConfigurationsClient added in v1.1.0

func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient

NewConfigurationsClient creates a new instance of ConfigurationsClient.

func (*ClientFactory) NewConfigurationsForResourceGroupClient added in v1.1.0

func (c *ClientFactory) NewConfigurationsForResourceGroupClient() *ConfigurationsForResourceGroupClient

NewConfigurationsForResourceGroupClient creates a new instance of ConfigurationsForResourceGroupClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPublicMaintenanceConfigurationsClient added in v1.1.0

func (c *ClientFactory) NewPublicMaintenanceConfigurationsClient() *PublicMaintenanceConfigurationsClient

NewPublicMaintenanceConfigurationsClient creates a new instance of PublicMaintenanceConfigurationsClient.

func (*ClientFactory) NewUpdatesClient added in v1.1.0

func (c *ClientFactory) NewUpdatesClient() *UpdatesClient

NewUpdatesClient creates a new instance of UpdatesClient.

type Configuration added in v0.2.0

type Configuration struct {
	// Gets or sets location of the resource
	Location *string

	// Gets or sets properties of the resource
	Properties *ConfigurationProperties

	// Gets or sets tags of the resource
	Tags map[string]*string

	// READ-ONLY; Fully qualified identifier of the resource
	ID *string

	// READ-ONLY; Name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; Type of the resource
	Type *string
}

Configuration - Maintenance configuration record type

func (Configuration) MarshalJSON added in v0.2.0

func (c Configuration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Configuration.

func (*Configuration) UnmarshalJSON added in v1.1.0

func (c *Configuration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Configuration.

type ConfigurationAssignment

type ConfigurationAssignment struct {
	// Location of the resource
	Location *string

	// Properties of the configuration assignment
	Properties *ConfigurationAssignmentProperties

	// READ-ONLY; Fully qualified identifier of the resource
	ID *string

	// READ-ONLY; Name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; Type of the resource
	Type *string
}

ConfigurationAssignment - Configuration Assignment

func (ConfigurationAssignment) MarshalJSON

func (c ConfigurationAssignment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ConfigurationAssignment.

func (*ConfigurationAssignment) UnmarshalJSON added in v1.1.0

func (c *ConfigurationAssignment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationAssignment.

type ConfigurationAssignmentFilterProperties added in v1.2.0

type ConfigurationAssignmentFilterProperties struct {
	// List of locations to scope the query to.
	Locations []*string

	// List of allowed operating systems.
	OSTypes []*string

	// List of allowed resource groups.
	ResourceGroups []*string

	// List of allowed resources.
	ResourceTypes []*string

	// Tag settings for the VM.
	TagSettings *TagSettingsProperties
}

ConfigurationAssignmentFilterProperties - Azure query for the update configuration.

func (ConfigurationAssignmentFilterProperties) MarshalJSON added in v1.2.0

func (c ConfigurationAssignmentFilterProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ConfigurationAssignmentFilterProperties.

func (*ConfigurationAssignmentFilterProperties) UnmarshalJSON added in v1.2.0

func (c *ConfigurationAssignmentFilterProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationAssignmentFilterProperties.

type ConfigurationAssignmentProperties

type ConfigurationAssignmentProperties struct {
	// Properties of the configuration assignment
	Filter *ConfigurationAssignmentFilterProperties

	// The maintenance configuration Id
	MaintenanceConfigurationID *string

	// The unique resourceId
	ResourceID *string
}

ConfigurationAssignmentProperties - Properties for configuration assignment

func (ConfigurationAssignmentProperties) MarshalJSON added in v1.1.0

func (c ConfigurationAssignmentProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ConfigurationAssignmentProperties.

func (*ConfigurationAssignmentProperties) UnmarshalJSON added in v1.1.0

func (c *ConfigurationAssignmentProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationAssignmentProperties.

type ConfigurationAssignmentsClient

type ConfigurationAssignmentsClient struct {
	// contains filtered or unexported fields
}

ConfigurationAssignmentsClient contains the methods for the ConfigurationAssignments group. Don't use this type directly, use NewConfigurationAssignmentsClient() instead.

func NewConfigurationAssignmentsClient

func NewConfigurationAssignmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationAssignmentsClient, error)

NewConfigurationAssignmentsClient creates a new instance of ConfigurationAssignmentsClient with the specified values.

  • subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ConfigurationAssignmentsClient) CreateOrUpdate

func (client *ConfigurationAssignmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string, configurationAssignment ConfigurationAssignment, options *ConfigurationAssignmentsClientCreateOrUpdateOptions) (ConfigurationAssignmentsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Register configuration for resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceType - Resource type
  • resourceName - Resource identifier
  • configurationAssignmentName - Configuration assignment name
  • configurationAssignment - The configurationAssignment
  • options - ConfigurationAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationAssignmentsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_CreateOrUpdate.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/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsClient().CreateOrUpdate(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "workervmConfiguration", armmaintenance.ConfigurationAssignment{
		Properties: &armmaintenance.ConfigurationAssignmentProperties{
			MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
		},
	}, 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// 	Properties: &armmaintenance.ConfigurationAssignmentProperties{
	// 		MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 		ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1"),
	// 	},
	// }
}
Output:

func (*ConfigurationAssignmentsClient) CreateOrUpdateParent

func (client *ConfigurationAssignmentsClient) CreateOrUpdateParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string, configurationAssignment ConfigurationAssignment, options *ConfigurationAssignmentsClientCreateOrUpdateParentOptions) (ConfigurationAssignmentsClientCreateOrUpdateParentResponse, error)

CreateOrUpdateParent - Register configuration for resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceParentType - Resource parent type
  • resourceParentName - Resource parent identifier
  • resourceType - Resource type
  • resourceName - Resource identifier
  • configurationAssignmentName - Configuration assignment name
  • configurationAssignment - The configurationAssignment
  • options - ConfigurationAssignmentsClientCreateOrUpdateParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.CreateOrUpdateParent method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_CreateOrUpdateParent.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/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsClient().CreateOrUpdateParent(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdvm1", "workervmPolicy", armmaintenance.ConfigurationAssignment{
		Properties: &armmaintenance.ConfigurationAssignmentProperties{
			MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1"),
		},
	}, 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmPolicy"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/virtualMachines/smdvm1/providers/Microsoft.Maintenance/configurationAssignments/workervmPolicy"),
	// 	Properties: &armmaintenance.ConfigurationAssignmentProperties{
	// 		MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1"),
	// 		ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/virtualMachines/smdvm1"),
	// 	},
	// }
}
Output:

func (*ConfigurationAssignmentsClient) Delete

func (client *ConfigurationAssignmentsClient) Delete(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientDeleteOptions) (ConfigurationAssignmentsClientDeleteResponse, error)

Delete - Unregister configuration for resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceType - Resource type
  • resourceName - Resource identifier
  • configurationAssignmentName - Unique configuration assignment name
  • options - ConfigurationAssignmentsClientDeleteOptions contains the optional parameters for the ConfigurationAssignmentsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsClient().Delete(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "workervmConfiguration", 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// }
}
Output:

func (*ConfigurationAssignmentsClient) DeleteParent

func (client *ConfigurationAssignmentsClient) DeleteParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientDeleteParentOptions) (ConfigurationAssignmentsClientDeleteParentResponse, error)

DeleteParent - Unregister configuration for resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceParentType - Resource parent type
  • resourceParentName - Resource parent identifier
  • resourceType - Resource type
  • resourceName - Resource identifier
  • configurationAssignmentName - Unique configuration assignment name
  • options - ConfigurationAssignmentsClientDeleteParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.DeleteParent method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_DeleteParent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsClient().DeleteParent(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdvm1", "workervmConfiguration", 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// }
}
Output:

func (*ConfigurationAssignmentsClient) Get

func (client *ConfigurationAssignmentsClient) Get(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientGetOptions) (ConfigurationAssignmentsClientGetResponse, error)

Get - Get configuration assignment for resource.. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceType - Resource type
  • resourceName - Resource identifier
  • configurationAssignmentName - Configuration assignment name
  • options - ConfigurationAssignmentsClientGetOptions contains the optional parameters for the ConfigurationAssignmentsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsClient().Get(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "workervmConfiguration", 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// 	Properties: &armmaintenance.ConfigurationAssignmentProperties{
	// 		MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 		ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1"),
	// 	},
	// }
}
Output:

func (*ConfigurationAssignmentsClient) GetParent

func (client *ConfigurationAssignmentsClient) GetParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientGetParentOptions) (ConfigurationAssignmentsClientGetParentResponse, error)

GetParent - Get configuration assignment for resource.. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceParentType - Resource parent type
  • resourceParentName - Resource parent identifier
  • resourceType - Resource type
  • resourceName - Resource identifier
  • configurationAssignmentName - Configuration assignment name
  • options - ConfigurationAssignmentsClientGetParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.GetParent method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_GetParent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsClient().GetParent(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdvm1", "workervmPolicy", 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmPolicy"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/virtualMachines/smdvm1/providers/Microsoft.Maintenance/configurationAssignments/workervmPolicy"),
	// 	Properties: &armmaintenance.ConfigurationAssignmentProperties{
	// 		MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1"),
	// 		ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/virtualMachines/smdvm1"),
	// 	},
	// }
}
Output:

func (*ConfigurationAssignmentsClient) NewListPager added in v0.4.0

func (client *ConfigurationAssignmentsClient) NewListPager(resourceGroupName string, providerName string, resourceType string, resourceName string, options *ConfigurationAssignmentsClientListOptions) *runtime.Pager[ConfigurationAssignmentsClientListResponse]

NewListPager - List configurationAssignments for resource.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceType - Resource type
  • resourceName - Resource identifier
  • options - ConfigurationAssignmentsClientListOptions contains the optional parameters for the ConfigurationAssignmentsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationAssignmentsClient().NewListPager("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", 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.ListConfigurationAssignmentsResult = armmaintenance.ListConfigurationAssignmentsResult{
		// 	Value: []*armmaintenance.ConfigurationAssignment{
		// 		{
		// 			Name: to.Ptr("workervmConfiguration"),
		// 			Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
		// 			ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
		// 			Properties: &armmaintenance.ConfigurationAssignmentProperties{
		// 				MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
		// 				ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ConfigurationAssignmentsClient) NewListParentPager added in v0.4.0

func (client *ConfigurationAssignmentsClient) NewListParentPager(resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, options *ConfigurationAssignmentsClientListParentOptions) *runtime.Pager[ConfigurationAssignmentsClientListParentResponse]

NewListParentPager - List configurationAssignments for resource.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceParentType - Resource parent type
  • resourceParentName - Resource parent identifier
  • resourceType - Resource type
  • resourceName - Resource identifier
  • options - ConfigurationAssignmentsClientListParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.NewListParentPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignments_ListParent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationAssignmentsClient().NewListParentPager("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdtestvm1", 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.ListConfigurationAssignmentsResult = armmaintenance.ListConfigurationAssignmentsResult{
		// 	Value: []*armmaintenance.ConfigurationAssignment{
		// 		{
		// 			Name: to.Ptr("workervmPolicy"),
		// 			Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
		// 			ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/virtualMachines/smdtestvm1/providers/Microsoft.Maintenance/configurationAssignments/workervmPolicy"),
		// 			Properties: &armmaintenance.ConfigurationAssignmentProperties{
		// 				MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1"),
		// 				ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/virtualMachines/smdtestvm1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ConfigurationAssignmentsClientCreateOrUpdateOptions added in v0.2.0

type ConfigurationAssignmentsClientCreateOrUpdateOptions struct {
}

ConfigurationAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationAssignmentsClient.CreateOrUpdate method.

type ConfigurationAssignmentsClientCreateOrUpdateParentOptions added in v0.2.0

type ConfigurationAssignmentsClientCreateOrUpdateParentOptions struct {
}

ConfigurationAssignmentsClientCreateOrUpdateParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.CreateOrUpdateParent method.

type ConfigurationAssignmentsClientCreateOrUpdateParentResponse added in v0.2.0

type ConfigurationAssignmentsClientCreateOrUpdateParentResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientCreateOrUpdateParentResponse contains the response from method ConfigurationAssignmentsClient.CreateOrUpdateParent.

type ConfigurationAssignmentsClientCreateOrUpdateResponse added in v0.2.0

type ConfigurationAssignmentsClientCreateOrUpdateResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientCreateOrUpdateResponse contains the response from method ConfigurationAssignmentsClient.CreateOrUpdate.

type ConfigurationAssignmentsClientDeleteOptions added in v0.2.0

type ConfigurationAssignmentsClientDeleteOptions struct {
}

ConfigurationAssignmentsClientDeleteOptions contains the optional parameters for the ConfigurationAssignmentsClient.Delete method.

type ConfigurationAssignmentsClientDeleteParentOptions added in v0.2.0

type ConfigurationAssignmentsClientDeleteParentOptions struct {
}

ConfigurationAssignmentsClientDeleteParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.DeleteParent method.

type ConfigurationAssignmentsClientDeleteParentResponse added in v0.2.0

type ConfigurationAssignmentsClientDeleteParentResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientDeleteParentResponse contains the response from method ConfigurationAssignmentsClient.DeleteParent.

type ConfigurationAssignmentsClientDeleteResponse added in v0.2.0

type ConfigurationAssignmentsClientDeleteResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientDeleteResponse contains the response from method ConfigurationAssignmentsClient.Delete.

type ConfigurationAssignmentsClientGetOptions added in v0.2.0

type ConfigurationAssignmentsClientGetOptions struct {
}

ConfigurationAssignmentsClientGetOptions contains the optional parameters for the ConfigurationAssignmentsClient.Get method.

type ConfigurationAssignmentsClientGetParentOptions added in v0.2.0

type ConfigurationAssignmentsClientGetParentOptions struct {
}

ConfigurationAssignmentsClientGetParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.GetParent method.

type ConfigurationAssignmentsClientGetParentResponse added in v0.2.0

type ConfigurationAssignmentsClientGetParentResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientGetParentResponse contains the response from method ConfigurationAssignmentsClient.GetParent.

type ConfigurationAssignmentsClientGetResponse added in v0.2.0

type ConfigurationAssignmentsClientGetResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientGetResponse contains the response from method ConfigurationAssignmentsClient.Get.

type ConfigurationAssignmentsClientListOptions added in v0.2.0

type ConfigurationAssignmentsClientListOptions struct {
}

ConfigurationAssignmentsClientListOptions contains the optional parameters for the ConfigurationAssignmentsClient.NewListPager method.

type ConfigurationAssignmentsClientListParentOptions added in v0.2.0

type ConfigurationAssignmentsClientListParentOptions struct {
}

ConfigurationAssignmentsClientListParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.NewListParentPager method.

type ConfigurationAssignmentsClientListParentResponse added in v0.2.0

type ConfigurationAssignmentsClientListParentResponse struct {
	// Response for ConfigurationAssignments list
	ListConfigurationAssignmentsResult
}

ConfigurationAssignmentsClientListParentResponse contains the response from method ConfigurationAssignmentsClient.NewListParentPager.

type ConfigurationAssignmentsClientListResponse added in v0.2.0

type ConfigurationAssignmentsClientListResponse struct {
	// Response for ConfigurationAssignments list
	ListConfigurationAssignmentsResult
}

ConfigurationAssignmentsClientListResponse contains the response from method ConfigurationAssignmentsClient.NewListPager.

type ConfigurationAssignmentsForResourceGroupClient added in v1.2.0

type ConfigurationAssignmentsForResourceGroupClient struct {
	// contains filtered or unexported fields
}

ConfigurationAssignmentsForResourceGroupClient contains the methods for the ConfigurationAssignmentsForResourceGroup group. Don't use this type directly, use NewConfigurationAssignmentsForResourceGroupClient() instead.

func NewConfigurationAssignmentsForResourceGroupClient added in v1.2.0

func NewConfigurationAssignmentsForResourceGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationAssignmentsForResourceGroupClient, error)

NewConfigurationAssignmentsForResourceGroupClient creates a new instance of ConfigurationAssignmentsForResourceGroupClient with the specified values.

  • subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ConfigurationAssignmentsForResourceGroupClient) CreateOrUpdate added in v1.2.0

CreateOrUpdate - Register configuration for resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • configurationAssignmentName - Configuration assignment name
  • configurationAssignment - The configurationAssignment
  • options - ConfigurationAssignmentsForResourceGroupClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationAssignmentsForResourceGroupClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForResourceGroup_CreateOrUpdate.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/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsForResourceGroupClient().CreateOrUpdate(ctx, "examplerg", "workervmConfiguration", armmaintenance.ConfigurationAssignment{
		Properties: &armmaintenance.ConfigurationAssignmentProperties{
			Filter: &armmaintenance.ConfigurationAssignmentFilterProperties{
				Locations: []*string{
					to.Ptr("Japan East"),
					to.Ptr("UK South")},
				ResourceTypes: []*string{
					to.Ptr("Microsoft.HybridCompute/machines"),
					to.Ptr("Microsoft.Compute/virtualMachines")},
				TagSettings: &armmaintenance.TagSettingsProperties{
					FilterOperator: to.Ptr(armmaintenance.TagOperatorsAny),
					Tags: map[string][]*string{
						"tag1": {
							to.Ptr("tag1Value1"),
							to.Ptr("tag1Value2"),
							to.Ptr("tag1Value3")},
						"tag2": {
							to.Ptr("tag2Value1"),
							to.Ptr("tag2Value2"),
							to.Ptr("tag2Value3")},
					},
				},
			},
			MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
		},
	}, 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// 	Properties: &armmaintenance.ConfigurationAssignmentProperties{
	// 		Filter: &armmaintenance.ConfigurationAssignmentFilterProperties{
	// 			Locations: []*string{
	// 				to.Ptr("Japan East"),
	// 				to.Ptr("UK South")},
	// 				OSTypes: []*string{
	// 					to.Ptr("Windows"),
	// 					to.Ptr("Linux")},
	// 					ResourceTypes: []*string{
	// 						to.Ptr("Microsoft.HybridCompute/machines"),
	// 						to.Ptr("Microsoft.Compute/virtualMachines")},
	// 						TagSettings: &armmaintenance.TagSettingsProperties{
	// 							FilterOperator: to.Ptr(armmaintenance.TagOperatorsAny),
	// 							Tags: map[string][]*string{
	// 								"tag1": []*string{
	// 									to.Ptr("tag1Value1"),
	// 									to.Ptr("tag1Value2"),
	// 									to.Ptr("tag1Value3")},
	// 									"tag2": []*string{
	// 										to.Ptr("tag2Value1"),
	// 										to.Ptr("tag2Value2"),
	// 										to.Ptr("tag2Value3")},
	// 									},
	// 								},
	// 							},
	// 							MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 							ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg"),
	// 						},
	// 					}
}
Output:

func (*ConfigurationAssignmentsForResourceGroupClient) Delete added in v1.2.0

Delete - Unregister configuration for resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • configurationAssignmentName - Unique configuration assignment name
  • options - ConfigurationAssignmentsForResourceGroupClientDeleteOptions contains the optional parameters for the ConfigurationAssignmentsForResourceGroupClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForResourceGroup_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsForResourceGroupClient().Delete(ctx, "examplerg", "workervmConfiguration", 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// }
}
Output:

func (*ConfigurationAssignmentsForResourceGroupClient) Get added in v1.2.0

Get - Get configuration assignment for resource.. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • configurationAssignmentName - Configuration assignment name
  • options - ConfigurationAssignmentsForResourceGroupClientGetOptions contains the optional parameters for the ConfigurationAssignmentsForResourceGroupClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForResourceGroup_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsForResourceGroupClient().Get(ctx, "examplerg", "workervmConfiguration", 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// 	Properties: &armmaintenance.ConfigurationAssignmentProperties{
	// 		Filter: &armmaintenance.ConfigurationAssignmentFilterProperties{
	// 			Locations: []*string{
	// 				to.Ptr("Japan East"),
	// 				to.Ptr("UK South")},
	// 				ResourceTypes: []*string{
	// 					to.Ptr("Microsoft.HybridCompute/machines"),
	// 					to.Ptr("Microsoft.Compute/virtualMachines")},
	// 					TagSettings: &armmaintenance.TagSettingsProperties{
	// 						FilterOperator: to.Ptr(armmaintenance.TagOperatorsAll),
	// 						Tags: map[string][]*string{
	// 							"tag1": []*string{
	// 								to.Ptr("tag1Value1"),
	// 								to.Ptr("tag1Value2"),
	// 								to.Ptr("tag1Value3")},
	// 								"tag2": []*string{
	// 									to.Ptr("tag2Value1"),
	// 									to.Ptr("tag2Value2"),
	// 									to.Ptr("tag2Value3")},
	// 								},
	// 							},
	// 						},
	// 						MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 						ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg"),
	// 					},
	// 				}
}
Output:

func (*ConfigurationAssignmentsForResourceGroupClient) Update added in v1.2.0

Update - Register configuration for resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • configurationAssignmentName - Configuration assignment name
  • configurationAssignment - The configurationAssignment
  • options - ConfigurationAssignmentsForResourceGroupClientUpdateOptions contains the optional parameters for the ConfigurationAssignmentsForResourceGroupClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForResourceGroup_UpdateForResource.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/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsForResourceGroupClient().Update(ctx, "examplerg", "workervmConfiguration", armmaintenance.ConfigurationAssignment{
		Properties: &armmaintenance.ConfigurationAssignmentProperties{
			Filter: &armmaintenance.ConfigurationAssignmentFilterProperties{
				Locations: []*string{
					to.Ptr("Japan East"),
					to.Ptr("UK South")},
				ResourceTypes: []*string{
					to.Ptr("Microsoft.HybridCompute/machines"),
					to.Ptr("Microsoft.Compute/virtualMachines")},
				TagSettings: &armmaintenance.TagSettingsProperties{
					FilterOperator: to.Ptr(armmaintenance.TagOperatorsAny),
					Tags: map[string][]*string{
						"tag1": {
							to.Ptr("tag1Value1"),
							to.Ptr("tag1Value2"),
							to.Ptr("tag1Value3")},
						"tag2": {
							to.Ptr("tag2Value1"),
							to.Ptr("tag2Value2"),
							to.Ptr("tag2Value3")},
					},
				},
			},
			MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
		},
	}, 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// 	Properties: &armmaintenance.ConfigurationAssignmentProperties{
	// 		Filter: &armmaintenance.ConfigurationAssignmentFilterProperties{
	// 			Locations: []*string{
	// 				to.Ptr("Japan East"),
	// 				to.Ptr("UK South")},
	// 				ResourceTypes: []*string{
	// 					to.Ptr("Microsoft.HybridCompute/machines"),
	// 					to.Ptr("Microsoft.Compute/virtualMachines")},
	// 					TagSettings: &armmaintenance.TagSettingsProperties{
	// 						FilterOperator: to.Ptr(armmaintenance.TagOperatorsAny),
	// 						Tags: map[string][]*string{
	// 							"tag1": []*string{
	// 								to.Ptr("tag1Value1"),
	// 								to.Ptr("tag1Value2"),
	// 								to.Ptr("tag1Value3")},
	// 								"tag2": []*string{
	// 									to.Ptr("tag2Value1"),
	// 									to.Ptr("tag2Value2"),
	// 									to.Ptr("tag2Value3")},
	// 								},
	// 							},
	// 						},
	// 						MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 						ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg"),
	// 					},
	// 				}
}
Output:

type ConfigurationAssignmentsForResourceGroupClientCreateOrUpdateOptions added in v1.2.0

type ConfigurationAssignmentsForResourceGroupClientCreateOrUpdateOptions struct {
}

ConfigurationAssignmentsForResourceGroupClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationAssignmentsForResourceGroupClient.CreateOrUpdate method.

type ConfigurationAssignmentsForResourceGroupClientCreateOrUpdateResponse added in v1.2.0

type ConfigurationAssignmentsForResourceGroupClientCreateOrUpdateResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForResourceGroupClientCreateOrUpdateResponse contains the response from method ConfigurationAssignmentsForResourceGroupClient.CreateOrUpdate.

type ConfigurationAssignmentsForResourceGroupClientDeleteOptions added in v1.2.0

type ConfigurationAssignmentsForResourceGroupClientDeleteOptions struct {
}

ConfigurationAssignmentsForResourceGroupClientDeleteOptions contains the optional parameters for the ConfigurationAssignmentsForResourceGroupClient.Delete method.

type ConfigurationAssignmentsForResourceGroupClientDeleteResponse added in v1.2.0

type ConfigurationAssignmentsForResourceGroupClientDeleteResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForResourceGroupClientDeleteResponse contains the response from method ConfigurationAssignmentsForResourceGroupClient.Delete.

type ConfigurationAssignmentsForResourceGroupClientGetOptions added in v1.2.0

type ConfigurationAssignmentsForResourceGroupClientGetOptions struct {
}

ConfigurationAssignmentsForResourceGroupClientGetOptions contains the optional parameters for the ConfigurationAssignmentsForResourceGroupClient.Get method.

type ConfigurationAssignmentsForResourceGroupClientGetResponse added in v1.2.0

type ConfigurationAssignmentsForResourceGroupClientGetResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForResourceGroupClientGetResponse contains the response from method ConfigurationAssignmentsForResourceGroupClient.Get.

type ConfigurationAssignmentsForResourceGroupClientUpdateOptions added in v1.2.0

type ConfigurationAssignmentsForResourceGroupClientUpdateOptions struct {
}

ConfigurationAssignmentsForResourceGroupClientUpdateOptions contains the optional parameters for the ConfigurationAssignmentsForResourceGroupClient.Update method.

type ConfigurationAssignmentsForResourceGroupClientUpdateResponse added in v1.2.0

type ConfigurationAssignmentsForResourceGroupClientUpdateResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForResourceGroupClientUpdateResponse contains the response from method ConfigurationAssignmentsForResourceGroupClient.Update.

type ConfigurationAssignmentsForSubscriptionsClient added in v1.2.0

type ConfigurationAssignmentsForSubscriptionsClient struct {
	// contains filtered or unexported fields
}

ConfigurationAssignmentsForSubscriptionsClient contains the methods for the ConfigurationAssignmentsForSubscriptions group. Don't use this type directly, use NewConfigurationAssignmentsForSubscriptionsClient() instead.

func NewConfigurationAssignmentsForSubscriptionsClient added in v1.2.0

func NewConfigurationAssignmentsForSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationAssignmentsForSubscriptionsClient, error)

NewConfigurationAssignmentsForSubscriptionsClient creates a new instance of ConfigurationAssignmentsForSubscriptionsClient with the specified values.

  • subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ConfigurationAssignmentsForSubscriptionsClient) CreateOrUpdate added in v1.2.0

CreateOrUpdate - Register configuration for resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • configurationAssignmentName - Configuration assignment name
  • configurationAssignment - The configurationAssignment
  • options - ConfigurationAssignmentsForSubscriptionsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationAssignmentsForSubscriptionsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForSubscriptions_CreateOrUpdate.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/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsForSubscriptionsClient().CreateOrUpdate(ctx, "workervmConfiguration", armmaintenance.ConfigurationAssignment{
		Properties: &armmaintenance.ConfigurationAssignmentProperties{
			Filter: &armmaintenance.ConfigurationAssignmentFilterProperties{
				Locations: []*string{
					to.Ptr("Japan East"),
					to.Ptr("UK South")},
				ResourceGroups: []*string{
					to.Ptr("RG1"),
					to.Ptr("RG2")},
				ResourceTypes: []*string{
					to.Ptr("Microsoft.HybridCompute/machines"),
					to.Ptr("Microsoft.Compute/virtualMachines")},
				TagSettings: &armmaintenance.TagSettingsProperties{
					FilterOperator: to.Ptr(armmaintenance.TagOperatorsAny),
					Tags: map[string][]*string{
						"tag1": {
							to.Ptr("tag1Value1"),
							to.Ptr("tag1Value2"),
							to.Ptr("tag1Value3")},
						"tag2": {
							to.Ptr("tag2Value1"),
							to.Ptr("tag2Value2"),
							to.Ptr("tag2Value3")},
					},
				},
			},
			MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
		},
	}, 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// 	Properties: &armmaintenance.ConfigurationAssignmentProperties{
	// 		Filter: &armmaintenance.ConfigurationAssignmentFilterProperties{
	// 			Locations: []*string{
	// 				to.Ptr("Japan East"),
	// 				to.Ptr("UK South")},
	// 				ResourceGroups: []*string{
	// 					to.Ptr("RG1"),
	// 					to.Ptr("RG2")},
	// 					ResourceTypes: []*string{
	// 						to.Ptr("Microsoft.HybridCompute/machines"),
	// 						to.Ptr("Microsoft.Compute/virtualMachines")},
	// 						TagSettings: &armmaintenance.TagSettingsProperties{
	// 							FilterOperator: to.Ptr(armmaintenance.TagOperatorsAny),
	// 							Tags: map[string][]*string{
	// 								"tag1": []*string{
	// 									to.Ptr("tag1Value1"),
	// 									to.Ptr("tag1Value2"),
	// 									to.Ptr("tag1Value3")},
	// 									"tag2": []*string{
	// 										to.Ptr("tag2Value1"),
	// 										to.Ptr("tag2Value2"),
	// 										to.Ptr("tag2Value3")},
	// 									},
	// 								},
	// 							},
	// 							MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 							ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4"),
	// 						},
	// 					}
}
Output:

func (*ConfigurationAssignmentsForSubscriptionsClient) Delete added in v1.2.0

Delete - Unregister configuration for resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • configurationAssignmentName - Unique configuration assignment name
  • options - ConfigurationAssignmentsForSubscriptionsClientDeleteOptions contains the optional parameters for the ConfigurationAssignmentsForSubscriptionsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForSubscriptions_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsForSubscriptionsClient().Delete(ctx, "workervmConfiguration", 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// }
}
Output:

func (*ConfigurationAssignmentsForSubscriptionsClient) Get added in v1.2.0

Get - Get configuration assignment for resource.. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • configurationAssignmentName - Configuration assignment name
  • options - ConfigurationAssignmentsForSubscriptionsClientGetOptions contains the optional parameters for the ConfigurationAssignmentsForSubscriptionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForSubscriptions_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsForSubscriptionsClient().Get(ctx, "workervmConfiguration", 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// 	Properties: &armmaintenance.ConfigurationAssignmentProperties{
	// 		Filter: &armmaintenance.ConfigurationAssignmentFilterProperties{
	// 			Locations: []*string{
	// 				to.Ptr("Japan East"),
	// 				to.Ptr("UK South")},
	// 				ResourceTypes: []*string{
	// 					to.Ptr("Microsoft.HybridCompute/machines"),
	// 					to.Ptr("Microsoft.Compute/virtualMachines")},
	// 					TagSettings: &armmaintenance.TagSettingsProperties{
	// 						FilterOperator: to.Ptr(armmaintenance.TagOperatorsAll),
	// 						Tags: map[string][]*string{
	// 							"tag1": []*string{
	// 								to.Ptr("tag1Value1"),
	// 								to.Ptr("tag1Value2"),
	// 								to.Ptr("tag1Value3")},
	// 								"tag2": []*string{
	// 									to.Ptr("tag2Value1"),
	// 									to.Ptr("tag2Value2"),
	// 									to.Ptr("tag2Value3")},
	// 								},
	// 							},
	// 						},
	// 						MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 						ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4"),
	// 					},
	// 				}
}
Output:

func (*ConfigurationAssignmentsForSubscriptionsClient) Update added in v1.2.0

Update - Register configuration for resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • configurationAssignmentName - Configuration assignment name
  • configurationAssignment - The configurationAssignment
  • options - ConfigurationAssignmentsForSubscriptionsClientUpdateOptions contains the optional parameters for the ConfigurationAssignmentsForSubscriptionsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsForSubscriptions_UpdateForResource.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/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationAssignmentsForSubscriptionsClient().Update(ctx, "workervmConfiguration", armmaintenance.ConfigurationAssignment{
		Properties: &armmaintenance.ConfigurationAssignmentProperties{
			Filter: &armmaintenance.ConfigurationAssignmentFilterProperties{
				Locations: []*string{
					to.Ptr("Japan East"),
					to.Ptr("UK South")},
				ResourceGroups: []*string{
					to.Ptr("RG1"),
					to.Ptr("RG2")},
				ResourceTypes: []*string{
					to.Ptr("Microsoft.HybridCompute/machines"),
					to.Ptr("Microsoft.Compute/virtualMachines")},
				TagSettings: &armmaintenance.TagSettingsProperties{
					FilterOperator: to.Ptr(armmaintenance.TagOperatorsAny),
					Tags: map[string][]*string{
						"tag1": {
							to.Ptr("tag1Value1"),
							to.Ptr("tag1Value2"),
							to.Ptr("tag1Value3")},
						"tag2": {
							to.Ptr("tag2Value1"),
							to.Ptr("tag2Value2"),
							to.Ptr("tag2Value3")},
					},
				},
			},
			MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
		},
	}, 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.ConfigurationAssignment = armmaintenance.ConfigurationAssignment{
	// 	Name: to.Ptr("workervmConfiguration"),
	// 	Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
	// 	Properties: &armmaintenance.ConfigurationAssignmentProperties{
	// 		Filter: &armmaintenance.ConfigurationAssignmentFilterProperties{
	// 			Locations: []*string{
	// 				to.Ptr("Japan East"),
	// 				to.Ptr("UK South")},
	// 				ResourceGroups: []*string{
	// 					to.Ptr("RG1"),
	// 					to.Ptr("RG2")},
	// 					ResourceTypes: []*string{
	// 						to.Ptr("Microsoft.HybridCompute/machines"),
	// 						to.Ptr("Microsoft.Compute/virtualMachines")},
	// 						TagSettings: &armmaintenance.TagSettingsProperties{
	// 							FilterOperator: to.Ptr(armmaintenance.TagOperatorsAny),
	// 							Tags: map[string][]*string{
	// 								"tag1": []*string{
	// 									to.Ptr("tag1Value1"),
	// 									to.Ptr("tag1Value2"),
	// 									to.Ptr("tag1Value3")},
	// 									"tag2": []*string{
	// 										to.Ptr("tag2Value1"),
	// 										to.Ptr("tag2Value2"),
	// 										to.Ptr("tag2Value3")},
	// 									},
	// 								},
	// 							},
	// 							MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 							ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4"),
	// 						},
	// 					}
}
Output:

type ConfigurationAssignmentsForSubscriptionsClientCreateOrUpdateOptions added in v1.2.0

type ConfigurationAssignmentsForSubscriptionsClientCreateOrUpdateOptions struct {
}

ConfigurationAssignmentsForSubscriptionsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationAssignmentsForSubscriptionsClient.CreateOrUpdate method.

type ConfigurationAssignmentsForSubscriptionsClientCreateOrUpdateResponse added in v1.2.0

type ConfigurationAssignmentsForSubscriptionsClientCreateOrUpdateResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForSubscriptionsClientCreateOrUpdateResponse contains the response from method ConfigurationAssignmentsForSubscriptionsClient.CreateOrUpdate.

type ConfigurationAssignmentsForSubscriptionsClientDeleteOptions added in v1.2.0

type ConfigurationAssignmentsForSubscriptionsClientDeleteOptions struct {
}

ConfigurationAssignmentsForSubscriptionsClientDeleteOptions contains the optional parameters for the ConfigurationAssignmentsForSubscriptionsClient.Delete method.

type ConfigurationAssignmentsForSubscriptionsClientDeleteResponse added in v1.2.0

type ConfigurationAssignmentsForSubscriptionsClientDeleteResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForSubscriptionsClientDeleteResponse contains the response from method ConfigurationAssignmentsForSubscriptionsClient.Delete.

type ConfigurationAssignmentsForSubscriptionsClientGetOptions added in v1.2.0

type ConfigurationAssignmentsForSubscriptionsClientGetOptions struct {
}

ConfigurationAssignmentsForSubscriptionsClientGetOptions contains the optional parameters for the ConfigurationAssignmentsForSubscriptionsClient.Get method.

type ConfigurationAssignmentsForSubscriptionsClientGetResponse added in v1.2.0

type ConfigurationAssignmentsForSubscriptionsClientGetResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForSubscriptionsClientGetResponse contains the response from method ConfigurationAssignmentsForSubscriptionsClient.Get.

type ConfigurationAssignmentsForSubscriptionsClientUpdateOptions added in v1.2.0

type ConfigurationAssignmentsForSubscriptionsClientUpdateOptions struct {
}

ConfigurationAssignmentsForSubscriptionsClientUpdateOptions contains the optional parameters for the ConfigurationAssignmentsForSubscriptionsClient.Update method.

type ConfigurationAssignmentsForSubscriptionsClientUpdateResponse added in v1.2.0

type ConfigurationAssignmentsForSubscriptionsClientUpdateResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForSubscriptionsClientUpdateResponse contains the response from method ConfigurationAssignmentsForSubscriptionsClient.Update.

type ConfigurationAssignmentsWithinSubscriptionClient

type ConfigurationAssignmentsWithinSubscriptionClient struct {
	// contains filtered or unexported fields
}

ConfigurationAssignmentsWithinSubscriptionClient contains the methods for the ConfigurationAssignmentsWithinSubscription group. Don't use this type directly, use NewConfigurationAssignmentsWithinSubscriptionClient() instead.

func NewConfigurationAssignmentsWithinSubscriptionClient

func NewConfigurationAssignmentsWithinSubscriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationAssignmentsWithinSubscriptionClient, error)

NewConfigurationAssignmentsWithinSubscriptionClient creates a new instance of ConfigurationAssignmentsWithinSubscriptionClient with the specified values.

  • subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ConfigurationAssignmentsWithinSubscriptionClient) NewListPager added in v0.4.0

NewListPager - Get configuration assignment within a subscription

Generated from API version 2023-04-01

  • options - ConfigurationAssignmentsWithinSubscriptionClientListOptions contains the optional parameters for the ConfigurationAssignmentsWithinSubscriptionClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/ConfigurationAssignmentsResultWithinSubscription_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationAssignmentsWithinSubscriptionClient().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.ListConfigurationAssignmentsResult = armmaintenance.ListConfigurationAssignmentsResult{
		// 	Value: []*armmaintenance.ConfigurationAssignment{
		// 		{
		// 			Name: to.Ptr("workervmConfiguration"),
		// 			Type: to.Ptr("Microsoft.Maintenance/configurationAssignments"),
		// 			ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/configurationAssignments/workervmConfiguration"),
		// 			Properties: &armmaintenance.ConfigurationAssignmentProperties{
		// 				MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
		// 				ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ConfigurationAssignmentsWithinSubscriptionClientListOptions added in v0.2.0

type ConfigurationAssignmentsWithinSubscriptionClientListOptions struct {
}

ConfigurationAssignmentsWithinSubscriptionClientListOptions contains the optional parameters for the ConfigurationAssignmentsWithinSubscriptionClient.NewListPager method.

type ConfigurationAssignmentsWithinSubscriptionClientListResponse added in v0.2.0

type ConfigurationAssignmentsWithinSubscriptionClientListResponse struct {
	// Response for ConfigurationAssignments list
	ListConfigurationAssignmentsResult
}

ConfigurationAssignmentsWithinSubscriptionClientListResponse contains the response from method ConfigurationAssignmentsWithinSubscriptionClient.NewListPager.

type ConfigurationProperties added in v0.2.0

type ConfigurationProperties struct {
	// Gets or sets extensionProperties of the maintenanceConfiguration
	ExtensionProperties map[string]*string

	// The input parameters to be passed to the patch run operation.
	InstallPatches *InputPatchConfiguration

	// Gets or sets maintenanceScope of the configuration
	MaintenanceScope *MaintenanceScope

	// Definition of a MaintenanceWindow
	MaintenanceWindow *Window

	// Gets or sets namespace of the resource
	Namespace *string

	// Gets or sets the visibility of the configuration. The default value is 'Custom'
	Visibility *Visibility
}

ConfigurationProperties - Properties for maintenance configuration

func (ConfigurationProperties) MarshalJSON added in v0.2.0

func (c ConfigurationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ConfigurationProperties.

func (*ConfigurationProperties) UnmarshalJSON added in v1.1.0

func (c *ConfigurationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProperties.

type ConfigurationsClient added in v0.2.0

type ConfigurationsClient struct {
	// contains filtered or unexported fields
}

ConfigurationsClient contains the methods for the MaintenanceConfigurations group. Don't use this type directly, use NewConfigurationsClient() instead.

func NewConfigurationsClient added in v0.2.0

func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationsClient, error)

NewConfigurationsClient creates a new instance of ConfigurationsClient with the specified values.

  • subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ConfigurationsClient) CreateOrUpdate added in v0.2.0

func (client *ConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, configuration Configuration, options *ConfigurationsClientCreateOrUpdateOptions) (ConfigurationsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or Update configuration record If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource Group Name
  • resourceName - Maintenance Configuration Name
  • configuration - The configuration
  • options - ConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_CreateOrUpdateForResource.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/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationsClient().CreateOrUpdate(ctx, "examplerg", "configuration1", armmaintenance.Configuration{
		Location: to.Ptr("westus2"),
		Properties: &armmaintenance.ConfigurationProperties{
			MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage),
			MaintenanceWindow: &armmaintenance.Window{
				Duration:           to.Ptr("05:00"),
				ExpirationDateTime: to.Ptr("9999-12-31 00:00"),
				RecurEvery:         to.Ptr("Day"),
				StartDateTime:      to.Ptr("2020-04-30 08:00"),
				TimeZone:           to.Ptr("Pacific Standard Time"),
			},
			Namespace:  to.Ptr("Microsoft.Maintenance"),
			Visibility: to.Ptr(armmaintenance.VisibilityCustom),
		},
	}, 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.Configuration = armmaintenance.Configuration{
	// 	Name: to.Ptr("configuration1"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 	Location: to.Ptr("westus2"),
	// 	Properties: &armmaintenance.ConfigurationProperties{
	// 		MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage),
	// 		MaintenanceWindow: &armmaintenance.Window{
	// 			Duration: to.Ptr("05:00"),
	// 			ExpirationDateTime: to.Ptr("9999-12-31 00:00"),
	// 			RecurEvery: to.Ptr("Day"),
	// 			StartDateTime: to.Ptr("2020-04-30 08:00"),
	// 			TimeZone: to.Ptr("Pacific Standard Time"),
	// 		},
	// 		Namespace: to.Ptr("Microsoft.Maintenance"),
	// 		Visibility: to.Ptr(armmaintenance.VisibilityCustom),
	// 	},
	// }
}
Output:

func (*ConfigurationsClient) Delete added in v0.2.0

func (client *ConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *ConfigurationsClientDeleteOptions) (ConfigurationsClientDeleteResponse, error)

Delete - Delete Configuration record If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource Group Name
  • resourceName - Maintenance Configuration Name
  • options - ConfigurationsClientDeleteOptions contains the optional parameters for the ConfigurationsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_DeleteForResource.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationsClient().Delete(ctx, "examplerg", "example1", 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.Configuration = armmaintenance.Configuration{
	// 	Name: to.Ptr("configuration1"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 	Location: to.Ptr("westus2"),
	// 	Properties: &armmaintenance.ConfigurationProperties{
	// 		Namespace: to.Ptr("Microsoft.Maintenance"),
	// 	},
	// }
}
Output:

func (*ConfigurationsClient) Get added in v0.2.0

func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ConfigurationsClientGetOptions) (ConfigurationsClientGetResponse, error)

Get - Get Configuration record If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource Group Name
  • resourceName - Maintenance Configuration Name
  • options - ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method.
Example (MaintenanceConfigurationsGetForResource)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationsClient().Get(ctx, "examplerg", "configuration1", 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.Configuration = armmaintenance.Configuration{
	// 	Name: to.Ptr("configuration1"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 	Location: to.Ptr("westus2"),
	// 	Properties: &armmaintenance.ConfigurationProperties{
	// 		MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage),
	// 		MaintenanceWindow: &armmaintenance.Window{
	// 			Duration: to.Ptr("05:00"),
	// 			ExpirationDateTime: to.Ptr("9999-12-31 00:00"),
	// 			RecurEvery: to.Ptr("5Days"),
	// 			StartDateTime: to.Ptr("2020-04-30 08:00"),
	// 			TimeZone: to.Ptr("Pacific Standard Time"),
	// 		},
	// 		Namespace: to.Ptr("Microsoft.Maintenance"),
	// 		Visibility: to.Ptr(armmaintenance.VisibilityCustom),
	// 	},
	// }
}
Output:

Example (MaintenanceConfigurationsGetForResourceGuestOsPatchLinux)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource_GuestOSPatchLinux.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationsClient().Get(ctx, "examplerg", "configuration1", 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.Configuration = armmaintenance.Configuration{
	// 	Name: to.Ptr("configuration1"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 	Location: to.Ptr("westus2"),
	// 	Properties: &armmaintenance.ConfigurationProperties{
	// 		InstallPatches: &armmaintenance.InputPatchConfiguration{
	// 			LinuxParameters: &armmaintenance.InputLinuxParameters{
	// 				ClassificationsToInclude: []*string{
	// 					to.Ptr("Critical")},
	// 					PackageNameMasksToExclude: []*string{
	// 						to.Ptr("apt"),
	// 						to.Ptr("http")},
	// 						PackageNameMasksToInclude: []*string{
	// 							to.Ptr("binutils"),
	// 							to.Ptr("bin")},
	// 						},
	// 						RebootSetting: to.Ptr(armmaintenance.RebootOptionsAlways),
	// 					},
	// 					MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeInGuestPatch),
	// 					MaintenanceWindow: &armmaintenance.Window{
	// 						Duration: to.Ptr("05:00"),
	// 						ExpirationDateTime: to.Ptr("9999-12-31 00:00"),
	// 						RecurEvery: to.Ptr("5Days"),
	// 						StartDateTime: to.Ptr("2020-04-30 08:00"),
	// 						TimeZone: to.Ptr("Pacific Standard Time"),
	// 					},
	// 					Namespace: to.Ptr("Microsoft.Maintenance"),
	// 					Visibility: to.Ptr(armmaintenance.VisibilityCustom),
	// 				},
	// 			}
}
Output:

Example (MaintenanceConfigurationsGetForResourceGuestOsPatchWindows)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_GetForResource_GuestOSPatchWindows.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationsClient().Get(ctx, "examplerg", "configuration1", 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.Configuration = armmaintenance.Configuration{
	// 	Name: to.Ptr("configuration1"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 	Location: to.Ptr("westus2"),
	// 	Properties: &armmaintenance.ConfigurationProperties{
	// 		InstallPatches: &armmaintenance.InputPatchConfiguration{
	// 			RebootSetting: to.Ptr(armmaintenance.RebootOptionsAlways),
	// 			WindowsParameters: &armmaintenance.InputWindowsParameters{
	// 				ClassificationsToInclude: []*string{
	// 					to.Ptr("Security")},
	// 					ExcludeKbsRequiringReboot: to.Ptr(false),
	// 					KbNumbersToExclude: []*string{
	// 						to.Ptr("KB234567")},
	// 						KbNumbersToInclude: []*string{
	// 							to.Ptr("KB123456")},
	// 						},
	// 					},
	// 					MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeInGuestPatch),
	// 					MaintenanceWindow: &armmaintenance.Window{
	// 						Duration: to.Ptr("05:00"),
	// 						ExpirationDateTime: to.Ptr("9999-12-31 00:00"),
	// 						RecurEvery: to.Ptr("5Days"),
	// 						StartDateTime: to.Ptr("2020-04-30 08:00"),
	// 						TimeZone: to.Ptr("Pacific Standard Time"),
	// 					},
	// 					Namespace: to.Ptr("Microsoft.Maintenance"),
	// 					Visibility: to.Ptr(armmaintenance.VisibilityCustom),
	// 				},
	// 			}
}
Output:

func (*ConfigurationsClient) NewListPager added in v0.4.0

NewListPager - Get Configuration records within a subscription

Generated from API version 2023-04-01

  • options - ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationsClient().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.ListMaintenanceConfigurationsResult = armmaintenance.ListMaintenanceConfigurationsResult{
		// 	Value: []*armmaintenance.Configuration{
		// 		{
		// 			Name: to.Ptr("configuration1"),
		// 			ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
		// 			Location: to.Ptr("westus2"),
		// 			Properties: &armmaintenance.ConfigurationProperties{
		// 				MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage),
		// 				MaintenanceWindow: &armmaintenance.Window{
		// 					Duration: to.Ptr("05:00"),
		// 					ExpirationDateTime: to.Ptr("9999-12-31 00:00"),
		// 					RecurEvery: to.Ptr("Week Saturday,Sunday"),
		// 					StartDateTime: to.Ptr("2020-04-30 08:00"),
		// 					TimeZone: to.Ptr("Pacific Standard Time"),
		// 				},
		// 				Namespace: to.Ptr("Microsoft.Maintenance"),
		// 				Visibility: to.Ptr(armmaintenance.VisibilityCustom),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ConfigurationsClient) Update added in v0.2.0

func (client *ConfigurationsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, configuration Configuration, options *ConfigurationsClientUpdateOptions) (ConfigurationsClientUpdateResponse, error)

Update - Patch configuration record If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceGroupName - Resource Group Name
  • resourceName - Maintenance Configuration Name
  • configuration - The configuration
  • options - ConfigurationsClientUpdateOptions contains the optional parameters for the ConfigurationsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurations_UpdateForResource.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/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationsClient().Update(ctx, "examplerg", "configuration1", armmaintenance.Configuration{
		Location: to.Ptr("westus2"),
		Properties: &armmaintenance.ConfigurationProperties{
			MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage),
			MaintenanceWindow: &armmaintenance.Window{
				Duration:           to.Ptr("05:00"),
				ExpirationDateTime: to.Ptr("9999-12-31 00:00"),
				RecurEvery:         to.Ptr("Month Third Sunday"),
				StartDateTime:      to.Ptr("2020-04-30 08:00"),
				TimeZone:           to.Ptr("Pacific Standard Time"),
			},
			Namespace:  to.Ptr("Microsoft.Maintenance"),
			Visibility: to.Ptr(armmaintenance.VisibilityCustom),
		},
	}, 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.Configuration = armmaintenance.Configuration{
	// 	Name: to.Ptr("configuration1"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
	// 	Location: to.Ptr("westus2"),
	// 	Properties: &armmaintenance.ConfigurationProperties{
	// 		MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage),
	// 		MaintenanceWindow: &armmaintenance.Window{
	// 			Duration: to.Ptr("05:00"),
	// 			ExpirationDateTime: to.Ptr("9999-12-31 00:00"),
	// 			RecurEvery: to.Ptr("Month Third Sunday"),
	// 			StartDateTime: to.Ptr("2020-04-30 08:00"),
	// 			TimeZone: to.Ptr("Pacific Standard Time"),
	// 		},
	// 		Namespace: to.Ptr("Microsoft.Maintenance"),
	// 		Visibility: to.Ptr(armmaintenance.VisibilityCustom),
	// 	},
	// }
}
Output:

type ConfigurationsClientCreateOrUpdateOptions added in v0.2.0

type ConfigurationsClientCreateOrUpdateOptions struct {
}

ConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.CreateOrUpdate method.

type ConfigurationsClientCreateOrUpdateResponse added in v0.2.0

type ConfigurationsClientCreateOrUpdateResponse struct {
	// Maintenance configuration record type
	Configuration
}

ConfigurationsClientCreateOrUpdateResponse contains the response from method ConfigurationsClient.CreateOrUpdate.

type ConfigurationsClientDeleteOptions added in v0.2.0

type ConfigurationsClientDeleteOptions struct {
}

ConfigurationsClientDeleteOptions contains the optional parameters for the ConfigurationsClient.Delete method.

type ConfigurationsClientDeleteResponse added in v0.2.0

type ConfigurationsClientDeleteResponse struct {
	// Maintenance configuration record type
	Configuration
}

ConfigurationsClientDeleteResponse contains the response from method ConfigurationsClient.Delete.

type ConfigurationsClientGetOptions added in v0.2.0

type ConfigurationsClientGetOptions struct {
}

ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method.

type ConfigurationsClientGetResponse added in v0.2.0

type ConfigurationsClientGetResponse struct {
	// Maintenance configuration record type
	Configuration
}

ConfigurationsClientGetResponse contains the response from method ConfigurationsClient.Get.

type ConfigurationsClientListOptions added in v0.2.0

type ConfigurationsClientListOptions struct {
}

ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.NewListPager method.

type ConfigurationsClientListResponse added in v0.2.0

type ConfigurationsClientListResponse struct {
	// Response for MaintenanceConfigurations list
	ListMaintenanceConfigurationsResult
}

ConfigurationsClientListResponse contains the response from method ConfigurationsClient.NewListPager.

type ConfigurationsClientUpdateOptions added in v0.2.0

type ConfigurationsClientUpdateOptions struct {
}

ConfigurationsClientUpdateOptions contains the optional parameters for the ConfigurationsClient.Update method.

type ConfigurationsClientUpdateResponse added in v0.2.0

type ConfigurationsClientUpdateResponse struct {
	// Maintenance configuration record type
	Configuration
}

ConfigurationsClientUpdateResponse contains the response from method ConfigurationsClient.Update.

type ConfigurationsForResourceGroupClient added in v0.2.0

type ConfigurationsForResourceGroupClient struct {
	// contains filtered or unexported fields
}

ConfigurationsForResourceGroupClient contains the methods for the MaintenanceConfigurationsForResourceGroup group. Don't use this type directly, use NewConfigurationsForResourceGroupClient() instead.

func NewConfigurationsForResourceGroupClient added in v0.2.0

func NewConfigurationsForResourceGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationsForResourceGroupClient, error)

NewConfigurationsForResourceGroupClient creates a new instance of ConfigurationsForResourceGroupClient with the specified values.

  • subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ConfigurationsForResourceGroupClient) NewListPager added in v0.4.0

NewListPager - Get Configuration records within a subscription and resource group

Generated from API version 2023-04-01

  • resourceGroupName - Resource Group Name
  • options - ConfigurationsForResourceGroupClientListOptions contains the optional parameters for the ConfigurationsForResourceGroupClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/MaintenanceConfigurationsResourceGroup_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationsForResourceGroupClient().NewListPager("examplerg", 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.ListMaintenanceConfigurationsResult = armmaintenance.ListMaintenanceConfigurationsResult{
		// 	Value: []*armmaintenance.Configuration{
		// 		{
		// 			Name: to.Ptr("configuration1"),
		// 			ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"),
		// 			Location: to.Ptr("westus2"),
		// 			Properties: &armmaintenance.ConfigurationProperties{
		// 				MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage),
		// 				MaintenanceWindow: &armmaintenance.Window{
		// 					Duration: to.Ptr("05:00"),
		// 					ExpirationDateTime: to.Ptr("9999-12-31 00:00"),
		// 					RecurEvery: to.Ptr("Week Saturday,Sunday"),
		// 					StartDateTime: to.Ptr("2020-04-30 08:00"),
		// 					TimeZone: to.Ptr("Pacific Standard Time"),
		// 				},
		// 				Namespace: to.Ptr("Microsoft.Maintenance"),
		// 				Visibility: to.Ptr(armmaintenance.VisibilityCustom),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ConfigurationsForResourceGroupClientListOptions added in v0.2.0

type ConfigurationsForResourceGroupClientListOptions struct {
}

ConfigurationsForResourceGroupClientListOptions contains the optional parameters for the ConfigurationsForResourceGroupClient.NewListPager method.

type ConfigurationsForResourceGroupClientListResponse added in v0.2.0

type ConfigurationsForResourceGroupClientListResponse struct {
	// Response for MaintenanceConfigurations list
	ListMaintenanceConfigurationsResult
}

ConfigurationsForResourceGroupClientListResponse contains the response from method ConfigurationsForResourceGroupClient.NewListPager.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type Error added in v0.2.0

type Error struct {
	// Details of the error
	Error *ErrorDetails
}

Error - An error response received from the Azure Maintenance service.

func (Error) MarshalJSON added in v1.1.0

func (e Error) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Error.

func (*Error) UnmarshalJSON added in v1.1.0

func (e *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Error.

type ErrorDetails

type ErrorDetails struct {
	// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
	Code *string

	// Human-readable representation of the error.
	Message *string
}

ErrorDetails - An error response details received from the Azure Maintenance service.

func (ErrorDetails) MarshalJSON added in v1.1.0

func (e ErrorDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorDetails.

func (*ErrorDetails) UnmarshalJSON added in v1.1.0

func (e *ErrorDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails.

type ImpactType

type ImpactType string

ImpactType - The impact type

const (
	// ImpactTypeFreeze - Pending updates can freeze network or disk io operation on resource.
	ImpactTypeFreeze ImpactType = "Freeze"
	// ImpactTypeNone - Pending updates has no impact on resource.
	ImpactTypeNone ImpactType = "None"
	// ImpactTypeRedeploy - Pending updates can redeploy resource.
	ImpactTypeRedeploy ImpactType = "Redeploy"
	// ImpactTypeRestart - Pending updates can cause resource to restart.
	ImpactTypeRestart ImpactType = "Restart"
)

func PossibleImpactTypeValues

func PossibleImpactTypeValues() []ImpactType

PossibleImpactTypeValues returns the possible values for the ImpactType const type.

type InputLinuxParameters

type InputLinuxParameters struct {
	// Classification category of patches to be patched
	ClassificationsToInclude []*string

	// Package names to be excluded for patching.
	PackageNameMasksToExclude []*string

	// Package names to be included for patching.
	PackageNameMasksToInclude []*string
}

InputLinuxParameters - Input properties for patching a Linux machine.

func (InputLinuxParameters) MarshalJSON

func (i InputLinuxParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InputLinuxParameters.

func (*InputLinuxParameters) UnmarshalJSON added in v1.2.0

func (i *InputLinuxParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InputLinuxParameters.

type InputPatchConfiguration

type InputPatchConfiguration struct {
	// Input parameters specific to patching Linux machine. For Windows machines, do not pass this property.
	LinuxParameters *InputLinuxParameters

	// Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after
	// the patch operation is completed.
	RebootSetting *RebootOptions

	// Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property.
	WindowsParameters *InputWindowsParameters
}

InputPatchConfiguration - Input configuration for a patch run

func (InputPatchConfiguration) MarshalJSON added in v1.2.0

func (i InputPatchConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InputPatchConfiguration.

func (*InputPatchConfiguration) UnmarshalJSON added in v1.2.0

func (i *InputPatchConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InputPatchConfiguration.

type InputWindowsParameters

type InputWindowsParameters struct {
	// Classification category of patches to be patched
	ClassificationsToInclude []*string

	// Exclude patches which need reboot
	ExcludeKbsRequiringReboot *bool

	// Windows KBID to be excluded for patching.
	KbNumbersToExclude []*string

	// Windows KBID to be included for patching.
	KbNumbersToInclude []*string
}

InputWindowsParameters - Input properties for patching a Windows machine.

func (InputWindowsParameters) MarshalJSON

func (i InputWindowsParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InputWindowsParameters.

func (*InputWindowsParameters) UnmarshalJSON added in v1.2.0

func (i *InputWindowsParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InputWindowsParameters.

type ListApplyUpdate

type ListApplyUpdate struct {
	// The list of apply updates
	Value []*ApplyUpdate
}

ListApplyUpdate - Response for ApplyUpdate list

func (ListApplyUpdate) MarshalJSON

func (l ListApplyUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListApplyUpdate.

func (*ListApplyUpdate) UnmarshalJSON added in v1.1.0

func (l *ListApplyUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListApplyUpdate.

type ListConfigurationAssignmentsResult

type ListConfigurationAssignmentsResult struct {
	// The list of configuration Assignments
	Value []*ConfigurationAssignment
}

ListConfigurationAssignmentsResult - Response for ConfigurationAssignments list

func (ListConfigurationAssignmentsResult) MarshalJSON

func (l ListConfigurationAssignmentsResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListConfigurationAssignmentsResult.

func (*ListConfigurationAssignmentsResult) UnmarshalJSON added in v1.1.0

func (l *ListConfigurationAssignmentsResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListConfigurationAssignmentsResult.

type ListMaintenanceConfigurationsResult

type ListMaintenanceConfigurationsResult struct {
	// The list of maintenance Configurations
	Value []*Configuration
}

ListMaintenanceConfigurationsResult - Response for MaintenanceConfigurations list

func (ListMaintenanceConfigurationsResult) MarshalJSON

func (l ListMaintenanceConfigurationsResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListMaintenanceConfigurationsResult.

func (*ListMaintenanceConfigurationsResult) UnmarshalJSON added in v1.1.0

func (l *ListMaintenanceConfigurationsResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListMaintenanceConfigurationsResult.

type ListUpdatesResult

type ListUpdatesResult struct {
	// The pending updates
	Value []*Update
}

ListUpdatesResult - Response for Updates list

func (ListUpdatesResult) MarshalJSON

func (l ListUpdatesResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListUpdatesResult.

func (*ListUpdatesResult) UnmarshalJSON added in v1.1.0

func (l *ListUpdatesResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListUpdatesResult.

type MaintenanceScope

type MaintenanceScope string

MaintenanceScope - Gets or sets maintenanceScope of the configuration

const (
	// MaintenanceScopeExtension - This maintenance scope controls extension installation on VM/VMSS
	MaintenanceScopeExtension MaintenanceScope = "Extension"
	// MaintenanceScopeHost - This maintenance scope controls installation of azure platform updates i.e. services on physical
	// nodes hosting customer VMs.
	MaintenanceScopeHost MaintenanceScope = "Host"
	// MaintenanceScopeInGuestPatch - This maintenance scope controls installation of windows and linux packages on VM/VMSS
	MaintenanceScopeInGuestPatch MaintenanceScope = "InGuestPatch"
	// MaintenanceScopeOSImage - This maintenance scope controls os image installation on VM/VMSS
	MaintenanceScopeOSImage MaintenanceScope = "OSImage"
	// MaintenanceScopeResource - This maintenance scope controls the default update maintenance of the Azure Resource
	MaintenanceScopeResource MaintenanceScope = "Resource"
	// MaintenanceScopeSQLDB - This maintenance scope controls installation of SQL server platform updates.
	MaintenanceScopeSQLDB MaintenanceScope = "SQLDB"
	// MaintenanceScopeSQLManagedInstance - This maintenance scope controls installation of SQL managed instance platform update.
	MaintenanceScopeSQLManagedInstance MaintenanceScope = "SQLManagedInstance"
)

func PossibleMaintenanceScopeValues

func PossibleMaintenanceScopeValues() []MaintenanceScope

PossibleMaintenanceScopeValues returns the possible values for the MaintenanceScope const type.

type Operation

type Operation struct {
	// Display name of the operation
	Display *OperationInfo

	// Indicates whether the operation is a data action
	IsDataAction *bool

	// Name of the operation
	Name *string

	// Origin of the operation
	Origin *string

	// Properties of the operation
	Properties any
}

Operation - Represents an operation returned by the GetOperations request

func (Operation) MarshalJSON added in v1.1.0

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.1.0

func (o *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationInfo

type OperationInfo struct {
	// Description of the operation
	Description *string

	// Name of the operation
	Operation *string

	// Name of the provider
	Provider *string

	// Name of the resource type
	Resource *string
}

OperationInfo - Information about an operation

func (OperationInfo) MarshalJSON added in v1.1.0

func (o OperationInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationInfo.

func (*OperationInfo) UnmarshalJSON added in v1.1.0

func (o *OperationInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationInfo.

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

NewListPager - List the available operations supported by the Microsoft.Maintenance resource provider

Generated from API version 2023-04-01

  • 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/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/Operations_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.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.OperationsListResult = armmaintenance.OperationsListResult{
		// 	Value: []*armmaintenance.Operation{
		// 	},
		// }
	}
}
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 {
	// Result of the List Operations operation
	OperationsListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type OperationsListResult

type OperationsListResult struct {
	// A collection of operations
	Value []*Operation
}

OperationsListResult - Result of the List Operations operation

func (OperationsListResult) MarshalJSON

func (o OperationsListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationsListResult.

func (*OperationsListResult) UnmarshalJSON added in v1.1.0

func (o *OperationsListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationsListResult.

type PublicMaintenanceConfigurationsClient

type PublicMaintenanceConfigurationsClient struct {
	// contains filtered or unexported fields
}

PublicMaintenanceConfigurationsClient contains the methods for the PublicMaintenanceConfigurations group. Don't use this type directly, use NewPublicMaintenanceConfigurationsClient() instead.

func NewPublicMaintenanceConfigurationsClient

func NewPublicMaintenanceConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PublicMaintenanceConfigurationsClient, error)

NewPublicMaintenanceConfigurationsClient creates a new instance of PublicMaintenanceConfigurationsClient with the specified values.

  • subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PublicMaintenanceConfigurationsClient) Get

Get - Get Public Maintenance Configuration record If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-04-01

  • resourceName - Maintenance Configuration Name
  • options - PublicMaintenanceConfigurationsClientGetOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/PublicMaintenanceConfigurations_GetForResource.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPublicMaintenanceConfigurationsClient().Get(ctx, "configuration1", 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.Configuration = armmaintenance.Configuration{
	// 	Name: to.Ptr("configuration1"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/configuration1"),
	// 	Location: to.Ptr("westus2"),
	// 	Properties: &armmaintenance.ConfigurationProperties{
	// 		MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeSQLDB),
	// 		MaintenanceWindow: &armmaintenance.Window{
	// 			Duration: to.Ptr("05:00"),
	// 			ExpirationDateTime: to.Ptr("9999-12-31 00:00"),
	// 			RecurEvery: to.Ptr("2Weeks"),
	// 			StartDateTime: to.Ptr("2020-04-30 08:00"),
	// 			TimeZone: to.Ptr("Pacific Standard Time"),
	// 		},
	// 		Namespace: to.Ptr("Microsoft.Maintenance"),
	// 		Visibility: to.Ptr(armmaintenance.VisibilityPublic),
	// 	},
	// }
}
Output:

func (*PublicMaintenanceConfigurationsClient) NewListPager added in v0.4.0

NewListPager - Get Public Maintenance Configuration records

Generated from API version 2023-04-01

  • options - PublicMaintenanceConfigurationsClientListOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/PublicMaintenanceConfigurations_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPublicMaintenanceConfigurationsClient().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.ListMaintenanceConfigurationsResult = armmaintenance.ListMaintenanceConfigurationsResult{
		// 	Value: []*armmaintenance.Configuration{
		// 		{
		// 			Name: to.Ptr("configuration1"),
		// 			ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/configuration1"),
		// 			Location: to.Ptr("westus2"),
		// 			Properties: &armmaintenance.ConfigurationProperties{
		// 				MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeSQLDB),
		// 				MaintenanceWindow: &armmaintenance.Window{
		// 					Duration: to.Ptr("05:00:00"),
		// 					ExpirationDateTime: to.Ptr("9999-12-31 00:00:00"),
		// 					RecurEvery: to.Ptr("Week Saturday,Sunday"),
		// 					StartDateTime: to.Ptr("2020-04-30 08:00:00"),
		// 					TimeZone: to.Ptr("Pacific Standard Time"),
		// 				},
		// 				Namespace: to.Ptr("Microsoft.Maintenance"),
		// 				Visibility: to.Ptr(armmaintenance.VisibilityPublic),
		// 			},
		// 	}},
		// }
	}
}
Output:

type PublicMaintenanceConfigurationsClientGetOptions added in v0.2.0

type PublicMaintenanceConfigurationsClientGetOptions struct {
}

PublicMaintenanceConfigurationsClientGetOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.Get method.

type PublicMaintenanceConfigurationsClientGetResponse added in v0.2.0

type PublicMaintenanceConfigurationsClientGetResponse struct {
	// Maintenance configuration record type
	Configuration
}

PublicMaintenanceConfigurationsClientGetResponse contains the response from method PublicMaintenanceConfigurationsClient.Get.

type PublicMaintenanceConfigurationsClientListOptions added in v0.2.0

type PublicMaintenanceConfigurationsClientListOptions struct {
}

PublicMaintenanceConfigurationsClientListOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.NewListPager method.

type PublicMaintenanceConfigurationsClientListResponse added in v0.2.0

type PublicMaintenanceConfigurationsClientListResponse struct {
	// Response for MaintenanceConfigurations list
	ListMaintenanceConfigurationsResult
}

PublicMaintenanceConfigurationsClientListResponse contains the response from method PublicMaintenanceConfigurationsClient.NewListPager.

type RebootOptions

type RebootOptions string

RebootOptions - Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after the patch operation is completed.

const (
	RebootOptionsAlways     RebootOptions = "Always"
	RebootOptionsIfRequired RebootOptions = "IfRequired"
	RebootOptionsNever      RebootOptions = "Never"
)

func PossibleRebootOptionsValues

func PossibleRebootOptionsValues() []RebootOptions

PossibleRebootOptionsValues returns the possible values for the RebootOptions const type.

type Resource

type Resource struct {
	// READ-ONLY; Fully qualified identifier of the resource
	ID *string

	// READ-ONLY; Name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; Type of the resource
	Type *string
}

Resource - Definition of a Resource

func (Resource) MarshalJSON

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TagOperators added in v1.2.0

type TagOperators string

TagOperators - Filter VMs by Any or All specified tags.

const (
	TagOperatorsAll TagOperators = "All"
	TagOperatorsAny TagOperators = "Any"
)

func PossibleTagOperatorsValues added in v1.2.0

func PossibleTagOperatorsValues() []TagOperators

PossibleTagOperatorsValues returns the possible values for the TagOperators const type.

type TagSettingsProperties added in v1.2.0

type TagSettingsProperties struct {
	// Filter VMs by Any or All specified tags.
	FilterOperator *TagOperators

	// Dictionary of tags with its list of values.
	Tags map[string][]*string
}

TagSettingsProperties - Tag filter information for the VM.

func (TagSettingsProperties) MarshalJSON added in v1.2.0

func (t TagSettingsProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TagSettingsProperties.

func (*TagSettingsProperties) UnmarshalJSON added in v1.2.0

func (t *TagSettingsProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TagSettingsProperties.

type Update

type Update struct {
	// Duration of impact in seconds
	ImpactDurationInSec *int32

	// The impact type
	ImpactType *ImpactType

	// The impact area
	MaintenanceScope *MaintenanceScope

	// Time when Azure will start force updates if not self-updated by customer before this time
	NotBefore *time.Time

	// Properties of the apply update
	Properties *UpdateProperties

	// The status
	Status *UpdateStatus
}

Update - Maintenance update on a resource

func (Update) MarshalJSON

func (u Update) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Update.

func (*Update) UnmarshalJSON

func (u *Update) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Update.

type UpdateProperties

type UpdateProperties struct {
	// The resourceId
	ResourceID *string
}

UpdateProperties - Properties for update

func (UpdateProperties) MarshalJSON added in v1.1.0

func (u UpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UpdateProperties.

func (*UpdateProperties) UnmarshalJSON added in v1.1.0

func (u *UpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateProperties.

type UpdateStatus

type UpdateStatus string

UpdateStatus - The status

const (
	// UpdateStatusCompleted - All updates are successfully applied.
	UpdateStatusCompleted UpdateStatus = "Completed"
	// UpdateStatusInProgress - Updates installation are in progress.
	UpdateStatusInProgress UpdateStatus = "InProgress"
	// UpdateStatusPending - There are pending updates to be installed.
	UpdateStatusPending UpdateStatus = "Pending"
	// UpdateStatusRetryLater - Updates installation failed and should be retried later.
	UpdateStatusRetryLater UpdateStatus = "RetryLater"
	// UpdateStatusRetryNow - Updates installation failed but are ready to retry again.
	UpdateStatusRetryNow UpdateStatus = "RetryNow"
)

func PossibleUpdateStatusValues

func PossibleUpdateStatusValues() []UpdateStatus

PossibleUpdateStatusValues returns the possible values for the UpdateStatus const type.

type UpdatesClient

type UpdatesClient struct {
	// contains filtered or unexported fields
}

UpdatesClient contains the methods for the Updates group. Don't use this type directly, use NewUpdatesClient() instead.

func NewUpdatesClient

func NewUpdatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UpdatesClient, error)

NewUpdatesClient creates a new instance of UpdatesClient with the specified values.

  • subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*UpdatesClient) NewListPager added in v0.4.0

func (client *UpdatesClient) NewListPager(resourceGroupName string, providerName string, resourceType string, resourceName string, options *UpdatesClientListOptions) *runtime.Pager[UpdatesClientListResponse]

NewListPager - Get updates to resources.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceType - Resource type
  • resourceName - Resource identifier
  • options - UpdatesClientListOptions contains the optional parameters for the UpdatesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/Updates_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewUpdatesClient().NewListPager("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", 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.ListUpdatesResult = armmaintenance.ListUpdatesResult{
		// 	Value: []*armmaintenance.Update{
		// 		{
		// 			ImpactDurationInSec: to.Ptr[int32](1440),
		// 			ImpactType: to.Ptr(armmaintenance.ImpactType("Reboot")),
		// 			MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeResource),
		// 			NotBefore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-09T06:17:44.235Z"); return t}()),
		// 			Properties: &armmaintenance.UpdateProperties{
		// 				ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1"),
		// 			},
		// 			Status: to.Ptr(armmaintenance.UpdateStatusPending),
		// 	}},
		// }
	}
}
Output:

func (*UpdatesClient) NewListParentPager added in v0.4.0

func (client *UpdatesClient) NewListParentPager(resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, options *UpdatesClientListParentOptions) *runtime.Pager[UpdatesClientListParentResponse]

NewListParentPager - Get updates to resources.

Generated from API version 2023-04-01

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceParentType - Resource parent type
  • resourceParentName - Resource parent identifier
  • resourceType - Resource type
  • resourceName - Resource identifier
  • options - UpdatesClientListParentOptions contains the optional parameters for the UpdatesClient.NewListParentPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2023-04-01/examples/Updates_ListParent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmaintenance.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewUpdatesClient().NewListParentPager("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "1", 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.ListUpdatesResult = armmaintenance.ListUpdatesResult{
		// 	Value: []*armmaintenance.Update{
		// 		{
		// 			ImpactDurationInSec: to.Ptr[int32](1440),
		// 			ImpactType: to.Ptr(armmaintenance.ImpactType("Reboot")),
		// 			MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeResource),
		// 			NotBefore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-09T06:17:44.235Z"); return t}()),
		// 			Properties: &armmaintenance.UpdateProperties{
		// 				ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/virtualMachines/1"),
		// 			},
		// 			Status: to.Ptr(armmaintenance.UpdateStatusPending),
		// 	}},
		// }
	}
}
Output:

type UpdatesClientListOptions added in v0.2.0

type UpdatesClientListOptions struct {
}

UpdatesClientListOptions contains the optional parameters for the UpdatesClient.NewListPager method.

type UpdatesClientListParentOptions added in v0.2.0

type UpdatesClientListParentOptions struct {
}

UpdatesClientListParentOptions contains the optional parameters for the UpdatesClient.NewListParentPager method.

type UpdatesClientListParentResponse added in v0.2.0

type UpdatesClientListParentResponse struct {
	// Response for Updates list
	ListUpdatesResult
}

UpdatesClientListParentResponse contains the response from method UpdatesClient.NewListParentPager.

type UpdatesClientListResponse added in v0.2.0

type UpdatesClientListResponse struct {
	// Response for Updates list
	ListUpdatesResult
}

UpdatesClientListResponse contains the response from method UpdatesClient.NewListPager.

type Visibility

type Visibility string

Visibility - Gets or sets the visibility of the configuration. The default value is 'Custom'

const (
	// VisibilityCustom - Only visible to users with permissions.
	VisibilityCustom Visibility = "Custom"
	// VisibilityPublic - Visible to all users.
	VisibilityPublic Visibility = "Public"
)

func PossibleVisibilityValues

func PossibleVisibilityValues() []Visibility

PossibleVisibilityValues returns the possible values for the Visibility const type.

type Window added in v0.2.0

type Window struct {
	// Duration of the maintenance window in HH:mm format. If not provided, default value will be used based on maintenance scope
	// provided. Example: 05:00.
	Duration *string

	// Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will be created in the time
	// zone provided and adjusted to daylight savings according to that time zone.
	// Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59.
	ExpirationDateTime *string

	// Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules.
	// Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)'].
	// If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days.
	// Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)']
	// [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery:
	// Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as
	// integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First,
	// Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of
	// days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months,
	// recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery:
	// Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6.
	RecurEvery *string

	// Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. The start date can be set to either the current
	// date or future date. The window will be created in the time zone provided and
	// adjusted to daylight savings according to that time zone.
	StartDateTime *string

	// Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell.
	// Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea
	// Standard Time, Cen. Australia Standard Time.
	TimeZone *string
}

Window - Definition of a MaintenanceWindow

func (Window) MarshalJSON added in v1.1.0

func (w Window) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Window.

func (*Window) UnmarshalJSON added in v1.1.0

func (w *Window) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Window.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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