armmaintenance

package module
v0.0.0-...-45adee8 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 14 Imported by: 0

README

Azure Maintenance Module for Go

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.NewApplyUpdateForResourceGroupClient()

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

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 - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ApplyUpdateForResourceGroupClient) NewListPager

NewListPager - Get Configuration records within a subscription and resource group

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

type ApplyUpdateForResourceGroupClientListOptions struct {
}

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

type ApplyUpdateForResourceGroupClientListResponse

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 - The ID of the target subscription. The value must be an UUID.
  • 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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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) CreateOrUpdateOrCancel

func (client *ApplyUpdatesClient) CreateOrUpdateOrCancel(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, applyUpdateName string, applyUpdate ApplyUpdate, options *ApplyUpdatesClientCreateOrUpdateOrCancelOptions) (ApplyUpdatesClientCreateOrUpdateOrCancelResponse, error)

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

Generated from API version 2023-10-01-preview

  • resourceGroupName - Resource group name
  • providerName - Resource provider name
  • resourceType - Resource type
  • resourceName - Resource identifier
  • applyUpdateName - ApplyUpdate name
  • applyUpdate - The ApplyUpdate
  • options - ApplyUpdatesClientCreateOrUpdateOrCancelOptions contains the optional parameters for the ApplyUpdatesClient.CreateOrUpdateOrCancel method.
Example (ApplyUpdatesCreateOrUpdateOnlyNoCancellation)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ApplyUpdates_CreateOrUpdateOnly_NoCancellation.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().CreateOrUpdateOrCancel(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "20230901121200", armmaintenance.ApplyUpdate{}, 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:

Example (ApplyUpdatesCreateOrUpdateOrCancel)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ApplyUpdates_CreateOrUpdate_CancelMaintenance.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.NewApplyUpdatesClient().CreateOrUpdateOrCancel(ctx, "examplerg", "Microsoft.Maintenance", "maintenanceConfigurations", "maintenanceConfig1", "20230901121200", armmaintenance.ApplyUpdate{
		Properties: &armmaintenance.ApplyUpdateProperties{
			Status: to.Ptr(armmaintenance.UpdateStatusCancel),
		},
	}, 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("maintenanceConfig1"),
	// 	Type: to.Ptr("Microsoft.Maintenance/applyUpdates"),
	// 	ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/microsoft.maintenance/maintenanceconfigurations/maintenanceconfig1/providers/microsoft.maintenance/applyupdates/20230901121200"),
	// 	Properties: &armmaintenance.ApplyUpdateProperties{
	// 		ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/microsoft.maintenance/maintenanceconfigurations/maintenanceconfig1"),
	// 		Status: to.Ptr(armmaintenance.UpdateStatusCancelled),
	// 	},
	// }
}
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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

NewListPager - Get Configuration records within a subscription

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

type ApplyUpdatesClientCreateOrUpdateOptions struct {
}

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

type ApplyUpdatesClientCreateOrUpdateOrCancelOptions

type ApplyUpdatesClientCreateOrUpdateOrCancelOptions struct {
}

ApplyUpdatesClientCreateOrUpdateOrCancelOptions contains the optional parameters for the ApplyUpdatesClient.CreateOrUpdateOrCancel method.

type ApplyUpdatesClientCreateOrUpdateOrCancelResponse

type ApplyUpdatesClientCreateOrUpdateOrCancelResponse struct {
	// Apply Update request
	ApplyUpdate
}

ApplyUpdatesClientCreateOrUpdateOrCancelResponse contains the response from method ApplyUpdatesClient.CreateOrUpdateOrCancel.

type ApplyUpdatesClientCreateOrUpdateParentOptions

type ApplyUpdatesClientCreateOrUpdateParentOptions struct {
}

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

type ApplyUpdatesClientCreateOrUpdateParentResponse

type ApplyUpdatesClientCreateOrUpdateParentResponse struct {
	// Apply Update request
	ApplyUpdate
}

ApplyUpdatesClientCreateOrUpdateParentResponse contains the response from method ApplyUpdatesClient.CreateOrUpdateParent.

type ApplyUpdatesClientCreateOrUpdateResponse

type ApplyUpdatesClientCreateOrUpdateResponse struct {
	// Apply Update request
	ApplyUpdate
}

ApplyUpdatesClientCreateOrUpdateResponse contains the response from method ApplyUpdatesClient.CreateOrUpdate.

type ApplyUpdatesClientGetOptions

type ApplyUpdatesClientGetOptions struct {
}

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

type ApplyUpdatesClientGetParentOptions

type ApplyUpdatesClientGetParentOptions struct {
}

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

type ApplyUpdatesClientGetParentResponse

type ApplyUpdatesClientGetParentResponse struct {
	// Apply Update request
	ApplyUpdate
}

ApplyUpdatesClientGetParentResponse contains the response from method ApplyUpdatesClient.GetParent.

type ApplyUpdatesClientGetResponse

type ApplyUpdatesClientGetResponse struct {
	// Apply Update request
	ApplyUpdate
}

ApplyUpdatesClientGetResponse contains the response from method ApplyUpdatesClient.Get.

type ApplyUpdatesClientListOptions

type ApplyUpdatesClientListOptions struct {
}

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

type ApplyUpdatesClientListResponse

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

ApplyUpdatesClientListResponse contains the response from method ApplyUpdatesClient.NewListPager.

type ClientFactory

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

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewApplyUpdateForResourceGroupClient

func (c *ClientFactory) NewApplyUpdateForResourceGroupClient() *ApplyUpdateForResourceGroupClient

NewApplyUpdateForResourceGroupClient creates a new instance of ApplyUpdateForResourceGroupClient.

func (*ClientFactory) NewApplyUpdatesClient

func (c *ClientFactory) NewApplyUpdatesClient() *ApplyUpdatesClient

NewApplyUpdatesClient creates a new instance of ApplyUpdatesClient.

func (*ClientFactory) NewConfigurationAssignmentsClient

func (c *ClientFactory) NewConfigurationAssignmentsClient() *ConfigurationAssignmentsClient

NewConfigurationAssignmentsClient creates a new instance of ConfigurationAssignmentsClient.

func (*ClientFactory) NewConfigurationAssignmentsForResourceGroupClient

func (c *ClientFactory) NewConfigurationAssignmentsForResourceGroupClient() *ConfigurationAssignmentsForResourceGroupClient

NewConfigurationAssignmentsForResourceGroupClient creates a new instance of ConfigurationAssignmentsForResourceGroupClient.

func (*ClientFactory) NewConfigurationAssignmentsForSubscriptionsClient

func (c *ClientFactory) NewConfigurationAssignmentsForSubscriptionsClient() *ConfigurationAssignmentsForSubscriptionsClient

NewConfigurationAssignmentsForSubscriptionsClient creates a new instance of ConfigurationAssignmentsForSubscriptionsClient.

func (*ClientFactory) NewConfigurationAssignmentsWithinSubscriptionClient

func (c *ClientFactory) NewConfigurationAssignmentsWithinSubscriptionClient() *ConfigurationAssignmentsWithinSubscriptionClient

NewConfigurationAssignmentsWithinSubscriptionClient creates a new instance of ConfigurationAssignmentsWithinSubscriptionClient.

func (*ClientFactory) NewConfigurationsClient

func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient

NewConfigurationsClient creates a new instance of ConfigurationsClient.

func (*ClientFactory) NewConfigurationsForResourceGroupClient

func (c *ClientFactory) NewConfigurationsForResourceGroupClient() *ConfigurationsForResourceGroupClient

NewConfigurationsForResourceGroupClient creates a new instance of ConfigurationsForResourceGroupClient.

func (*ClientFactory) NewOperationsClient

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPublicMaintenanceConfigurationsClient

func (c *ClientFactory) NewPublicMaintenanceConfigurationsClient() *PublicMaintenanceConfigurationsClient

NewPublicMaintenanceConfigurationsClient creates a new instance of PublicMaintenanceConfigurationsClient.

func (*ClientFactory) NewScheduledEventClient

func (c *ClientFactory) NewScheduledEventClient() *ScheduledEventClient

NewScheduledEventClient creates a new instance of ScheduledEventClient.

func (*ClientFactory) NewUpdatesClient

func (c *ClientFactory) NewUpdatesClient() *UpdatesClient

NewUpdatesClient creates a new instance of UpdatesClient.

type Configuration

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

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

MarshalJSON implements the json.Marshaller interface for type Configuration.

func (*Configuration) UnmarshalJSON

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

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationAssignment.

type ConfigurationAssignmentFilterProperties

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

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationAssignmentFilterProperties.

func (*ConfigurationAssignmentFilterProperties) UnmarshalJSON

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

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationAssignmentProperties.

func (*ConfigurationAssignmentProperties) UnmarshalJSON

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 - The ID of the target subscription. The value must be an UUID.
  • 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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

type ConfigurationAssignmentsClientCreateOrUpdateOptions struct {
}

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

type ConfigurationAssignmentsClientCreateOrUpdateParentOptions

type ConfigurationAssignmentsClientCreateOrUpdateParentOptions struct {
}

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

type ConfigurationAssignmentsClientCreateOrUpdateParentResponse

type ConfigurationAssignmentsClientCreateOrUpdateParentResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientCreateOrUpdateParentResponse contains the response from method ConfigurationAssignmentsClient.CreateOrUpdateParent.

type ConfigurationAssignmentsClientCreateOrUpdateResponse

type ConfigurationAssignmentsClientCreateOrUpdateResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientCreateOrUpdateResponse contains the response from method ConfigurationAssignmentsClient.CreateOrUpdate.

type ConfigurationAssignmentsClientDeleteOptions

type ConfigurationAssignmentsClientDeleteOptions struct {
}

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

type ConfigurationAssignmentsClientDeleteParentOptions

type ConfigurationAssignmentsClientDeleteParentOptions struct {
}

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

type ConfigurationAssignmentsClientDeleteParentResponse

type ConfigurationAssignmentsClientDeleteParentResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientDeleteParentResponse contains the response from method ConfigurationAssignmentsClient.DeleteParent.

type ConfigurationAssignmentsClientDeleteResponse

type ConfigurationAssignmentsClientDeleteResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientDeleteResponse contains the response from method ConfigurationAssignmentsClient.Delete.

type ConfigurationAssignmentsClientGetOptions

type ConfigurationAssignmentsClientGetOptions struct {
}

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

type ConfigurationAssignmentsClientGetParentOptions

type ConfigurationAssignmentsClientGetParentOptions struct {
}

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

type ConfigurationAssignmentsClientGetParentResponse

type ConfigurationAssignmentsClientGetParentResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientGetParentResponse contains the response from method ConfigurationAssignmentsClient.GetParent.

type ConfigurationAssignmentsClientGetResponse

type ConfigurationAssignmentsClientGetResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsClientGetResponse contains the response from method ConfigurationAssignmentsClient.Get.

type ConfigurationAssignmentsClientListOptions

type ConfigurationAssignmentsClientListOptions struct {
}

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

type ConfigurationAssignmentsClientListParentOptions

type ConfigurationAssignmentsClientListParentOptions struct {
}

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

type ConfigurationAssignmentsClientListParentResponse

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

ConfigurationAssignmentsClientListParentResponse contains the response from method ConfigurationAssignmentsClient.NewListParentPager.

type ConfigurationAssignmentsClientListResponse

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

ConfigurationAssignmentsClientListResponse contains the response from method ConfigurationAssignmentsClient.NewListPager.

type ConfigurationAssignmentsForResourceGroupClient

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

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

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

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ConfigurationAssignmentsForResourceGroupClient) CreateOrUpdate

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

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

type ConfigurationAssignmentsForResourceGroupClientCreateOrUpdateOptions struct {
}

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

type ConfigurationAssignmentsForResourceGroupClientCreateOrUpdateResponse

type ConfigurationAssignmentsForResourceGroupClientCreateOrUpdateResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForResourceGroupClientCreateOrUpdateResponse contains the response from method ConfigurationAssignmentsForResourceGroupClient.CreateOrUpdate.

type ConfigurationAssignmentsForResourceGroupClientDeleteOptions

type ConfigurationAssignmentsForResourceGroupClientDeleteOptions struct {
}

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

type ConfigurationAssignmentsForResourceGroupClientDeleteResponse

type ConfigurationAssignmentsForResourceGroupClientDeleteResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForResourceGroupClientDeleteResponse contains the response from method ConfigurationAssignmentsForResourceGroupClient.Delete.

type ConfigurationAssignmentsForResourceGroupClientGetOptions

type ConfigurationAssignmentsForResourceGroupClientGetOptions struct {
}

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

type ConfigurationAssignmentsForResourceGroupClientGetResponse

type ConfigurationAssignmentsForResourceGroupClientGetResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForResourceGroupClientGetResponse contains the response from method ConfigurationAssignmentsForResourceGroupClient.Get.

type ConfigurationAssignmentsForResourceGroupClientUpdateOptions

type ConfigurationAssignmentsForResourceGroupClientUpdateOptions struct {
}

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

type ConfigurationAssignmentsForResourceGroupClientUpdateResponse

type ConfigurationAssignmentsForResourceGroupClientUpdateResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForResourceGroupClientUpdateResponse contains the response from method ConfigurationAssignmentsForResourceGroupClient.Update.

type ConfigurationAssignmentsForSubscriptionsClient

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

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

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

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ConfigurationAssignmentsForSubscriptionsClient) CreateOrUpdate

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

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

type ConfigurationAssignmentsForSubscriptionsClientCreateOrUpdateOptions struct {
}

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

type ConfigurationAssignmentsForSubscriptionsClientCreateOrUpdateResponse

type ConfigurationAssignmentsForSubscriptionsClientCreateOrUpdateResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForSubscriptionsClientCreateOrUpdateResponse contains the response from method ConfigurationAssignmentsForSubscriptionsClient.CreateOrUpdate.

type ConfigurationAssignmentsForSubscriptionsClientDeleteOptions

type ConfigurationAssignmentsForSubscriptionsClientDeleteOptions struct {
}

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

type ConfigurationAssignmentsForSubscriptionsClientDeleteResponse

type ConfigurationAssignmentsForSubscriptionsClientDeleteResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForSubscriptionsClientDeleteResponse contains the response from method ConfigurationAssignmentsForSubscriptionsClient.Delete.

type ConfigurationAssignmentsForSubscriptionsClientGetOptions

type ConfigurationAssignmentsForSubscriptionsClientGetOptions struct {
}

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

type ConfigurationAssignmentsForSubscriptionsClientGetResponse

type ConfigurationAssignmentsForSubscriptionsClientGetResponse struct {
	// Configuration Assignment
	ConfigurationAssignment
}

ConfigurationAssignmentsForSubscriptionsClientGetResponse contains the response from method ConfigurationAssignmentsForSubscriptionsClient.Get.

type ConfigurationAssignmentsForSubscriptionsClientUpdateOptions

type ConfigurationAssignmentsForSubscriptionsClientUpdateOptions struct {
}

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

type ConfigurationAssignmentsForSubscriptionsClientUpdateResponse

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 - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ConfigurationAssignmentsWithinSubscriptionClient) NewListPager

NewListPager - Get configuration assignment within a subscription

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

type ConfigurationAssignmentsWithinSubscriptionClientListOptions struct {
}

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

type ConfigurationAssignmentsWithinSubscriptionClientListResponse

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

ConfigurationAssignmentsWithinSubscriptionClientListResponse contains the response from method ConfigurationAssignmentsWithinSubscriptionClient.NewListPager.

type ConfigurationProperties

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

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationProperties.

func (*ConfigurationProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProperties.

type ConfigurationsClient

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

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

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

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ConfigurationsClient) CreateOrUpdate

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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

NewListPager - Get Configuration records within a subscription

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

type ConfigurationsClientCreateOrUpdateOptions struct {
}

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

type ConfigurationsClientCreateOrUpdateResponse

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

ConfigurationsClientCreateOrUpdateResponse contains the response from method ConfigurationsClient.CreateOrUpdate.

type ConfigurationsClientDeleteOptions

type ConfigurationsClientDeleteOptions struct {
}

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

type ConfigurationsClientDeleteResponse

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

ConfigurationsClientDeleteResponse contains the response from method ConfigurationsClient.Delete.

type ConfigurationsClientGetOptions

type ConfigurationsClientGetOptions struct {
}

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

type ConfigurationsClientGetResponse

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

ConfigurationsClientGetResponse contains the response from method ConfigurationsClient.Get.

type ConfigurationsClientListOptions

type ConfigurationsClientListOptions struct {
}

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

type ConfigurationsClientListResponse

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

ConfigurationsClientListResponse contains the response from method ConfigurationsClient.NewListPager.

type ConfigurationsClientUpdateOptions

type ConfigurationsClientUpdateOptions struct {
}

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

type ConfigurationsClientUpdateResponse

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

ConfigurationsClientUpdateResponse contains the response from method ConfigurationsClient.Update.

type ConfigurationsForResourceGroupClient

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

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

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

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ConfigurationsForResourceGroupClient) NewListPager

NewListPager - Get Configuration records within a subscription and resource group

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

type ConfigurationsForResourceGroupClientListOptions struct {
}

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

type ConfigurationsForResourceGroupClientListResponse

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

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

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

func (Error) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Error.

func (*Error) UnmarshalJSON

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

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

MarshalJSON implements the json.Marshaller interface for type ErrorDetails.

func (*ErrorDetails) UnmarshalJSON

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

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

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

MarshalJSON implements the json.Marshaller interface for type InputPatchConfiguration.

func (*InputPatchConfiguration) UnmarshalJSON

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

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

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

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

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

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

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

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

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

MarshalJSON implements the json.Marshaller interface for type OperationInfo.

func (*OperationInfo) UnmarshalJSON

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

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

Generated from API version 2023-10-01-preview

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse

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

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 - The ID of the target subscription. The value must be an UUID.
  • 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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

NewListPager - Get Public Maintenance Configuration records

Generated from API version 2023-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

type PublicMaintenanceConfigurationsClientGetOptions struct {
}

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

type PublicMaintenanceConfigurationsClientGetResponse

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

PublicMaintenanceConfigurationsClientGetResponse contains the response from method PublicMaintenanceConfigurationsClient.Get.

type PublicMaintenanceConfigurationsClientListOptions

type PublicMaintenanceConfigurationsClientListOptions struct {
}

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

type PublicMaintenanceConfigurationsClientListResponse

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

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ScheduledEventApproveResponse

type ScheduledEventApproveResponse struct {
	// Successfully Approved
	Value *string
}

ScheduledEventApproveResponse - Response of scheduled event acknowledge

func (ScheduledEventApproveResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ScheduledEventApproveResponse.

func (*ScheduledEventApproveResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledEventApproveResponse.

type ScheduledEventClient

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

ScheduledEventClient contains the methods for the ScheduledEvent group. Don't use this type directly, use NewScheduledEventClient() instead.

func NewScheduledEventClient

func NewScheduledEventClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScheduledEventClient, error)

NewScheduledEventClient creates a new instance of ScheduledEventClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ScheduledEventClient) Acknowledge

func (client *ScheduledEventClient) Acknowledge(ctx context.Context, resourceGroupName string, resourceType string, resourceName string, scheduledEventID string, options *ScheduledEventClientAcknowledgeOptions) (ScheduledEventClientAcknowledgeResponse, error)

Acknowledge - Post Scheduled Event Acknowledgement If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-10-01-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceType - Resource type
  • resourceName - Resource Name
  • scheduledEventID - Scheduled Event Id. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
  • options - ScheduledEventClientAcknowledgeOptions contains the optional parameters for the ScheduledEventClient.Acknowledge method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ScheduledEvents_Acknowledge.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.NewScheduledEventClient().Acknowledge(ctx, "examplerg", "virtualMachines", "configuration1", "ad6d85cf-2c9e-4eec-9a1e-af3213cc0486", 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.ScheduledEventApproveResponse = armmaintenance.ScheduledEventApproveResponse{
	// 	Value: to.Ptr("Successfully Approved"),
	// }
}
Output:

type ScheduledEventClientAcknowledgeOptions

type ScheduledEventClientAcknowledgeOptions struct {
}

ScheduledEventClientAcknowledgeOptions contains the optional parameters for the ScheduledEventClient.Acknowledge method.

type ScheduledEventClientAcknowledgeResponse

type ScheduledEventClientAcknowledgeResponse struct {
	// Response of scheduled event acknowledge
	ScheduledEventApproveResponse
}

ScheduledEventClientAcknowledgeResponse contains the response from method ScheduledEventClient.Acknowledge.

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

type TagOperators string

TagOperators - Filter VMs by Any or All specified tags.

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

func PossibleTagOperatorsValues

func PossibleTagOperatorsValues() []TagOperators

PossibleTagOperatorsValues returns the possible values for the TagOperators const type.

type TagSettingsProperties

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

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

MarshalJSON implements the json.Marshaller interface for type TagSettingsProperties.

func (*TagSettingsProperties) UnmarshalJSON

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

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

MarshalJSON implements the json.Marshaller interface for type UpdateProperties.

func (*UpdateProperties) UnmarshalJSON

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 (
	// UpdateStatusCancel - Cancel the schedule and stop creating PMR for resources part of it. Applicable to Maintenance Configuration
	// resource type only.
	UpdateStatusCancel UpdateStatus = "Cancel"
	// UpdateStatusCancelled - Send the Cancelled response to the user if request came to cancel the schedule. Applicable to Maintenance
	// Configuration resource type only.
	UpdateStatusCancelled UpdateStatus = "Cancelled"
	// UpdateStatusCompleted - All updates are successfully applied.
	UpdateStatusCompleted UpdateStatus = "Completed"
	// UpdateStatusInProgress - Updates installation are in progress.
	UpdateStatusInProgress UpdateStatus = "InProgress"
	// UpdateStatusNoUpdatesPending - No updates are pending.
	UpdateStatusNoUpdatesPending UpdateStatus = "NoUpdatesPending"
	// 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 - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*UpdatesClient) NewListPager

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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

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-10-01-preview

  • 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/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

type UpdatesClientListOptions struct {
}

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

type UpdatesClientListParentOptions

type UpdatesClientListParentOptions struct {
}

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

type UpdatesClientListParentResponse

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

UpdatesClientListParentResponse contains the response from method UpdatesClient.NewListParentPager.

type UpdatesClientListResponse

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

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

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

MarshalJSON implements the json.Marshaller interface for type Window.

func (*Window) UnmarshalJSON

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