armautomanage

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 14 Imported by: 3

README

Azure Automanage Module for Go

PkgGoDev

The armautomanage module provides operations for working with Azure Automanage.

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 and import required packages

This project uses Go modules for versioning and dependency management.

Install the Azure Automanage and Azure Identity modules:

go get "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
go get "github.com/Azure/azure-sdk-for-go/sdk/azidentity"

Import the Azure Automanage and Azure Identity modules:

import (
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Automanage. 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 Automanage 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 := armautomanage.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 := armautomanage.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.

reportsClient := clientFactory.NewReportsClient()
configProfilesClient := clientFactory.NewReportsClient()
assignmentClient := clientFactory.NewReportsClient()

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.

Create or Update a Custom Automanage Configuration Profile

To update a profile, provide a value for all properties as if you were creating a configuration profile (ID, Name, Type, Location, Properties, Tags)

configuration := map[string]interface{}{
    "Antimalware/Enable":                false,
    "AzureSecurityCenter/Enable":        true,
    "Backup/Enable":                     false,
    "BootDiagnostics/Enable":            true,
    "ChangeTrackingAndInventory/Enable": true,
    "GuestConfiguration/Enable":         true,
    "LogAnalytics/Enable":               true,
    "UpdateManagement/Enable":           true,
    "VMInsights/Enable":                 true,
}

properties := armautomanage.ConfigurationProfileProperties{
    Configuration: configuration,
}

location := "eastus"
environment := "dev"

// tags may be omitted 
tags := make(map[string]*string)
tags["environment"] = &environment

profile := armautomanage.ConfigurationProfile{
    Location:   &location,
    Properties: &properties,
    Tags:       tags,
}

newProfile, err := configProfilesClient.CreateOrUpdate(context.Background(), configurationProfileName, "resourceGroupName", profile, nil)

Get an Automanage Configuration Profile

profile, err := configProfilesClient.Get(context.Background(), "configurationProfileName", "resourceGroupName", nil)
data, err := json.MarshalIndent(profile, "", "   ")

fmt.Println(string(data))

Delete an Automanage Configuration Profile

_, err := configProfilesClient.Delete(context.Background(), "resourceGroupName", "configurationProfileName", nil)

Get an Automanage Profile Assignment

assignment, err := assignmentClient.Get(context.Background(), "resourceGroupName", "default", "vmName", nil)
data, err := json.MarshalIndent(assignment, "", "   ")
fmt.Println(string(data))

Create an Assignment between a VM and an Automanage Best Practices Production Configuration Profile

configProfileId := "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"

properties := armautomanage.ConfigurationProfileAssignmentProperties{
    ConfigurationProfile: &configProfileId,
}

assignment := armautomanage.ConfigurationProfileAssignment{
    Properties: &properties,
}

// assignment name must be 'default'
newAssignment, err = assignmentClient.CreateOrUpdate(context.Background(), "default", "resourceGroupName", "vmName", assignment, nil)

Create an Assignment between a VM and a Custom Automanage Configuration Profile

configProfileId := "/subscriptions/<subscription ID>/resourceGroups/resourceGroupName/providers/Microsoft.Automanage/configurationProfiles/configurationProfileName"

properties := armautomanage.ConfigurationProfileAssignmentProperties{
    ConfigurationProfile: &configProfileId,
}

assignment := armautomanage.ConfigurationProfileAssignment{
    Properties: &properties,
}

// assignment name must be 'default'
newAssignment, err = assignmentClient.CreateOrUpdate(context.Background(), "default", "resourceGroupName", "vmName", assignment, nil)

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Automanage 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 ActionType added in v0.2.0

type ActionType string

ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

const (
	ActionTypeInternal ActionType = "Internal"
)

func PossibleActionTypeValues added in v0.2.0

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type AssignmentReportProperties added in v0.2.0

type AssignmentReportProperties struct {
	// End time of the configuration profile assignment processing.
	EndTime *string

	// Start time of the configuration profile assignment processing.
	StartTime *string

	// READ-ONLY; The configurationProfile linked to the assignment.
	ConfigurationProfile *string

	// READ-ONLY; Duration of the configuration profile assignment processing.
	Duration *string

	// READ-ONLY; Error message, if any, returned by the configuration profile assignment processing.
	Error *ErrorDetail

	// READ-ONLY; Last modified time of the configuration profile assignment processing.
	LastModifiedTime *string

	// READ-ONLY; Version of the report format
	ReportFormatVersion *string

	// READ-ONLY; List of resources processed by the configuration profile assignment.
	Resources []*ReportResource

	// READ-ONLY; The status of the configuration profile assignment.
	Status *string

	// READ-ONLY; Type of the configuration profile assignment processing (Initial/Consistency).
	Type *string
}

AssignmentReportProperties - Data related to the report detail.

func (AssignmentReportProperties) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type AssignmentReportProperties.

func (*AssignmentReportProperties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentReportProperties.

type BestPractice added in v0.2.0

type BestPractice struct {
	// Properties of the best practice.
	Properties *ConfigurationProfileProperties

	// READ-ONLY; The fully qualified ID for the best practice. For example, /providers/Microsoft.Automanage/bestPractices/azureBestPracticesProduction
	ID *string

	// READ-ONLY; The name of the best practice. For example, azureBestPracticesProduction
	Name *string

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

	// READ-ONLY; The type of the resource. For example, Microsoft.Automanage/bestPractices
	Type *string
}

BestPractice - Definition of the Automanage best practice.

func (BestPractice) MarshalJSON added in v1.0.0

func (b BestPractice) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BestPractice.

func (*BestPractice) UnmarshalJSON added in v1.0.0

func (b *BestPractice) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BestPractice.

type BestPracticeList added in v0.2.0

type BestPracticeList struct {
	// Result of the list best practice operation.
	Value []*BestPractice
}

BestPracticeList - The response of the list best practice operation.

func (BestPracticeList) MarshalJSON added in v0.2.0

func (b BestPracticeList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BestPracticeList.

func (*BestPracticeList) UnmarshalJSON added in v1.0.0

func (b *BestPracticeList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BestPracticeList.

type BestPracticesClient added in v0.2.0

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

BestPracticesClient contains the methods for the BestPractices group. Don't use this type directly, use NewBestPracticesClient() instead.

func NewBestPracticesClient added in v0.2.0

func NewBestPracticesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*BestPracticesClient, error)

NewBestPracticesClient creates a new instance of BestPracticesClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*BestPracticesClient) Get added in v0.2.0

Get - Get information about a Automanage best practice If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • bestPracticeName - The Automanage best practice name.
  • options - BestPracticesClientGetOptions contains the optional parameters for the BestPracticesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/getBestPractice.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewBestPracticesClient().Get(ctx, "azureBestPracticesProduction", 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.BestPractice = armautomanage.BestPractice{
	// 	Name: to.Ptr("azureBestPracticesProduction"),
	// 	Type: to.Ptr("Microsoft.Automanage/bestPractices"),
	// 	ID: to.Ptr("/providers/Microsoft.Automanage/bestPractices/azureBestPracticesProduction"),
	// 	Properties: &armautomanage.ConfigurationProfileProperties{
	// 		Configuration: map[string]any{
	// 			"Antimalware/Enable": true,
	// 			"Antimalware/EnableRealTimeProtection": true,
	// 			"Antimalware/RunScheduledScan": true,
	// 			"Antimalware/ScanDay": "7",
	// 			"Antimalware/ScanTimeInMinutes": "120",
	// 			"Antimalware/ScanType": "Quick",
	// 			"AzureSecurityCenter/Enable": true,
	// 			"Backup/Enable": true,
	// 			"Backup/InstantRpRetentionRangeInDays": "2",
	// 			"Backup/PolicyName": "dailyBackupPolicy",
	// 			"Backup/RetentionPolicy/DailySchedule/RetentionDuration/Count": "180",
	// 			"Backup/RetentionPolicy/DailySchedule/RetentionDuration/DurationType": "Days",
	// 			"Backup/RetentionPolicy/DailySchedule/RetentionTimes": "[ 2017-01-26T00:00:00Z ]",
	// 			"Backup/RetentionPolicy/RetentionPolicyType": "LongTermRetentionPolicy",
	// 			"Backup/SchedulePolicy/SchedulePolicyType": "SimpleSchedulePolicy",
	// 			"Backup/SchedulePolicy/ScheduleRunFrequency": "Daily",
	// 			"Backup/SchedulePolicy/ScheduleRunTimes": "[ 2017-01-26T00:00:00Z ]",
	// 			"Backup/TimeZone": "UTC",
	// 			"BootDiagnostics/Enable": true,
	// 			"ChangeTrackingAndInventory/Enable": true,
	// 			"GuestConfiguration/Enable": true,
	// 			"LogAnalytics/Enable": true,
	// 			"UpdateManagement/Enable": true,
	// 			"VMInsights/Enable": true,
	// 		},
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*BestPracticesClient) NewListByTenantPager added in v0.4.0

NewListByTenantPager - Retrieve a list of Automanage best practices

Generated from API version 2022-05-04

  • options - BestPracticesClientListByTenantOptions contains the optional parameters for the BestPracticesClient.NewListByTenantPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listBestPracticesByTenant.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewBestPracticesClient().NewListByTenantPager(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.BestPracticeList = armautomanage.BestPracticeList{
		// 	Value: []*armautomanage.BestPractice{
		// 		{
		// 			Name: to.Ptr("azureBestPracticesProduction"),
		// 			Type: to.Ptr("Microsoft.Automanage/bestPractices"),
		// 			ID: to.Ptr("/providers/Microsoft.Automanage/bestPractices/azureBestPracticesProduction"),
		// 			Properties: &armautomanage.ConfigurationProfileProperties{
		// 				Configuration: map[string]any{
		// 					"Antimalware/Enable": true,
		// 					"Antimalware/EnableRealTimeProtection": true,
		// 					"Antimalware/RunScheduledScan": true,
		// 					"Antimalware/ScanDay": "7",
		// 					"Antimalware/ScanTimeInMinutes": "120",
		// 					"Antimalware/ScanType": "Quick",
		// 					"AzureSecurityCenter/Enable": true,
		// 					"Backup/Enable": true,
		// 					"Backup/InstantRpRetentionRangeInDays": "2",
		// 					"Backup/PolicyName": "dailyBackupPolicy",
		// 					"Backup/RetentionPolicy/DailySchedule/RetentionDuration/Count": "180",
		// 					"Backup/RetentionPolicy/DailySchedule/RetentionDuration/DurationType": "Days",
		// 					"Backup/RetentionPolicy/DailySchedule/RetentionTimes": "[ 2017-01-26T00:00:00Z ]",
		// 					"Backup/RetentionPolicy/RetentionPolicyType": "LongTermRetentionPolicy",
		// 					"Backup/SchedulePolicy/SchedulePolicyType": "SimpleSchedulePolicy",
		// 					"Backup/SchedulePolicy/ScheduleRunFrequency": "Daily",
		// 					"Backup/SchedulePolicy/ScheduleRunTimes": "[ 2017-01-26T00:00:00Z ]",
		// 					"Backup/TimeZone": "UTC",
		// 					"BootDiagnostics/Enable": true,
		// 					"ChangeTrackingAndInventory/Enable": true,
		// 					"GuestConfiguration/Enable": true,
		// 					"LogAnalytics/Enable": true,
		// 					"UpdateManagement/Enable": true,
		// 					"VMInsights/Enable": true,
		// 				},
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("azureBestPracticesDevTest"),
		// 			Type: to.Ptr("Microsoft.Automanage/bestPractices"),
		// 			ID: to.Ptr("/providers/Microsoft.Automanage/bestPractices/azureBestPracticesDevTest"),
		// 			Properties: &armautomanage.ConfigurationProfileProperties{
		// 				Configuration: map[string]any{
		// 					"Antimalware/Enable": true,
		// 					"Antimalware/EnableRealTimeProtection": true,
		// 					"Antimalware/RunScheduledScan": true,
		// 					"Antimalware/ScanDay": "7",
		// 					"Antimalware/ScanTimeInMinutes": "120",
		// 					"Antimalware/ScanType": "Quick",
		// 					"AzureSecurityCenter/Enable": true,
		// 					"Backup/Enable": false,
		// 					"BootDiagnostics/Enable": true,
		// 					"ChangeTrackingAndInventory/Enable": true,
		// 					"GuestConfiguration/Enable": true,
		// 					"LogAnalytics/Enable": true,
		// 					"UpdateManagement/Enable": true,
		// 					"VMInsights/Enable": false,
		// 				},
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

type BestPracticesClientGetOptions added in v0.2.0

type BestPracticesClientGetOptions struct {
}

BestPracticesClientGetOptions contains the optional parameters for the BestPracticesClient.Get method.

type BestPracticesClientGetResponse added in v0.2.0

type BestPracticesClientGetResponse struct {
	// Definition of the Automanage best practice.
	BestPractice
}

BestPracticesClientGetResponse contains the response from method BestPracticesClient.Get.

type BestPracticesClientListByTenantOptions added in v0.2.0

type BestPracticesClientListByTenantOptions struct {
}

BestPracticesClientListByTenantOptions contains the optional parameters for the BestPracticesClient.NewListByTenantPager method.

type BestPracticesClientListByTenantResponse added in v0.2.0

type BestPracticesClientListByTenantResponse struct {
	// The response of the list best practice operation.
	BestPracticeList
}

BestPracticesClientListByTenantResponse contains the response from method BestPracticesClient.NewListByTenantPager.

type BestPracticesVersionsClient added in v0.2.0

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

BestPracticesVersionsClient contains the methods for the BestPracticesVersions group. Don't use this type directly, use NewBestPracticesVersionsClient() instead.

func NewBestPracticesVersionsClient added in v0.2.0

func NewBestPracticesVersionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*BestPracticesVersionsClient, error)

NewBestPracticesVersionsClient creates a new instance of BestPracticesVersionsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*BestPracticesVersionsClient) Get added in v0.2.0

Get - Get information about a Automanage best practice version If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • bestPracticeName - The Automanage best practice name.
  • versionName - The Automanage best practice version name.
  • options - BestPracticesVersionsClientGetOptions contains the optional parameters for the BestPracticesVersionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/getBestPracticeVersion.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewBestPracticesVersionsClient().Get(ctx, "azureBestPracticesProduction", "version1", 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.BestPractice = armautomanage.BestPractice{
	// 	Name: to.Ptr("azureBestPracticesProduction/version1"),
	// 	Type: to.Ptr("Microsoft.Automanage/bestPractices/versions"),
	// 	ID: to.Ptr("/providers/Microsoft.Automanage/bestPractices/azureBestPracticesProduction/versions/version1"),
	// 	Properties: &armautomanage.ConfigurationProfileProperties{
	// 		Configuration: map[string]any{
	// 			"Antimalware/Enable": true,
	// 			"Antimalware/EnableRealTimeProtection": true,
	// 			"Antimalware/RunScheduledScan": true,
	// 			"Antimalware/ScanDay": "7",
	// 			"Antimalware/ScanTimeInMinutes": "120",
	// 			"Antimalware/ScanType": "Quick",
	// 			"AzureSecurityCenter/Enable": true,
	// 			"Backup/Enable": true,
	// 			"Backup/InstantRpRetentionRangeInDays": "2",
	// 			"Backup/PolicyName": "dailyBackupPolicy",
	// 			"Backup/RetentionPolicy/DailySchedule/RetentionDuration/Count": "180",
	// 			"Backup/RetentionPolicy/DailySchedule/RetentionDuration/DurationType": "Days",
	// 			"Backup/RetentionPolicy/DailySchedule/RetentionTimes": "[ 2017-01-26T00:00:00Z ]",
	// 			"Backup/RetentionPolicy/RetentionPolicyType": "LongTermRetentionPolicy",
	// 			"Backup/SchedulePolicy/SchedulePolicyType": "SimpleSchedulePolicy",
	// 			"Backup/SchedulePolicy/ScheduleRunFrequency": "Daily",
	// 			"Backup/SchedulePolicy/ScheduleRunTimes": "[ 2017-01-26T00:00:00Z ]",
	// 			"Backup/TimeZone": "UTC",
	// 			"BootDiagnostics/Enable": true,
	// 			"ChangeTrackingAndInventory/Enable": true,
	// 			"GuestConfiguration/Enable": true,
	// 			"LogAnalytics/Enable": true,
	// 			"UpdateManagement/Enable": true,
	// 			"VMInsights/Enable": true,
	// 		},
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*BestPracticesVersionsClient) NewListByTenantPager added in v0.4.0

NewListByTenantPager - Retrieve a list of Automanage best practices versions

Generated from API version 2022-05-04

  • bestPracticeName - The Automanage best practice name.
  • options - BestPracticesVersionsClientListByTenantOptions contains the optional parameters for the BestPracticesVersionsClient.NewListByTenantPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listBestPracticesVersionsByTenant.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewBestPracticesVersionsClient().NewListByTenantPager("azureBestPracticesProduction", 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.BestPracticeList = armautomanage.BestPracticeList{
		// 	Value: []*armautomanage.BestPractice{
		// 		{
		// 			Name: to.Ptr("azureBestPracticesProduction/version1"),
		// 			Type: to.Ptr("Microsoft.Automanage/bestPractices/versions"),
		// 			ID: to.Ptr("/providers/Microsoft.Automanage/bestPractices/azureBestPracticesProduction/versions/version1"),
		// 			Properties: &armautomanage.ConfigurationProfileProperties{
		// 				Configuration: map[string]any{
		// 					"Antimalware/Enable": true,
		// 					"Antimalware/EnableRealTimeProtection": true,
		// 					"Antimalware/RunScheduledScan": true,
		// 					"Antimalware/ScanDay": "7",
		// 					"Antimalware/ScanTimeInMinutes": "120",
		// 					"Antimalware/ScanType": "Quick",
		// 					"AzureSecurityCenter/Enable": true,
		// 					"Backup/Enable": true,
		// 					"Backup/InstantRpRetentionRangeInDays": "2",
		// 					"Backup/PolicyName": "dailyBackupPolicy",
		// 					"Backup/RetentionPolicy/DailySchedule/RetentionDuration/Count": "180",
		// 					"Backup/RetentionPolicy/DailySchedule/RetentionDuration/DurationType": "Days",
		// 					"Backup/RetentionPolicy/DailySchedule/RetentionTimes": "[ 2017-01-26T00:00:00Z ]",
		// 					"Backup/RetentionPolicy/RetentionPolicyType": "LongTermRetentionPolicy",
		// 					"Backup/SchedulePolicy/SchedulePolicyType": "SimpleSchedulePolicy",
		// 					"Backup/SchedulePolicy/ScheduleRunFrequency": "Daily",
		// 					"Backup/SchedulePolicy/ScheduleRunTimes": "[ 2017-01-26T00:00:00Z ]",
		// 					"Backup/TimeZone": "UTC",
		// 					"BootDiagnostics/Enable": true,
		// 					"ChangeTrackingAndInventory/Enable": true,
		// 					"GuestConfiguration/Enable": true,
		// 					"LogAnalytics/Enable": true,
		// 					"UpdateManagement/Enable": true,
		// 					"VMInsights/Enable": true,
		// 				},
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("azureBestPracticesProduction/version2"),
		// 			Type: to.Ptr("Microsoft.Automanage/bestPractices/versions"),
		// 			ID: to.Ptr("/providers/Microsoft.Automanage/bestPractices/azureBestPracticesProduction/versions/version2"),
		// 			Properties: &armautomanage.ConfigurationProfileProperties{
		// 				Configuration: map[string]any{
		// 					"Antimalware/Enable": true,
		// 					"Antimalware/EnableRealTimeProtection": true,
		// 					"Antimalware/RunScheduledScan": true,
		// 					"Antimalware/ScanDay": "7",
		// 					"Antimalware/ScanTimeInMinutes": "120",
		// 					"Antimalware/ScanType": "Quick",
		// 					"AzureSecurityCenter/Enable": true,
		// 					"Backup/Enable": false,
		// 					"BootDiagnostics/Enable": true,
		// 					"ChangeTrackingAndInventory/Enable": true,
		// 					"GuestConfiguration/Enable": true,
		// 					"LogAnalytics/Enable": true,
		// 					"UpdateManagement/Enable": true,
		// 					"VMInsights/Enable": false,
		// 				},
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

type BestPracticesVersionsClientGetOptions added in v0.2.0

type BestPracticesVersionsClientGetOptions struct {
}

BestPracticesVersionsClientGetOptions contains the optional parameters for the BestPracticesVersionsClient.Get method.

type BestPracticesVersionsClientGetResponse added in v0.2.0

type BestPracticesVersionsClientGetResponse struct {
	// Definition of the Automanage best practice.
	BestPractice
}

BestPracticesVersionsClientGetResponse contains the response from method BestPracticesVersionsClient.Get.

type BestPracticesVersionsClientListByTenantOptions added in v0.2.0

type BestPracticesVersionsClientListByTenantOptions struct {
}

BestPracticesVersionsClientListByTenantOptions contains the optional parameters for the BestPracticesVersionsClient.NewListByTenantPager method.

type BestPracticesVersionsClientListByTenantResponse added in v0.2.0

type BestPracticesVersionsClientListByTenantResponse struct {
	// The response of the list best practice operation.
	BestPracticeList
}

BestPracticesVersionsClientListByTenantResponse contains the response from method BestPracticesVersionsClient.NewListByTenantPager.

type ClientFactory added in v1.1.0

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

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v1.1.0

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

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

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

func (*ClientFactory) NewBestPracticesClient added in v1.1.0

func (c *ClientFactory) NewBestPracticesClient() *BestPracticesClient

NewBestPracticesClient creates a new instance of BestPracticesClient.

func (*ClientFactory) NewBestPracticesVersionsClient added in v1.1.0

func (c *ClientFactory) NewBestPracticesVersionsClient() *BestPracticesVersionsClient

NewBestPracticesVersionsClient creates a new instance of BestPracticesVersionsClient.

func (*ClientFactory) NewConfigurationProfileAssignmentsClient added in v1.1.0

func (c *ClientFactory) NewConfigurationProfileAssignmentsClient() *ConfigurationProfileAssignmentsClient

NewConfigurationProfileAssignmentsClient creates a new instance of ConfigurationProfileAssignmentsClient.

func (*ClientFactory) NewConfigurationProfileHCIAssignmentsClient added in v1.1.0

func (c *ClientFactory) NewConfigurationProfileHCIAssignmentsClient() *ConfigurationProfileHCIAssignmentsClient

NewConfigurationProfileHCIAssignmentsClient creates a new instance of ConfigurationProfileHCIAssignmentsClient.

func (*ClientFactory) NewConfigurationProfileHCRPAssignmentsClient added in v1.1.0

func (c *ClientFactory) NewConfigurationProfileHCRPAssignmentsClient() *ConfigurationProfileHCRPAssignmentsClient

NewConfigurationProfileHCRPAssignmentsClient creates a new instance of ConfigurationProfileHCRPAssignmentsClient.

func (*ClientFactory) NewConfigurationProfilesClient added in v1.1.0

func (c *ClientFactory) NewConfigurationProfilesClient() *ConfigurationProfilesClient

NewConfigurationProfilesClient creates a new instance of ConfigurationProfilesClient.

func (*ClientFactory) NewConfigurationProfilesVersionsClient added in v1.1.0

func (c *ClientFactory) NewConfigurationProfilesVersionsClient() *ConfigurationProfilesVersionsClient

NewConfigurationProfilesVersionsClient creates a new instance of ConfigurationProfilesVersionsClient.

func (*ClientFactory) NewHCIReportsClient added in v1.1.0

func (c *ClientFactory) NewHCIReportsClient() *HCIReportsClient

NewHCIReportsClient creates a new instance of HCIReportsClient.

func (*ClientFactory) NewHCRPReportsClient added in v1.1.0

func (c *ClientFactory) NewHCRPReportsClient() *HCRPReportsClient

NewHCRPReportsClient creates a new instance of HCRPReportsClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewReportsClient added in v1.1.0

func (c *ClientFactory) NewReportsClient() *ReportsClient

NewReportsClient creates a new instance of ReportsClient.

func (*ClientFactory) NewServicePrincipalsClient added in v1.1.0

func (c *ClientFactory) NewServicePrincipalsClient() *ServicePrincipalsClient

NewServicePrincipalsClient creates a new instance of ServicePrincipalsClient.

type ConfigurationProfile

type ConfigurationProfile struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// Properties of the configuration profile.
	Properties *ConfigurationProfileProperties

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

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

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ConfigurationProfile - Definition of the configuration profile.

func (ConfigurationProfile) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationProfile.

func (*ConfigurationProfile) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProfile.

type ConfigurationProfileAssignment

type ConfigurationProfileAssignment struct {
	// Properties of the configuration profile assignment.
	Properties *ConfigurationProfileAssignmentProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; Azure resource id. Indicates if this resource is managed by another Azure resource.
	ManagedBy *string

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

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

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ConfigurationProfileAssignment - Configuration profile assignment is an association between a VM and automanage profile configuration.

func (ConfigurationProfileAssignment) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationProfileAssignment.

func (*ConfigurationProfileAssignment) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProfileAssignment.

type ConfigurationProfileAssignmentList

type ConfigurationProfileAssignmentList struct {
	// Result of the list configuration profile assignment operation.
	Value []*ConfigurationProfileAssignment
}

ConfigurationProfileAssignmentList - The response of the list configuration profile assignment operation.

func (ConfigurationProfileAssignmentList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationProfileAssignmentList.

func (*ConfigurationProfileAssignmentList) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProfileAssignmentList.

type ConfigurationProfileAssignmentProperties

type ConfigurationProfileAssignmentProperties struct {
	// The Automanage configurationProfile ARM Resource URI.
	ConfigurationProfile *string

	// READ-ONLY; The status of onboarding, which only appears in the response.
	Status *string

	// READ-ONLY; The target VM resource URI
	TargetID *string
}

ConfigurationProfileAssignmentProperties - Automanage configuration profile assignment properties.

func (ConfigurationProfileAssignmentProperties) MarshalJSON added in v0.2.0

MarshalJSON implements the json.Marshaller interface for type ConfigurationProfileAssignmentProperties.

func (*ConfigurationProfileAssignmentProperties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProfileAssignmentProperties.

type ConfigurationProfileAssignmentsClient

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

ConfigurationProfileAssignmentsClient contains the methods for the ConfigurationProfileAssignments group. Don't use this type directly, use NewConfigurationProfileAssignmentsClient() instead.

func NewConfigurationProfileAssignmentsClient

func NewConfigurationProfileAssignmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationProfileAssignmentsClient, error)

NewConfigurationProfileAssignmentsClient creates a new instance of ConfigurationProfileAssignmentsClient with the specified values.

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

func (*ConfigurationProfileAssignmentsClient) CreateOrUpdate added in v0.2.0

CreateOrUpdate - Creates an association between a VM and Automanage configuration profile If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • configurationProfileAssignmentName - Name of the configuration profile assignment. Only default is supported.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • vmName - The name of the virtual machine.
  • parameters - Parameters supplied to the create or update configuration profile assignment.
  • options - ConfigurationProfileAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/createOrUpdateConfigurationProfileAssignment.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/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationProfileAssignmentsClient().CreateOrUpdate(ctx, "default", "myResourceGroupName", "myVMName", armautomanage.ConfigurationProfileAssignment{
		Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
			ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"),
		},
	}, 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.ConfigurationProfileAssignment = armautomanage.ConfigurationProfileAssignment{
	// 	Name: to.Ptr("default"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/providers/Microsoft.Automanage/AutomanageAssignments/default"),
	// 	Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
	// 		ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"),
	// 		TargetID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName"),
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*ConfigurationProfileAssignmentsClient) Delete

Delete - Delete a configuration profile assignment If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • configurationProfileAssignmentName - Name of the configuration profile assignment
  • vmName - The name of the virtual machine.
  • options - ConfigurationProfileAssignmentsClientDeleteOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/deleteConfigurationProfileAssignment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewConfigurationProfileAssignmentsClient().Delete(ctx, "myResourceGroupName", "default", "myVMName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ConfigurationProfileAssignmentsClient) Get

Get - Get information about a configuration profile assignment If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • configurationProfileAssignmentName - The configuration profile assignment name.
  • vmName - The name of the virtual machine.
  • options - ConfigurationProfileAssignmentsClientGetOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/getConfigurationProfileAssignment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationProfileAssignmentsClient().Get(ctx, "myResourceGroupName", "default", "myVMName", 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.ConfigurationProfileAssignment = armautomanage.ConfigurationProfileAssignment{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
	// 	Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
	// 		ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest"),
	// 		Status: to.Ptr("Compliant"),
	// 		TargetID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName"),
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*ConfigurationProfileAssignmentsClient) NewListByClusterNamePager added in v0.5.0

NewListByClusterNamePager - Get list of configuration profile assignments

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - The name of the Arc machine.
  • options - ConfigurationProfileAssignmentsClientListByClusterNameOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.NewListByClusterNamePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listConfigurationProfileAssignmentsByClusterName.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationProfileAssignmentsClient().NewListByClusterNamePager("myResourceGroupName", "myClusterName", 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.ConfigurationProfileAssignmentList = armautomanage.ConfigurationProfileAssignmentList{
		// 	Value: []*armautomanage.ConfigurationProfileAssignment{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
		// 			Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
		// 				ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest"),
		// 				Status: to.Ptr("Compliant"),
		// 				TargetID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
		// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myArcMachineName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
		// 			Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
		// 				ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"),
		// 				Status: to.Ptr("NotCompliant "),
		// 				TargetID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myArcMachineName"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ConfigurationProfileAssignmentsClient) NewListByMachineNamePager added in v0.5.0

NewListByMachineNamePager - Get list of configuration profile assignments

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • machineName - The name of the Arc machine.
  • options - ConfigurationProfileAssignmentsClientListByMachineNameOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.NewListByMachineNamePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listConfigurationProfileAssignmentsByMachineName.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationProfileAssignmentsClient().NewListByMachineNamePager("myResourceGroupName", "myMachineName", 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.ConfigurationProfileAssignmentList = armautomanage.ConfigurationProfileAssignmentList{
		// 	Value: []*armautomanage.ConfigurationProfileAssignment{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
		// 			Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
		// 				ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest"),
		// 				Status: to.Ptr("Compliant"),
		// 				TargetID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
		// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myArcMachineName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
		// 			Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
		// 				ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"),
		// 				Status: to.Ptr("NotCompliant "),
		// 				TargetID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myArcMachineName"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ConfigurationProfileAssignmentsClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Get list of configuration profile assignments under a given subscription

Generated from API version 2022-05-04

  • options - ConfigurationProfileAssignmentsClientListBySubscriptionOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listConfigurationProfileAssignmentsBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationProfileAssignmentsClient().NewListBySubscriptionPager(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.ConfigurationProfileAssignmentList = armautomanage.ConfigurationProfileAssignmentList{
		// 	Value: []*armautomanage.ConfigurationProfileAssignment{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
		// 			Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
		// 				ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest"),
		// 				Status: to.Ptr("Compliant"),
		// 				TargetID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
		// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myArcMachineName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
		// 			Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
		// 				ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"),
		// 				Status: to.Ptr("NotCompliant "),
		// 				TargetID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myArcMachineName"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ConfigurationProfileAssignmentsClient) NewListByVirtualMachinesPager added in v0.5.0

NewListByVirtualMachinesPager - Get list of configuration profile assignments

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • vmName - The name of the virtual machine.
  • options - ConfigurationProfileAssignmentsClientListByVirtualMachinesOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.NewListByVirtualMachinesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listConfigurationProfileAssignmentsByVirtualMachines.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationProfileAssignmentsClient().NewListByVirtualMachinesPager("myResourceGroupName", "myVMName", 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.ConfigurationProfileAssignmentList = armautomanage.ConfigurationProfileAssignmentList{
		// 	Value: []*armautomanage.ConfigurationProfileAssignment{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
		// 			Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
		// 				ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest"),
		// 				Status: to.Ptr("Compliant"),
		// 				TargetID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
		// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myArcMachineName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
		// 			Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
		// 				ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"),
		// 				Status: to.Ptr("NotCompliant "),
		// 				TargetID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myArcMachineName"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ConfigurationProfileAssignmentsClient) NewListPager added in v0.4.0

NewListPager - Get list of configuration profile assignments

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ConfigurationProfileAssignmentsClientListOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listConfigurationProfileAssignmentsByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationProfileAssignmentsClient().NewListPager("myResourceGroupName", 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.ConfigurationProfileAssignmentList = armautomanage.ConfigurationProfileAssignmentList{
		// 	Value: []*armautomanage.ConfigurationProfileAssignment{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
		// 			Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
		// 				ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest"),
		// 				Status: to.Ptr("Compliant"),
		// 				TargetID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
		// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myArcMachineName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
		// 			Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
		// 				ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"),
		// 				Status: to.Ptr("NotCompliant "),
		// 				TargetID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myArcMachineName"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ConfigurationProfileAssignmentsClientCreateOrUpdateOptions added in v0.2.0

type ConfigurationProfileAssignmentsClientCreateOrUpdateOptions struct {
}

ConfigurationProfileAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.CreateOrUpdate method.

type ConfigurationProfileAssignmentsClientCreateOrUpdateResponse added in v0.2.0

type ConfigurationProfileAssignmentsClientCreateOrUpdateResponse struct {
	// Configuration profile assignment is an association between a VM and automanage profile configuration.
	ConfigurationProfileAssignment
}

ConfigurationProfileAssignmentsClientCreateOrUpdateResponse contains the response from method ConfigurationProfileAssignmentsClient.CreateOrUpdate.

type ConfigurationProfileAssignmentsClientDeleteOptions added in v0.2.0

type ConfigurationProfileAssignmentsClientDeleteOptions struct {
}

ConfigurationProfileAssignmentsClientDeleteOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.Delete method.

type ConfigurationProfileAssignmentsClientDeleteResponse added in v0.2.0

type ConfigurationProfileAssignmentsClientDeleteResponse struct {
}

ConfigurationProfileAssignmentsClientDeleteResponse contains the response from method ConfigurationProfileAssignmentsClient.Delete.

type ConfigurationProfileAssignmentsClientGetOptions added in v0.2.0

type ConfigurationProfileAssignmentsClientGetOptions struct {
}

ConfigurationProfileAssignmentsClientGetOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.Get method.

type ConfigurationProfileAssignmentsClientGetResponse added in v0.2.0

type ConfigurationProfileAssignmentsClientGetResponse struct {
	// Configuration profile assignment is an association between a VM and automanage profile configuration.
	ConfigurationProfileAssignment
}

ConfigurationProfileAssignmentsClientGetResponse contains the response from method ConfigurationProfileAssignmentsClient.Get.

type ConfigurationProfileAssignmentsClientListByClusterNameOptions added in v0.5.0

type ConfigurationProfileAssignmentsClientListByClusterNameOptions struct {
}

ConfigurationProfileAssignmentsClientListByClusterNameOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.NewListByClusterNamePager method.

type ConfigurationProfileAssignmentsClientListByClusterNameResponse added in v0.5.0

type ConfigurationProfileAssignmentsClientListByClusterNameResponse struct {
	// The response of the list configuration profile assignment operation.
	ConfigurationProfileAssignmentList
}

ConfigurationProfileAssignmentsClientListByClusterNameResponse contains the response from method ConfigurationProfileAssignmentsClient.NewListByClusterNamePager.

type ConfigurationProfileAssignmentsClientListByMachineNameOptions added in v0.5.0

type ConfigurationProfileAssignmentsClientListByMachineNameOptions struct {
}

ConfigurationProfileAssignmentsClientListByMachineNameOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.NewListByMachineNamePager method.

type ConfigurationProfileAssignmentsClientListByMachineNameResponse added in v0.5.0

type ConfigurationProfileAssignmentsClientListByMachineNameResponse struct {
	// The response of the list configuration profile assignment operation.
	ConfigurationProfileAssignmentList
}

ConfigurationProfileAssignmentsClientListByMachineNameResponse contains the response from method ConfigurationProfileAssignmentsClient.NewListByMachineNamePager.

type ConfigurationProfileAssignmentsClientListBySubscriptionOptions added in v0.2.0

type ConfigurationProfileAssignmentsClientListBySubscriptionOptions struct {
}

ConfigurationProfileAssignmentsClientListBySubscriptionOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.NewListBySubscriptionPager method.

type ConfigurationProfileAssignmentsClientListBySubscriptionResponse added in v0.2.0

type ConfigurationProfileAssignmentsClientListBySubscriptionResponse struct {
	// The response of the list configuration profile assignment operation.
	ConfigurationProfileAssignmentList
}

ConfigurationProfileAssignmentsClientListBySubscriptionResponse contains the response from method ConfigurationProfileAssignmentsClient.NewListBySubscriptionPager.

type ConfigurationProfileAssignmentsClientListByVirtualMachinesOptions added in v0.5.0

type ConfigurationProfileAssignmentsClientListByVirtualMachinesOptions struct {
}

ConfigurationProfileAssignmentsClientListByVirtualMachinesOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.NewListByVirtualMachinesPager method.

type ConfigurationProfileAssignmentsClientListByVirtualMachinesResponse added in v0.5.0

type ConfigurationProfileAssignmentsClientListByVirtualMachinesResponse struct {
	// The response of the list configuration profile assignment operation.
	ConfigurationProfileAssignmentList
}

ConfigurationProfileAssignmentsClientListByVirtualMachinesResponse contains the response from method ConfigurationProfileAssignmentsClient.NewListByVirtualMachinesPager.

type ConfigurationProfileAssignmentsClientListOptions added in v0.2.0

type ConfigurationProfileAssignmentsClientListOptions struct {
}

ConfigurationProfileAssignmentsClientListOptions contains the optional parameters for the ConfigurationProfileAssignmentsClient.NewListPager method.

type ConfigurationProfileAssignmentsClientListResponse added in v0.2.0

type ConfigurationProfileAssignmentsClientListResponse struct {
	// The response of the list configuration profile assignment operation.
	ConfigurationProfileAssignmentList
}

ConfigurationProfileAssignmentsClientListResponse contains the response from method ConfigurationProfileAssignmentsClient.NewListPager.

type ConfigurationProfileHCIAssignmentsClient added in v0.5.0

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

ConfigurationProfileHCIAssignmentsClient contains the methods for the ConfigurationProfileHCIAssignments group. Don't use this type directly, use NewConfigurationProfileHCIAssignmentsClient() instead.

func NewConfigurationProfileHCIAssignmentsClient added in v0.5.0

func NewConfigurationProfileHCIAssignmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationProfileHCIAssignmentsClient, error)

NewConfigurationProfileHCIAssignmentsClient creates a new instance of ConfigurationProfileHCIAssignmentsClient with the specified values.

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

func (*ConfigurationProfileHCIAssignmentsClient) CreateOrUpdate added in v0.5.0

CreateOrUpdate - Creates an association between a AzureStackHCI cluster and Automanage configuration profile If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - The name of the Arc machine.
  • configurationProfileAssignmentName - Name of the configuration profile assignment. Only default is supported.
  • parameters - Parameters supplied to the create or update configuration profile assignment.
  • options - ConfigurationProfileHCIAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationProfileHCIAssignmentsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/createOrUpdateConfigurationProfileHCIAssignment.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/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationProfileHCIAssignmentsClient().CreateOrUpdate(ctx, "myResourceGroupName", "myClusterName", "default", armautomanage.ConfigurationProfileAssignment{
		Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
			ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"),
		},
	}, 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.ConfigurationProfileAssignment = armautomanage.ConfigurationProfileAssignment{
	// 	Name: to.Ptr("default"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.AzureStackHci/clusters/myClusterName/providers/Microsoft.Automanage/AutomanageAssignments/default"),
	// 	Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
	// 		ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"),
	// 		TargetID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.AzureStackHci/clusters/myClusterName"),
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*ConfigurationProfileHCIAssignmentsClient) Delete added in v0.5.0

Delete - Delete a configuration profile assignment If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - The name of the Arc machine.
  • configurationProfileAssignmentName - Name of the configuration profile assignment
  • options - ConfigurationProfileHCIAssignmentsClientDeleteOptions contains the optional parameters for the ConfigurationProfileHCIAssignmentsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/deleteConfigurationProfileHCIAssignment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewConfigurationProfileHCIAssignmentsClient().Delete(ctx, "myResourceGroupName", "myClusterName", "default", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ConfigurationProfileHCIAssignmentsClient) Get added in v0.5.0

Get - Get information about a configuration profile assignment If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - The name of the Arc machine.
  • configurationProfileAssignmentName - The configuration profile assignment name.
  • options - ConfigurationProfileHCIAssignmentsClientGetOptions contains the optional parameters for the ConfigurationProfileHCIAssignmentsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/getConfigurationProfileHCIAssignment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationProfileHCIAssignmentsClient().Get(ctx, "myResourceGroupName", "myClusterName", "default", 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.ConfigurationProfileAssignment = armautomanage.ConfigurationProfileAssignment{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/Microsoft.AzureStackHci/clusters/machines/myClusterName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
	// 	Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
	// 		ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest"),
	// 		Status: to.Ptr("Compliant"),
	// 		TargetID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/Microsoft.AzureStackHci/clusters/machines/myClusterName"),
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

type ConfigurationProfileHCIAssignmentsClientCreateOrUpdateOptions added in v0.5.0

type ConfigurationProfileHCIAssignmentsClientCreateOrUpdateOptions struct {
}

ConfigurationProfileHCIAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationProfileHCIAssignmentsClient.CreateOrUpdate method.

type ConfigurationProfileHCIAssignmentsClientCreateOrUpdateResponse added in v0.5.0

type ConfigurationProfileHCIAssignmentsClientCreateOrUpdateResponse struct {
	// Configuration profile assignment is an association between a VM and automanage profile configuration.
	ConfigurationProfileAssignment
}

ConfigurationProfileHCIAssignmentsClientCreateOrUpdateResponse contains the response from method ConfigurationProfileHCIAssignmentsClient.CreateOrUpdate.

type ConfigurationProfileHCIAssignmentsClientDeleteOptions added in v0.5.0

type ConfigurationProfileHCIAssignmentsClientDeleteOptions struct {
}

ConfigurationProfileHCIAssignmentsClientDeleteOptions contains the optional parameters for the ConfigurationProfileHCIAssignmentsClient.Delete method.

type ConfigurationProfileHCIAssignmentsClientDeleteResponse added in v0.5.0

type ConfigurationProfileHCIAssignmentsClientDeleteResponse struct {
}

ConfigurationProfileHCIAssignmentsClientDeleteResponse contains the response from method ConfigurationProfileHCIAssignmentsClient.Delete.

type ConfigurationProfileHCIAssignmentsClientGetOptions added in v0.5.0

type ConfigurationProfileHCIAssignmentsClientGetOptions struct {
}

ConfigurationProfileHCIAssignmentsClientGetOptions contains the optional parameters for the ConfigurationProfileHCIAssignmentsClient.Get method.

type ConfigurationProfileHCIAssignmentsClientGetResponse added in v0.5.0

type ConfigurationProfileHCIAssignmentsClientGetResponse struct {
	// Configuration profile assignment is an association between a VM and automanage profile configuration.
	ConfigurationProfileAssignment
}

ConfigurationProfileHCIAssignmentsClientGetResponse contains the response from method ConfigurationProfileHCIAssignmentsClient.Get.

type ConfigurationProfileHCRPAssignmentsClient added in v0.5.0

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

ConfigurationProfileHCRPAssignmentsClient contains the methods for the ConfigurationProfileHCRPAssignments group. Don't use this type directly, use NewConfigurationProfileHCRPAssignmentsClient() instead.

func NewConfigurationProfileHCRPAssignmentsClient added in v0.5.0

func NewConfigurationProfileHCRPAssignmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationProfileHCRPAssignmentsClient, error)

NewConfigurationProfileHCRPAssignmentsClient creates a new instance of ConfigurationProfileHCRPAssignmentsClient with the specified values.

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

func (*ConfigurationProfileHCRPAssignmentsClient) CreateOrUpdate added in v0.5.0

CreateOrUpdate - Creates an association between a ARC machine and Automanage configuration profile If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • machineName - The name of the Arc machine.
  • configurationProfileAssignmentName - Name of the configuration profile assignment. Only default is supported.
  • parameters - Parameters supplied to the create or update configuration profile assignment.
  • options - ConfigurationProfileHCRPAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationProfileHCRPAssignmentsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/createOrUpdateConfigurationProfileHCRPAssignment.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/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationProfileHCRPAssignmentsClient().CreateOrUpdate(ctx, "myResourceGroupName", "myMachineName", "default", armautomanage.ConfigurationProfileAssignment{
		Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
			ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"),
		},
	}, 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.ConfigurationProfileAssignment = armautomanage.ConfigurationProfileAssignment{
	// 	Name: to.Ptr("default"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myMachineName/providers/Microsoft.Automanage/AutomanageAssignments/default"),
	// 	Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
	// 		ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"),
	// 		TargetID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myMachineName"),
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*ConfigurationProfileHCRPAssignmentsClient) Delete added in v0.5.0

Delete - Delete a configuration profile assignment If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • machineName - The name of the Arc machine.
  • configurationProfileAssignmentName - Name of the configuration profile assignment
  • options - ConfigurationProfileHCRPAssignmentsClientDeleteOptions contains the optional parameters for the ConfigurationProfileHCRPAssignmentsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/deleteConfigurationProfileHCRPAssignment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewConfigurationProfileHCRPAssignmentsClient().Delete(ctx, "myResourceGroupName", "myMachineName", "default", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ConfigurationProfileHCRPAssignmentsClient) Get added in v0.5.0

Get - Get information about a configuration profile assignment If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • machineName - The name of the Arc machine.
  • configurationProfileAssignmentName - The configuration profile assignment name.
  • options - ConfigurationProfileHCRPAssignmentsClientGetOptions contains the optional parameters for the ConfigurationProfileHCRPAssignmentsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/getConfigurationProfileHCRPAssignment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationProfileHCRPAssignmentsClient().Get(ctx, "myResourceGroupName", "myMachineName", "default", 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.ConfigurationProfileAssignment = armautomanage.ConfigurationProfileAssignment{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myMachineName/providers/Microsoft.Automanage/configurationProfileAssignments/default"),
	// 	Properties: &armautomanage.ConfigurationProfileAssignmentProperties{
	// 		ConfigurationProfile: to.Ptr("/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest"),
	// 		Status: to.Ptr("Compliant"),
	// 		TargetID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myMachineName"),
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

type ConfigurationProfileHCRPAssignmentsClientCreateOrUpdateOptions added in v0.5.0

type ConfigurationProfileHCRPAssignmentsClientCreateOrUpdateOptions struct {
}

ConfigurationProfileHCRPAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationProfileHCRPAssignmentsClient.CreateOrUpdate method.

type ConfigurationProfileHCRPAssignmentsClientCreateOrUpdateResponse added in v0.5.0

type ConfigurationProfileHCRPAssignmentsClientCreateOrUpdateResponse struct {
	// Configuration profile assignment is an association between a VM and automanage profile configuration.
	ConfigurationProfileAssignment
}

ConfigurationProfileHCRPAssignmentsClientCreateOrUpdateResponse contains the response from method ConfigurationProfileHCRPAssignmentsClient.CreateOrUpdate.

type ConfigurationProfileHCRPAssignmentsClientDeleteOptions added in v0.5.0

type ConfigurationProfileHCRPAssignmentsClientDeleteOptions struct {
}

ConfigurationProfileHCRPAssignmentsClientDeleteOptions contains the optional parameters for the ConfigurationProfileHCRPAssignmentsClient.Delete method.

type ConfigurationProfileHCRPAssignmentsClientDeleteResponse added in v0.5.0

type ConfigurationProfileHCRPAssignmentsClientDeleteResponse struct {
}

ConfigurationProfileHCRPAssignmentsClientDeleteResponse contains the response from method ConfigurationProfileHCRPAssignmentsClient.Delete.

type ConfigurationProfileHCRPAssignmentsClientGetOptions added in v0.5.0

type ConfigurationProfileHCRPAssignmentsClientGetOptions struct {
}

ConfigurationProfileHCRPAssignmentsClientGetOptions contains the optional parameters for the ConfigurationProfileHCRPAssignmentsClient.Get method.

type ConfigurationProfileHCRPAssignmentsClientGetResponse added in v0.5.0

type ConfigurationProfileHCRPAssignmentsClientGetResponse struct {
	// Configuration profile assignment is an association between a VM and automanage profile configuration.
	ConfigurationProfileAssignment
}

ConfigurationProfileHCRPAssignmentsClientGetResponse contains the response from method ConfigurationProfileHCRPAssignmentsClient.Get.

type ConfigurationProfileList added in v0.2.0

type ConfigurationProfileList struct {
	// Result of the list ConfigurationProfile operation.
	Value []*ConfigurationProfile
}

ConfigurationProfileList - The response of the list configuration profile operation.

func (ConfigurationProfileList) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationProfileList.

func (*ConfigurationProfileList) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProfileList.

type ConfigurationProfileProperties added in v0.2.0

type ConfigurationProfileProperties struct {
	// configuration dictionary of the configuration profile.
	Configuration any
}

ConfigurationProfileProperties - Automanage configuration profile properties.

func (ConfigurationProfileProperties) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationProfileProperties.

func (*ConfigurationProfileProperties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProfileProperties.

type ConfigurationProfileUpdate added in v0.2.0

type ConfigurationProfileUpdate struct {
	// Properties of the configuration profile.
	Properties *ConfigurationProfileProperties

	// The tags of the resource.
	Tags map[string]*string
}

ConfigurationProfileUpdate - Definition of the configuration profile.

func (ConfigurationProfileUpdate) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationProfileUpdate.

func (*ConfigurationProfileUpdate) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProfileUpdate.

type ConfigurationProfilesClient added in v0.2.0

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

ConfigurationProfilesClient contains the methods for the ConfigurationProfiles group. Don't use this type directly, use NewConfigurationProfilesClient() instead.

func NewConfigurationProfilesClient added in v0.2.0

func NewConfigurationProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationProfilesClient, error)

NewConfigurationProfilesClient creates a new instance of ConfigurationProfilesClient with the specified values.

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

func (*ConfigurationProfilesClient) CreateOrUpdate added in v0.2.0

CreateOrUpdate - Creates a configuration profile If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • configurationProfileName - Name of the configuration profile.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • parameters - Parameters supplied to create or update configuration profile.
  • options - ConfigurationProfilesClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationProfilesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/createOrUpdateConfigurationProfile.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/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationProfilesClient().CreateOrUpdate(ctx, "customConfigurationProfile", "myResourceGroupName", armautomanage.ConfigurationProfile{
		Location: to.Ptr("East US"),
		Tags: map[string]*string{
			"Organization": to.Ptr("Administration"),
		},
		Properties: &armautomanage.ConfigurationProfileProperties{
			Configuration: map[string]any{
				"Antimalware/Enable":                false,
				"AzureSecurityCenter/Enable":        true,
				"Backup/Enable":                     false,
				"BootDiagnostics/Enable":            true,
				"ChangeTrackingAndInventory/Enable": true,
				"GuestConfiguration/Enable":         true,
				"LogAnalytics/Enable":               true,
				"UpdateManagement/Enable":           true,
				"VMInsights/Enable":                 true,
			},
		},
	}, 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.ConfigurationProfile = armautomanage.ConfigurationProfile{
	// 	Name: to.Ptr("customConfigurationProfile"),
	// 	Type: to.Ptr("Microsoft.Automanage/configurationProfiles"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customConfigurationProfile"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 		"Organization": to.Ptr("Administration"),
	// 	},
	// 	Properties: &armautomanage.ConfigurationProfileProperties{
	// 		Configuration: map[string]any{
	// 			"Antimalware/Enable": false,
	// 			"AzureSecurityCenter/Enable": true,
	// 			"Backup/Enable": false,
	// 			"BootDiagnostics/Enable": true,
	// 			"ChangeTrackingAndInventory/Enable": true,
	// 			"GuestConfiguration/Enable": true,
	// 			"LogAnalytics/Enable": true,
	// 			"UpdateManagement/Enable": true,
	// 			"VMInsights/Enable": true,
	// 		},
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*ConfigurationProfilesClient) Delete added in v0.2.0

func (client *ConfigurationProfilesClient) Delete(ctx context.Context, resourceGroupName string, configurationProfileName string, options *ConfigurationProfilesClientDeleteOptions) (ConfigurationProfilesClientDeleteResponse, error)

Delete - Delete a configuration profile If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • configurationProfileName - Name of the configuration profile
  • options - ConfigurationProfilesClientDeleteOptions contains the optional parameters for the ConfigurationProfilesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/deleteConfigurationProfile.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewConfigurationProfilesClient().Delete(ctx, "rg", "customConfigurationProfile", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ConfigurationProfilesClient) Get added in v0.2.0

func (client *ConfigurationProfilesClient) Get(ctx context.Context, configurationProfileName string, resourceGroupName string, options *ConfigurationProfilesClientGetOptions) (ConfigurationProfilesClientGetResponse, error)

Get - Get information about a configuration profile If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • configurationProfileName - The configuration profile name.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ConfigurationProfilesClientGetOptions contains the optional parameters for the ConfigurationProfilesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/getConfigurationProfile.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationProfilesClient().Get(ctx, "customConfigurationProfile", "myResourceGroupName", 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.ConfigurationProfile = armautomanage.ConfigurationProfile{
	// 	Name: to.Ptr("customConfigurationProfile"),
	// 	Type: to.Ptr("Microsoft.Automanage/ConfigurationProfiles"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customConfigurationProfile"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 		"Organization": to.Ptr("Administration"),
	// 	},
	// 	Properties: &armautomanage.ConfigurationProfileProperties{
	// 		Configuration: map[string]any{
	// 			"Antimalware/Enable": false,
	// 			"AzureSecurityCenter/Enable": true,
	// 			"Backup/Enable": false,
	// 			"BootDiagnostics/Enable": true,
	// 			"ChangeTrackingAndInventory/Enable": true,
	// 			"GuestConfiguration/Enable": true,
	// 			"LogAnalytics/Enable": true,
	// 			"UpdateManagement/Enable": true,
	// 			"VMInsights/Enable": true,
	// 		},
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*ConfigurationProfilesClient) NewListByResourceGroupPager added in v0.4.0

NewListByResourceGroupPager - Retrieve a list of configuration profile within a given resource group

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ConfigurationProfilesClientListByResourceGroupOptions contains the optional parameters for the ConfigurationProfilesClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listConfigurationProfilesByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationProfilesClient().NewListByResourceGroupPager("myResourceGroupName", 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.ConfigurationProfileList = armautomanage.ConfigurationProfileList{
		// 	Value: []*armautomanage.ConfigurationProfile{
		// 		{
		// 			Name: to.Ptr("customConfigurationProfile"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfiles"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customConfigurationProfile"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 				"Organization": to.Ptr("Administration"),
		// 			},
		// 			Properties: &armautomanage.ConfigurationProfileProperties{
		// 				Configuration: map[string]any{
		// 					"Antimalware/Enable": false,
		// 					"AzureSecurityCenter/Enable": true,
		// 					"Backup/Enable": false,
		// 					"BootDiagnostics/Enable": true,
		// 					"ChangeTrackingAndInventory/Enable": true,
		// 					"GuestConfiguration/Enable": true,
		// 					"LogAnalytics/Enable": true,
		// 					"UpdateManagement/Enable": true,
		// 					"VMInsights/Enable": true,
		// 				},
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("customConfigurationProfile2"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfiles"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customConfigurationProfile2"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 				"Organization": to.Ptr("Administration"),
		// 			},
		// 			Properties: &armautomanage.ConfigurationProfileProperties{
		// 				Configuration: map[string]any{
		// 					"Antimalware/Enable": false,
		// 					"AzureSecurityCenter/Enable": true,
		// 					"Backup/Enable": false,
		// 					"BootDiagnostics/Enable": true,
		// 					"ChangeTrackingAndInventory/Enable": true,
		// 					"GuestConfiguration/Enable": true,
		// 					"LogAnalytics/Enable": true,
		// 					"UpdateManagement/Enable": true,
		// 					"VMInsights/Enable": true,
		// 				},
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ConfigurationProfilesClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Retrieve a list of configuration profile within a subscription

Generated from API version 2022-05-04

  • options - ConfigurationProfilesClientListBySubscriptionOptions contains the optional parameters for the ConfigurationProfilesClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listConfigurationProfilesBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationProfilesClient().NewListBySubscriptionPager(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.ConfigurationProfileList = armautomanage.ConfigurationProfileList{
		// 	Value: []*armautomanage.ConfigurationProfile{
		// 		{
		// 			Name: to.Ptr("customConfigurationProfile"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfiles"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customConfigurationProfile"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 				"Organization": to.Ptr("Administration"),
		// 			},
		// 			Properties: &armautomanage.ConfigurationProfileProperties{
		// 				Configuration: map[string]any{
		// 					"Antimalware/Enable": false,
		// 					"AzureSecurityCenter/Enable": true,
		// 					"Backup/Enable": false,
		// 					"BootDiagnostics/Enable": true,
		// 					"ChangeTrackingAndInventory/Enable": true,
		// 					"GuestConfiguration/Enable": true,
		// 					"LogAnalytics/Enable": true,
		// 					"UpdateManagement/Enable": true,
		// 					"VMInsights/Enable": true,
		// 				},
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("customConfigurationProfile2"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfiles"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customConfigurationProfile2"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 				"Organization": to.Ptr("Administration"),
		// 			},
		// 			Properties: &armautomanage.ConfigurationProfileProperties{
		// 				Configuration: map[string]any{
		// 					"Antimalware/Enable": false,
		// 					"AzureSecurityCenter/Enable": true,
		// 					"Backup/Enable": false,
		// 					"BootDiagnostics/Enable": true,
		// 					"ChangeTrackingAndInventory/Enable": true,
		// 					"GuestConfiguration/Enable": true,
		// 					"LogAnalytics/Enable": true,
		// 					"UpdateManagement/Enable": true,
		// 					"VMInsights/Enable": true,
		// 				},
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ConfigurationProfilesClient) Update added in v0.2.0

Update - Updates a configuration profile If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • configurationProfileName - Name of the configuration profile.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • parameters - Parameters supplied to update configuration profile.
  • options - ConfigurationProfilesClientUpdateOptions contains the optional parameters for the ConfigurationProfilesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/updateConfigurationProfile.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/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationProfilesClient().Update(ctx, "customConfigurationProfile", "myResourceGroupName", armautomanage.ConfigurationProfileUpdate{
		Tags: map[string]*string{
			"Organization": to.Ptr("Administration"),
		},
		Properties: &armautomanage.ConfigurationProfileProperties{
			Configuration: map[string]any{
				"Antimalware/Enable":                false,
				"AzureSecurityCenter/Enable":        true,
				"Backup/Enable":                     false,
				"BootDiagnostics/Enable":            true,
				"ChangeTrackingAndInventory/Enable": true,
				"GuestConfiguration/Enable":         true,
				"LogAnalytics/Enable":               true,
				"UpdateManagement/Enable":           true,
				"VMInsights/Enable":                 true,
			},
		},
	}, 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.ConfigurationProfile = armautomanage.ConfigurationProfile{
	// 	Name: to.Ptr("customConfigurationProfile"),
	// 	Type: to.Ptr("Microsoft.Automanage/configurationProfiles"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customConfigurationProfile"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 		"Organization": to.Ptr("Administration"),
	// 	},
	// 	Properties: &armautomanage.ConfigurationProfileProperties{
	// 		Configuration: map[string]any{
	// 			"Antimalware/Enable": false,
	// 			"AzureSecurityCenter/Enable": true,
	// 			"Backup/Enable": false,
	// 			"BootDiagnostics/Enable": true,
	// 			"ChangeTrackingAndInventory/Enable": true,
	// 			"GuestConfiguration/Enable": true,
	// 			"LogAnalytics/Enable": true,
	// 			"UpdateManagement/Enable": true,
	// 			"VMInsights/Enable": true,
	// 		},
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

type ConfigurationProfilesClientCreateOrUpdateOptions added in v0.2.0

type ConfigurationProfilesClientCreateOrUpdateOptions struct {
}

ConfigurationProfilesClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationProfilesClient.CreateOrUpdate method.

type ConfigurationProfilesClientCreateOrUpdateResponse added in v0.2.0

type ConfigurationProfilesClientCreateOrUpdateResponse struct {
	// Definition of the configuration profile.
	ConfigurationProfile
}

ConfigurationProfilesClientCreateOrUpdateResponse contains the response from method ConfigurationProfilesClient.CreateOrUpdate.

type ConfigurationProfilesClientDeleteOptions added in v0.2.0

type ConfigurationProfilesClientDeleteOptions struct {
}

ConfigurationProfilesClientDeleteOptions contains the optional parameters for the ConfigurationProfilesClient.Delete method.

type ConfigurationProfilesClientDeleteResponse added in v0.2.0

type ConfigurationProfilesClientDeleteResponse struct {
}

ConfigurationProfilesClientDeleteResponse contains the response from method ConfigurationProfilesClient.Delete.

type ConfigurationProfilesClientGetOptions added in v0.2.0

type ConfigurationProfilesClientGetOptions struct {
}

ConfigurationProfilesClientGetOptions contains the optional parameters for the ConfigurationProfilesClient.Get method.

type ConfigurationProfilesClientGetResponse added in v0.2.0

type ConfigurationProfilesClientGetResponse struct {
	// Definition of the configuration profile.
	ConfigurationProfile
}

ConfigurationProfilesClientGetResponse contains the response from method ConfigurationProfilesClient.Get.

type ConfigurationProfilesClientListByResourceGroupOptions added in v0.2.0

type ConfigurationProfilesClientListByResourceGroupOptions struct {
}

ConfigurationProfilesClientListByResourceGroupOptions contains the optional parameters for the ConfigurationProfilesClient.NewListByResourceGroupPager method.

type ConfigurationProfilesClientListByResourceGroupResponse added in v0.2.0

type ConfigurationProfilesClientListByResourceGroupResponse struct {
	// The response of the list configuration profile operation.
	ConfigurationProfileList
}

ConfigurationProfilesClientListByResourceGroupResponse contains the response from method ConfigurationProfilesClient.NewListByResourceGroupPager.

type ConfigurationProfilesClientListBySubscriptionOptions added in v0.2.0

type ConfigurationProfilesClientListBySubscriptionOptions struct {
}

ConfigurationProfilesClientListBySubscriptionOptions contains the optional parameters for the ConfigurationProfilesClient.NewListBySubscriptionPager method.

type ConfigurationProfilesClientListBySubscriptionResponse added in v0.2.0

type ConfigurationProfilesClientListBySubscriptionResponse struct {
	// The response of the list configuration profile operation.
	ConfigurationProfileList
}

ConfigurationProfilesClientListBySubscriptionResponse contains the response from method ConfigurationProfilesClient.NewListBySubscriptionPager.

type ConfigurationProfilesClientUpdateOptions added in v0.2.0

type ConfigurationProfilesClientUpdateOptions struct {
}

ConfigurationProfilesClientUpdateOptions contains the optional parameters for the ConfigurationProfilesClient.Update method.

type ConfigurationProfilesClientUpdateResponse added in v0.2.0

type ConfigurationProfilesClientUpdateResponse struct {
	// Definition of the configuration profile.
	ConfigurationProfile
}

ConfigurationProfilesClientUpdateResponse contains the response from method ConfigurationProfilesClient.Update.

type ConfigurationProfilesVersionsClient added in v0.2.0

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

ConfigurationProfilesVersionsClient contains the methods for the ConfigurationProfilesVersions group. Don't use this type directly, use NewConfigurationProfilesVersionsClient() instead.

func NewConfigurationProfilesVersionsClient added in v0.2.0

func NewConfigurationProfilesVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationProfilesVersionsClient, error)

NewConfigurationProfilesVersionsClient creates a new instance of ConfigurationProfilesVersionsClient with the specified values.

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

func (*ConfigurationProfilesVersionsClient) CreateOrUpdate added in v0.2.0

CreateOrUpdate - Creates a configuration profile version If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • configurationProfileName - Name of the configuration profile.
  • versionName - The configuration profile version name.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • parameters - Parameters supplied to create or update configuration profile.
  • options - ConfigurationProfilesVersionsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationProfilesVersionsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/createOrUpdateConfigurationProfileVersion.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/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationProfilesVersionsClient().CreateOrUpdate(ctx, "customConfigurationProfile", "version1", "myResourceGroupName", armautomanage.ConfigurationProfile{
		Location: to.Ptr("East US"),
		Tags: map[string]*string{
			"Organization": to.Ptr("Administration"),
		},
		Properties: &armautomanage.ConfigurationProfileProperties{
			Configuration: map[string]any{
				"Antimalware/Enable":                false,
				"AzureSecurityCenter/Enable":        true,
				"Backup/Enable":                     false,
				"BootDiagnostics/Enable":            true,
				"ChangeTrackingAndInventory/Enable": true,
				"GuestConfiguration/Enable":         true,
				"LogAnalytics/Enable":               true,
				"UpdateManagement/Enable":           true,
				"VMInsights/Enable":                 true,
			},
		},
	}, 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.ConfigurationProfile = armautomanage.ConfigurationProfile{
	// 	Name: to.Ptr("customConfigurationProfile/version1"),
	// 	Type: to.Ptr("Microsoft.Automanage/configurationProfiles/versions"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customConfigurationProfile/versions/version1"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 		"Organization": to.Ptr("Administration"),
	// 	},
	// 	Properties: &armautomanage.ConfigurationProfileProperties{
	// 		Configuration: map[string]any{
	// 			"Antimalware/Enable": false,
	// 			"AzureSecurityCenter/Enable": true,
	// 			"Backup/Enable": false,
	// 			"BootDiagnostics/Enable": true,
	// 			"ChangeTrackingAndInventory/Enable": true,
	// 			"GuestConfiguration/Enable": true,
	// 			"LogAnalytics/Enable": true,
	// 			"UpdateManagement/Enable": true,
	// 			"VMInsights/Enable": true,
	// 		},
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*ConfigurationProfilesVersionsClient) Delete added in v0.2.0

Delete - Delete a configuration profile version If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • configurationProfileName - Name of the configuration profile
  • versionName - The configuration profile version name.
  • options - ConfigurationProfilesVersionsClientDeleteOptions contains the optional parameters for the ConfigurationProfilesVersionsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/deleteConfigurationProfileVersion.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewConfigurationProfilesVersionsClient().Delete(ctx, "rg", "customConfigurationProfile", "version1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ConfigurationProfilesVersionsClient) Get added in v0.2.0

Get - Get information about a configuration profile version If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • configurationProfileName - The configuration profile name.
  • versionName - The configuration profile version name.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ConfigurationProfilesVersionsClientGetOptions contains the optional parameters for the ConfigurationProfilesVersionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/getConfigurationProfileVersion.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationProfilesVersionsClient().Get(ctx, "customConfigurationProfile", "version1", "myResourceGroupName", 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.ConfigurationProfile = armautomanage.ConfigurationProfile{
	// 	Name: to.Ptr("customConfigurationProfile/version1"),
	// 	Type: to.Ptr("Microsoft.Automanage/ConfigurationProfiles/versions"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customConfigurationProfile/versions/version1"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 		"Organization": to.Ptr("Administration"),
	// 	},
	// 	Properties: &armautomanage.ConfigurationProfileProperties{
	// 		Configuration: map[string]any{
	// 			"Antimalware/Enable": false,
	// 			"AzureSecurityCenter/Enable": true,
	// 			"Backup/Enable": false,
	// 			"BootDiagnostics/Enable": true,
	// 			"ChangeTrackingAndInventory/Enable": true,
	// 			"GuestConfiguration/Enable": true,
	// 			"LogAnalytics/Enable": true,
	// 			"UpdateManagement/Enable": true,
	// 			"VMInsights/Enable": true,
	// 		},
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*ConfigurationProfilesVersionsClient) NewListChildResourcesPager added in v0.4.0

NewListChildResourcesPager - Retrieve a list of configuration profile version for a configuration profile

Generated from API version 2022-05-04

  • configurationProfileName - Name of the configuration profile.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ConfigurationProfilesVersionsClientListChildResourcesOptions contains the optional parameters for the ConfigurationProfilesVersionsClient.NewListChildResourcesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listConfigurationProfileVersions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationProfilesVersionsClient().NewListChildResourcesPager("customConfigurationProfile", "myResourceGroupName", 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.ConfigurationProfileList = armautomanage.ConfigurationProfileList{
		// 	Value: []*armautomanage.ConfigurationProfile{
		// 		{
		// 			Name: to.Ptr("customConfigurationProfile/version1"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfiles/versions"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customConfigurationProfile/versions/versions1"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 				"Organization": to.Ptr("Administration"),
		// 			},
		// 			Properties: &armautomanage.ConfigurationProfileProperties{
		// 				Configuration: map[string]any{
		// 					"Antimalware/Enable": false,
		// 					"AzureSecurityCenter/Enable": true,
		// 					"Backup/Enable": false,
		// 					"BootDiagnostics/Enable": true,
		// 					"ChangeTrackingAndInventory/Enable": true,
		// 					"GuestConfiguration/Enable": true,
		// 					"LogAnalytics/Enable": true,
		// 					"UpdateManagement/Enable": true,
		// 					"VMInsights/Enable": true,
		// 				},
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("customConfigurationProfile/version2"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfiles/versions"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customConfigurationProfile/versions/version2"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 				"Organization": to.Ptr("Administration"),
		// 			},
		// 			Properties: &armautomanage.ConfigurationProfileProperties{
		// 				Configuration: map[string]any{
		// 					"Antimalware/Enable": false,
		// 					"AzureSecurityCenter/Enable": true,
		// 					"Backup/Enable": false,
		// 					"BootDiagnostics/Enable": true,
		// 					"ChangeTrackingAndInventory/Enable": true,
		// 					"GuestConfiguration/Enable": true,
		// 					"LogAnalytics/Enable": true,
		// 					"UpdateManagement/Enable": true,
		// 					"VMInsights/Enable": true,
		// 				},
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ConfigurationProfilesVersionsClientCreateOrUpdateOptions added in v0.2.0

type ConfigurationProfilesVersionsClientCreateOrUpdateOptions struct {
}

ConfigurationProfilesVersionsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationProfilesVersionsClient.CreateOrUpdate method.

type ConfigurationProfilesVersionsClientCreateOrUpdateResponse added in v0.2.0

type ConfigurationProfilesVersionsClientCreateOrUpdateResponse struct {
	// Definition of the configuration profile.
	ConfigurationProfile
}

ConfigurationProfilesVersionsClientCreateOrUpdateResponse contains the response from method ConfigurationProfilesVersionsClient.CreateOrUpdate.

type ConfigurationProfilesVersionsClientDeleteOptions added in v0.2.0

type ConfigurationProfilesVersionsClientDeleteOptions struct {
}

ConfigurationProfilesVersionsClientDeleteOptions contains the optional parameters for the ConfigurationProfilesVersionsClient.Delete method.

type ConfigurationProfilesVersionsClientDeleteResponse added in v0.2.0

type ConfigurationProfilesVersionsClientDeleteResponse struct {
}

ConfigurationProfilesVersionsClientDeleteResponse contains the response from method ConfigurationProfilesVersionsClient.Delete.

type ConfigurationProfilesVersionsClientGetOptions added in v0.2.0

type ConfigurationProfilesVersionsClientGetOptions struct {
}

ConfigurationProfilesVersionsClientGetOptions contains the optional parameters for the ConfigurationProfilesVersionsClient.Get method.

type ConfigurationProfilesVersionsClientGetResponse added in v0.2.0

type ConfigurationProfilesVersionsClientGetResponse struct {
	// Definition of the configuration profile.
	ConfigurationProfile
}

ConfigurationProfilesVersionsClientGetResponse contains the response from method ConfigurationProfilesVersionsClient.Get.

type ConfigurationProfilesVersionsClientListChildResourcesOptions added in v0.2.0

type ConfigurationProfilesVersionsClientListChildResourcesOptions struct {
}

ConfigurationProfilesVersionsClientListChildResourcesOptions contains the optional parameters for the ConfigurationProfilesVersionsClient.NewListChildResourcesPager method.

type ConfigurationProfilesVersionsClientListChildResourcesResponse added in v0.2.0

type ConfigurationProfilesVersionsClientListChildResourcesResponse struct {
	// The response of the list configuration profile operation.
	ConfigurationProfileList
}

ConfigurationProfilesVersionsClientListChildResourcesResponse contains the response from method ConfigurationProfilesVersionsClient.NewListChildResourcesPager.

type CreatedByType added in v0.2.0

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 added in v0.2.0

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type ErrorAdditionalInfo

type ErrorAdditionalInfo struct {
	// READ-ONLY; The additional info.
	Info any

	// READ-ONLY; The additional info type.
	Type *string
}

ErrorAdditionalInfo - The resource management error additional info.

func (ErrorAdditionalInfo) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.

func (*ErrorAdditionalInfo) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.

type ErrorDetail

type ErrorDetail struct {
	// READ-ONLY; The error additional info.
	AdditionalInfo []*ErrorAdditionalInfo

	// READ-ONLY; The error code.
	Code *string

	// READ-ONLY; The error details.
	Details []*ErrorDetail

	// READ-ONLY; The error message.
	Message *string

	// READ-ONLY; The error target.
	Target *string
}

ErrorDetail - The error detail.

func (ErrorDetail) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorDetail.

func (*ErrorDetail) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.

type ErrorResponse

type ErrorResponse struct {
	// The error object.
	Error *ErrorDetail
}

ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

func (ErrorResponse) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type HCIReportsClient added in v0.5.0

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

HCIReportsClient contains the methods for the HCIReports group. Don't use this type directly, use NewHCIReportsClient() instead.

func NewHCIReportsClient added in v0.5.0

func NewHCIReportsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HCIReportsClient, error)

NewHCIReportsClient creates a new instance of HCIReportsClient with the specified values.

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

func (*HCIReportsClient) Get added in v0.5.0

func (client *HCIReportsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, configurationProfileAssignmentName string, reportName string, options *HCIReportsClientGetOptions) (HCIReportsClientGetResponse, error)

Get - Get information about a report associated with a configuration profile assignment run If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - The name of the Arc machine.
  • configurationProfileAssignmentName - The configuration profile assignment name.
  • reportName - The report name.
  • options - HCIReportsClientGetOptions contains the optional parameters for the HCIReportsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/getHCIReport.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewHCIReportsClient().Get(ctx, "myResourceGroupName", "myClusterName", "default", "b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4", 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.Report = armautomanage.Report{
	// 	Name: to.Ptr("b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
	// 	Type: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports"),
	// 	ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.AzureStackHci/clusters/myClusterName/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
	// 	Properties: &armautomanage.AssignmentReportProperties{
	// 		Type: to.Ptr("Consistency"),
	// 		ConfigurationProfile: to.Ptr("anyConfigurationProfile"),
	// 		Duration: to.Ptr("PT15M32S"),
	// 		EndTime: to.Ptr("2021-03-31T22:17:42Z"),
	// 		LastModifiedTime: to.Ptr("2021-03-31T22:32:42Z"),
	// 		ReportFormatVersion: to.Ptr("1.0"),
	// 		Resources: []*armautomanage.ReportResource{
	// 			{
	// 				Name: to.Ptr("myResourceGroupName"),
	// 				Type: to.Ptr("Microsoft.Resources/resourceGroups"),
	// 				ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName"),
	// 				Status: to.Ptr("Conformant"),
	// 		}},
	// 		StartTime: to.Ptr("2021-03-31T22:13:06Z"),
	// 		Status: to.Ptr("Conformant"),
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*HCIReportsClient) NewListByConfigurationProfileAssignmentsPager added in v0.5.0

func (client *HCIReportsClient) NewListByConfigurationProfileAssignmentsPager(resourceGroupName string, clusterName string, configurationProfileAssignmentName string, options *HCIReportsClientListByConfigurationProfileAssignmentsOptions) *runtime.Pager[HCIReportsClientListByConfigurationProfileAssignmentsResponse]

NewListByConfigurationProfileAssignmentsPager - Retrieve a list of reports within a given configuration profile assignment

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - The name of the Arc machine.
  • configurationProfileAssignmentName - The configuration profile assignment name.
  • options - HCIReportsClientListByConfigurationProfileAssignmentsOptions contains the optional parameters for the HCIReportsClient.NewListByConfigurationProfileAssignmentsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listReportsByconfigurationProfileHCIAssignment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewHCIReportsClient().NewListByConfigurationProfileAssignmentsPager("myResourceGroupName", "myClusterName", "default", 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.ReportList = armautomanage.ReportList{
		// 	Value: []*armautomanage.Report{
		// 		{
		// 			Name: to.Ptr("b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
		// 			Type: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports"),
		// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/Microsoft.AzureStackHci/clusters/machines/myClusterName/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
		// 			Properties: &armautomanage.AssignmentReportProperties{
		// 				Type: to.Ptr("Consistency"),
		// 				ConfigurationProfile: to.Ptr("anyConfigurationProfile"),
		// 				Duration: to.Ptr("PT15M32S"),
		// 				EndTime: to.Ptr("2021-03-31T22:17:42Z"),
		// 				LastModifiedTime: to.Ptr("2021-03-31T22:32:42Z"),
		// 				ReportFormatVersion: to.Ptr("1.0"),
		// 				Resources: []*armautomanage.ReportResource{
		// 					{
		// 						Name: to.Ptr("myResourceGroupName"),
		// 						Type: to.Ptr("Microsoft.Resources/resourceGroups"),
		// 						ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName"),
		// 						Status: to.Ptr("Conformant"),
		// 				}},
		// 				StartTime: to.Ptr("2021-03-31T22:13:06Z"),
		// 				Status: to.Ptr("Conformant"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("142cd92e-6413-49ba-94b0-8e74f251d828"),
		// 			Type: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports"),
		// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.AzureStackHci/clusters/myClusterName/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/142cd92e-6413-49ba-94b0-8e74f251d828"),
		// 			Properties: &armautomanage.AssignmentReportProperties{
		// 				Type: to.Ptr("Consistency"),
		// 				ConfigurationProfile: to.Ptr("anyConfigurationProfile"),
		// 				Duration: to.Ptr("PT15M32S"),
		// 				EndTime: to.Ptr("2021-03-31T22:17:42Z"),
		// 				LastModifiedTime: to.Ptr("2021-03-31T22:32:42Z"),
		// 				ReportFormatVersion: to.Ptr("1.0"),
		// 				Resources: []*armautomanage.ReportResource{
		// 					{
		// 						Name: to.Ptr("myResourceGroupName"),
		// 						Type: to.Ptr("Microsoft.Resources/resourceGroups"),
		// 						ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName"),
		// 						Status: to.Ptr("Conformant"),
		// 				}},
		// 				StartTime: to.Ptr("2021-03-31T22:13:06Z"),
		// 				Status: to.Ptr("Conformant"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

type HCIReportsClientGetOptions added in v0.5.0

type HCIReportsClientGetOptions struct {
}

HCIReportsClientGetOptions contains the optional parameters for the HCIReportsClient.Get method.

type HCIReportsClientGetResponse added in v0.5.0

type HCIReportsClientGetResponse struct {
	// Definition of the report.
	Report
}

HCIReportsClientGetResponse contains the response from method HCIReportsClient.Get.

type HCIReportsClientListByConfigurationProfileAssignmentsOptions added in v0.5.0

type HCIReportsClientListByConfigurationProfileAssignmentsOptions struct {
}

HCIReportsClientListByConfigurationProfileAssignmentsOptions contains the optional parameters for the HCIReportsClient.NewListByConfigurationProfileAssignmentsPager method.

type HCIReportsClientListByConfigurationProfileAssignmentsResponse added in v0.5.0

type HCIReportsClientListByConfigurationProfileAssignmentsResponse struct {
	// The response of the list report operation.
	ReportList
}

HCIReportsClientListByConfigurationProfileAssignmentsResponse contains the response from method HCIReportsClient.NewListByConfigurationProfileAssignmentsPager.

type HCRPReportsClient added in v0.5.0

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

HCRPReportsClient contains the methods for the HCRPReports group. Don't use this type directly, use NewHCRPReportsClient() instead.

func NewHCRPReportsClient added in v0.5.0

func NewHCRPReportsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HCRPReportsClient, error)

NewHCRPReportsClient creates a new instance of HCRPReportsClient with the specified values.

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

func (*HCRPReportsClient) Get added in v0.5.0

func (client *HCRPReportsClient) Get(ctx context.Context, resourceGroupName string, machineName string, configurationProfileAssignmentName string, reportName string, options *HCRPReportsClientGetOptions) (HCRPReportsClientGetResponse, error)

Get - Get information about a report associated with a configuration profile assignment run If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • machineName - The name of the Arc machine.
  • configurationProfileAssignmentName - The configuration profile assignment name.
  • reportName - The report name.
  • options - HCRPReportsClientGetOptions contains the optional parameters for the HCRPReportsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/getHCRPReport.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewHCRPReportsClient().Get(ctx, "myResourceGroupName", "myMachineName", "default", "b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4", 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.Report = armautomanage.Report{
	// 	Name: to.Ptr("b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
	// 	Type: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports"),
	// 	ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myClustereName/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
	// 	Properties: &armautomanage.AssignmentReportProperties{
	// 		Type: to.Ptr("Consistency"),
	// 		ConfigurationProfile: to.Ptr("anyConfigurationProfile"),
	// 		Duration: to.Ptr("PT15M32S"),
	// 		EndTime: to.Ptr("2021-03-31T22:17:42Z"),
	// 		LastModifiedTime: to.Ptr("2021-03-31T22:32:42Z"),
	// 		ReportFormatVersion: to.Ptr("1.0"),
	// 		Resources: []*armautomanage.ReportResource{
	// 			{
	// 				Name: to.Ptr("myResourceGroupName"),
	// 				Type: to.Ptr("Microsoft.Resources/resourceGroups"),
	// 				ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName"),
	// 				Status: to.Ptr("Conformant"),
	// 		}},
	// 		StartTime: to.Ptr("2021-03-31T22:13:06Z"),
	// 		Status: to.Ptr("Conformant"),
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*HCRPReportsClient) NewListByConfigurationProfileAssignmentsPager added in v0.5.0

func (client *HCRPReportsClient) NewListByConfigurationProfileAssignmentsPager(resourceGroupName string, machineName string, configurationProfileAssignmentName string, options *HCRPReportsClientListByConfigurationProfileAssignmentsOptions) *runtime.Pager[HCRPReportsClientListByConfigurationProfileAssignmentsResponse]

NewListByConfigurationProfileAssignmentsPager - Retrieve a list of reports within a given configuration profile assignment

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • machineName - The name of the Arc machine.
  • configurationProfileAssignmentName - The configuration profile assignment name.
  • options - HCRPReportsClientListByConfigurationProfileAssignmentsOptions contains the optional parameters for the HCRPReportsClient.NewListByConfigurationProfileAssignmentsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listReportsByconfigurationProfileHCRPAssignment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewHCRPReportsClient().NewListByConfigurationProfileAssignmentsPager("myResourceGroupName", "myMachineName", "default", 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.ReportList = armautomanage.ReportList{
		// 	Value: []*armautomanage.Report{
		// 		{
		// 			Name: to.Ptr("b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
		// 			Type: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports"),
		// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myMachineName/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
		// 			Properties: &armautomanage.AssignmentReportProperties{
		// 				Type: to.Ptr("Consistency"),
		// 				ConfigurationProfile: to.Ptr("anyConfigurationProfile"),
		// 				Duration: to.Ptr("PT15M32S"),
		// 				EndTime: to.Ptr("2021-03-31T22:17:42Z"),
		// 				LastModifiedTime: to.Ptr("2021-03-31T22:32:42Z"),
		// 				ReportFormatVersion: to.Ptr("1.0"),
		// 				Resources: []*armautomanage.ReportResource{
		// 					{
		// 						Name: to.Ptr("myResourceGroupName"),
		// 						Type: to.Ptr("Microsoft.Resources/resourceGroups"),
		// 						ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName"),
		// 						Status: to.Ptr("Conformant"),
		// 				}},
		// 				StartTime: to.Ptr("2021-03-31T22:13:06Z"),
		// 				Status: to.Ptr("Conformant"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("142cd92e-6413-49ba-94b0-8e74f251d828"),
		// 			Type: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports"),
		// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myMachineName/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/142cd92e-6413-49ba-94b0-8e74f251d828"),
		// 			Properties: &armautomanage.AssignmentReportProperties{
		// 				Type: to.Ptr("Consistency"),
		// 				ConfigurationProfile: to.Ptr("anyConfigurationProfile"),
		// 				Duration: to.Ptr("PT15M32S"),
		// 				EndTime: to.Ptr("2021-03-31T22:17:42Z"),
		// 				LastModifiedTime: to.Ptr("2021-03-31T22:32:42Z"),
		// 				ReportFormatVersion: to.Ptr("1.0"),
		// 				Resources: []*armautomanage.ReportResource{
		// 					{
		// 						Name: to.Ptr("myResourceGroupName"),
		// 						Type: to.Ptr("Microsoft.Resources/resourceGroups"),
		// 						ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName"),
		// 						Status: to.Ptr("Conformant"),
		// 				}},
		// 				StartTime: to.Ptr("2021-03-31T22:13:06Z"),
		// 				Status: to.Ptr("Conformant"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

type HCRPReportsClientGetOptions added in v0.5.0

type HCRPReportsClientGetOptions struct {
}

HCRPReportsClientGetOptions contains the optional parameters for the HCRPReportsClient.Get method.

type HCRPReportsClientGetResponse added in v0.5.0

type HCRPReportsClientGetResponse struct {
	// Definition of the report.
	Report
}

HCRPReportsClientGetResponse contains the response from method HCRPReportsClient.Get.

type HCRPReportsClientListByConfigurationProfileAssignmentsOptions added in v0.5.0

type HCRPReportsClientListByConfigurationProfileAssignmentsOptions struct {
}

HCRPReportsClientListByConfigurationProfileAssignmentsOptions contains the optional parameters for the HCRPReportsClient.NewListByConfigurationProfileAssignmentsPager method.

type HCRPReportsClientListByConfigurationProfileAssignmentsResponse added in v0.5.0

type HCRPReportsClientListByConfigurationProfileAssignmentsResponse struct {
	// The response of the list report operation.
	ReportList
}

HCRPReportsClientListByConfigurationProfileAssignmentsResponse contains the response from method HCRPReportsClient.NewListByConfigurationProfileAssignmentsPager.

type Operation

type Operation struct {
	// Localized display information for this particular operation.
	Display *OperationDisplay

	// READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
	ActionType *ActionType

	// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane
	// operations.
	IsDataAction *bool

	// READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
	// "Microsoft.Compute/virtualMachines/capture/action"
	Name *string

	// READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
	// value is "user,system"
	Origin *Origin
}

Operation - Details of a REST API operation, returned from the Resource Provider Operations API

func (Operation) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
	Description *string

	// READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
	// Machine", "Restart Virtual Machine".
	Operation *string

	// READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
	// Compute".
	Provider *string

	// READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
	// Schedule Collections".
	Resource *string
}

OperationDisplay - Localized display information for this particular operation.

func (OperationDisplay) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult added in v0.2.0

type OperationListResult struct {
	// READ-ONLY; URL to get the next set of operation list results (if there are any).
	NextLink *string

	// READ-ONLY; List of operations supported by the resource provider
	Value []*Operation
}

OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.

func (OperationListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationsClient

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

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager added in v0.4.0

NewListPager - Lists all of the available Automanage REST API operations.

Generated from API version 2022-05-04

  • 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/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.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.OperationListResult = armautomanage.OperationListResult{
		// 	Value: []*armautomanage.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/register/action"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Registers the subscription for the Automanage Resource Provider"),
		// 				Operation: to.Ptr("Register the Automanage Resource Provider"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Automanage Resource Provider"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/write"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Create new configuration profile assignment."),
		// 				Operation: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/write"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/configurationProfileAssignments"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/read"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Get configuration profile assignment."),
		// 				Operation: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/read"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/configurationProfileAssignments"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/delete"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Delete configuration profile assignment."),
		// 				Operation: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/delete"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/configurationProfileAssignments"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/bestPractices/read"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Get Automanage bestPractice."),
		// 				Operation: to.Ptr("Microsoft.Automanage/bestPractices/read"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/bestPractices"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/bestPractices/versions/read"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Get Automanage bestPractice version."),
		// 				Operation: to.Ptr("Microsoft.Automanage/bestPractices/versions/read"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/bestPractices/versions"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/configurationProfiles/write"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Create new Automanage Configuration Profile ."),
		// 				Operation: to.Ptr("Microsoft.Automanage/configurationProfiles/write"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/configurationProfiles"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/configurationProfiles/read"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Get Automanage Configuration Profile."),
		// 				Operation: to.Ptr("Microsoft.Automanage/configurationProfiles/read"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/configurationProfiles"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/configurationProfiles/delete"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Delete Automanage Configuration Profile."),
		// 				Operation: to.Ptr("Microsoft.Automanage/configurationProfiles/delete"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/configurationProfiles"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/configurationProfiles/versions/write"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Create new Automanage Configuration Profile version."),
		// 				Operation: to.Ptr("Microsoft.Automanage/configurationProfiles/versions/write"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/configurationProfiles/versions"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/configurationProfiles/versions/read"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Get Automanage Configuration Profile version."),
		// 				Operation: to.Ptr("Microsoft.Automanage/configurationProfiles/versions/read"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/configurationProfiles/versions"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/configurationProfiles/versions/delete"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Delete Automanage Configuration Profile version."),
		// 				Operation: to.Ptr("Microsoft.Automanage/configurationProfiles/versions/delete"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/configurationProfiles/versions"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports/read"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Get report for configuration profile assignment."),
		// 				Operation: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports/read"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Automanage/servicePrincipals/read"),
		// 			Display: &armautomanage.OperationDisplay{
		// 				Description: to.Ptr("Read the Automanage AAD first party service principal id and authorizationSet for the subscription. This service principal id is used to grant the Contributor RBAC permission to Automanage AAD first party Application."),
		// 				Operation: to.Ptr("Microsoft.Automanage/servicePrincipals/read"),
		// 				Provider: to.Ptr("Microsoft Automanage"),
		// 				Resource: to.Ptr("Microsoft.Automanage/servicePrincipals"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type Origin added in v0.2.0

type Origin string

Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"

const (
	OriginSystem     Origin = "system"
	OriginUser       Origin = "user"
	OriginUserSystem Origin = "user,system"
)

func PossibleOriginValues added in v0.2.0

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type ProxyResource

type ProxyResource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location

func (ProxyResource) MarshalJSON added in v1.0.0

func (p ProxyResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProxyResource.

func (*ProxyResource) UnmarshalJSON added in v1.0.0

func (p *ProxyResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.

type Report added in v0.2.0

type Report struct {
	// The properties for the report.
	Properties *AssignmentReportProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

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

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Report - Definition of the report.

func (Report) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type Report.

func (*Report) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Report.

type ReportList added in v0.2.0

type ReportList struct {
	// Result of the list report operation.
	Value []*Report
}

ReportList - The response of the list report operation.

func (ReportList) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ReportList.

func (*ReportList) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReportList.

type ReportResource added in v0.2.0

type ReportResource struct {
	// READ-ONLY; Error message, if any, returned when deploying the resource.
	Error *ErrorDetail

	// READ-ONLY; ARM id of the resource.
	ID *string

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

	// READ-ONLY; Status of the resource.
	Status *string

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

ReportResource - Details about the resource processed by the configuration profile assignment

func (ReportResource) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type ReportResource.

func (*ReportResource) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReportResource.

type ReportsClient added in v0.2.0

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

ReportsClient contains the methods for the Reports group. Don't use this type directly, use NewReportsClient() instead.

func NewReportsClient added in v0.2.0

func NewReportsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReportsClient, error)

NewReportsClient creates a new instance of ReportsClient with the specified values.

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

func (*ReportsClient) Get added in v0.2.0

func (client *ReportsClient) Get(ctx context.Context, resourceGroupName string, configurationProfileAssignmentName string, reportName string, vmName string, options *ReportsClientGetOptions) (ReportsClientGetResponse, error)

Get - Get information about a report associated with a configuration profile assignment run If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • configurationProfileAssignmentName - The configuration profile assignment name.
  • reportName - The report name.
  • vmName - The name of the virtual machine.
  • options - ReportsClientGetOptions contains the optional parameters for the ReportsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/getReport.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewReportsClient().Get(ctx, "myResourceGroupName", "default", "b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4", "myVMName", 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.Report = armautomanage.Report{
	// 	Name: to.Ptr("b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
	// 	Type: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports"),
	// 	ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
	// 	Properties: &armautomanage.AssignmentReportProperties{
	// 		Type: to.Ptr("Consistency"),
	// 		ConfigurationProfile: to.Ptr("anyConfigurationProfile"),
	// 		Duration: to.Ptr("PT15M32S"),
	// 		EndTime: to.Ptr("2021-03-31T22:17:42Z"),
	// 		LastModifiedTime: to.Ptr("2021-03-31T22:32:42Z"),
	// 		ReportFormatVersion: to.Ptr("1.0"),
	// 		Resources: []*armautomanage.ReportResource{
	// 			{
	// 				Name: to.Ptr("myResourceGroupName"),
	// 				Type: to.Ptr("Microsoft.Resources/resourceGroups"),
	// 				ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName"),
	// 				Status: to.Ptr("Conformant"),
	// 		}},
	// 		StartTime: to.Ptr("2021-03-31T22:13:06Z"),
	// 		Status: to.Ptr("Conformant"),
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1@outlook.com"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*ReportsClient) NewListByConfigurationProfileAssignmentsPager added in v0.4.0

func (client *ReportsClient) NewListByConfigurationProfileAssignmentsPager(resourceGroupName string, configurationProfileAssignmentName string, vmName string, options *ReportsClientListByConfigurationProfileAssignmentsOptions) *runtime.Pager[ReportsClientListByConfigurationProfileAssignmentsResponse]

NewListByConfigurationProfileAssignmentsPager - Retrieve a list of reports within a given configuration profile assignment

Generated from API version 2022-05-04

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • configurationProfileAssignmentName - The configuration profile assignment name.
  • vmName - The name of the virtual machine.
  • options - ReportsClientListByConfigurationProfileAssignmentsOptions contains the optional parameters for the ReportsClient.NewListByConfigurationProfileAssignmentsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listReportsByconfigurationProfileAssignment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReportsClient().NewListByConfigurationProfileAssignmentsPager("myResourceGroupName", "default", "myVMName", 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.ReportList = armautomanage.ReportList{
		// 	Value: []*armautomanage.Report{
		// 		{
		// 			Name: to.Ptr("b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
		// 			Type: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports"),
		// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/b4e9ee6b-1717-4ff0-a8d2-e6d72c33d5f4"),
		// 			Properties: &armautomanage.AssignmentReportProperties{
		// 				Type: to.Ptr("Consistency"),
		// 				ConfigurationProfile: to.Ptr("anyConfigurationProfile"),
		// 				Duration: to.Ptr("PT15M32S"),
		// 				EndTime: to.Ptr("2021-03-31T22:17:42Z"),
		// 				LastModifiedTime: to.Ptr("2021-03-31T22:32:42Z"),
		// 				ReportFormatVersion: to.Ptr("1.0"),
		// 				Resources: []*armautomanage.ReportResource{
		// 					{
		// 						Name: to.Ptr("myResourceGroupName"),
		// 						Type: to.Ptr("Microsoft.Resources/resourceGroups"),
		// 						ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName"),
		// 						Status: to.Ptr("Conformant"),
		// 				}},
		// 				StartTime: to.Ptr("2021-03-31T22:13:06Z"),
		// 				Status: to.Ptr("Conformant"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("142cd92e-6413-49ba-94b0-8e74f251d828"),
		// 			Type: to.Ptr("Microsoft.Automanage/configurationProfileAssignments/reports"),
		// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myVMName/providers/Microsoft.Automanage/configurationProfileAssignments/default/reports/142cd92e-6413-49ba-94b0-8e74f251d828"),
		// 			Properties: &armautomanage.AssignmentReportProperties{
		// 				Type: to.Ptr("Consistency"),
		// 				ConfigurationProfile: to.Ptr("anyConfigurationProfile"),
		// 				Duration: to.Ptr("PT15M32S"),
		// 				EndTime: to.Ptr("2021-03-31T22:17:42Z"),
		// 				LastModifiedTime: to.Ptr("2021-03-31T22:32:42Z"),
		// 				ReportFormatVersion: to.Ptr("1.0"),
		// 				Resources: []*armautomanage.ReportResource{
		// 					{
		// 						Name: to.Ptr("myResourceGroupName"),
		// 						Type: to.Ptr("Microsoft.Resources/resourceGroups"),
		// 						ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName"),
		// 						Status: to.Ptr("Conformant"),
		// 				}},
		// 				StartTime: to.Ptr("2021-03-31T22:13:06Z"),
		// 				Status: to.Ptr("Conformant"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1@outlook.com"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ReportsClientGetOptions added in v0.2.0

type ReportsClientGetOptions struct {
}

ReportsClientGetOptions contains the optional parameters for the ReportsClient.Get method.

type ReportsClientGetResponse added in v0.2.0

type ReportsClientGetResponse struct {
	// Definition of the report.
	Report
}

ReportsClientGetResponse contains the response from method ReportsClient.Get.

type ReportsClientListByConfigurationProfileAssignmentsOptions added in v0.2.0

type ReportsClientListByConfigurationProfileAssignmentsOptions struct {
}

ReportsClientListByConfigurationProfileAssignmentsOptions contains the optional parameters for the ReportsClient.NewListByConfigurationProfileAssignmentsPager method.

type ReportsClientListByConfigurationProfileAssignmentsResponse added in v0.2.0

type ReportsClientListByConfigurationProfileAssignmentsResponse struct {
	// The response of the list report operation.
	ReportList
}

ReportsClientListByConfigurationProfileAssignmentsResponse contains the response from method ReportsClient.NewListByConfigurationProfileAssignmentsPager.

type Resource

type Resource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Resource - Common fields that are returned in the response for all Azure Resource Manager resources

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ServicePrincipal added in v0.3.0

type ServicePrincipal struct {
	// The Service Principal properties for the subscription
	Properties *ServicePrincipalProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

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

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ServicePrincipal - The Service Principal Id for the subscription.

func (ServicePrincipal) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type ServicePrincipal.

func (*ServicePrincipal) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipal.

type ServicePrincipalListResult added in v0.3.0

type ServicePrincipalListResult struct {
	// The list of servicePrincipals.
	Value []*ServicePrincipal
}

ServicePrincipalListResult - The list of ServicePrincipals.

func (ServicePrincipalListResult) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServicePrincipalListResult.

func (*ServicePrincipalListResult) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalListResult.

type ServicePrincipalProperties added in v0.3.0

type ServicePrincipalProperties struct {
	// READ-ONLY; Returns the contributor RBAC Role exist or not for the Service Principal Id.
	AuthorizationSet *bool

	// READ-ONLY; The Service Principal Id for the subscription.
	ServicePrincipalID *string
}

ServicePrincipalProperties - The Service Principal properties for the subscription.

func (ServicePrincipalProperties) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type ServicePrincipalProperties.

func (*ServicePrincipalProperties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalProperties.

type ServicePrincipalsClient added in v0.3.0

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

ServicePrincipalsClient contains the methods for the ServicePrincipals group. Don't use this type directly, use NewServicePrincipalsClient() instead.

func NewServicePrincipalsClient added in v0.3.0

func NewServicePrincipalsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicePrincipalsClient, error)

NewServicePrincipalsClient creates a new instance of ServicePrincipalsClient with the specified values.

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

func (*ServicePrincipalsClient) Get added in v0.3.0

Get - Get the Automanage AAD first party Application Service Principal details for the subscription id. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-04

  • options - ServicePrincipalsClientGetOptions contains the optional parameters for the ServicePrincipalsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/getServicePrincipal.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServicePrincipalsClient().Get(ctx, 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.ServicePrincipal = armautomanage.ServicePrincipal{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.Automanage/servicePrincipals/default"),
	// 	Properties: &armautomanage.ServicePrincipalProperties{
	// 		AuthorizationSet: to.Ptr(true),
	// 		ServicePrincipalID: to.Ptr("<servicePrincipalId>"),
	// 	},
	// 	SystemData: &armautomanage.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("SYSTEM"),
	// 		CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("SYSTEM"),
	// 		LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
	// 	},
	// }
}
Output:

func (*ServicePrincipalsClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Get the Automanage AAD first party Application Service Principal details for the subscription id.

Generated from API version 2022-05-04

  • options - ServicePrincipalsClientListBySubscriptionOptions contains the optional parameters for the ServicePrincipalsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/2dcad6d6e9a96882eb6d317e7500a94be007a9c6/specification/automanage/resource-manager/Microsoft.Automanage/stable/2022-05-04/examples/listServicePrincipalBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armautomanage.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServicePrincipalsClient().NewListBySubscriptionPager(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.ServicePrincipalListResult = armautomanage.ServicePrincipalListResult{
		// 	Value: []*armautomanage.ServicePrincipal{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Automanage/ConfigurationProfileAssignments"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.Automanage/servicePrincipals/default"),
		// 			Properties: &armautomanage.ServicePrincipalProperties{
		// 				AuthorizationSet: to.Ptr(true),
		// 				ServicePrincipalID: to.Ptr("<servicePrincipalId>"),
		// 			},
		// 			SystemData: &armautomanage.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()),
		// 				CreatedBy: to.Ptr("SYSTEM"),
		// 				CreatedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("SYSTEM"),
		// 				LastModifiedByType: to.Ptr(armautomanage.CreatedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ServicePrincipalsClientGetOptions added in v0.3.0

type ServicePrincipalsClientGetOptions struct {
}

ServicePrincipalsClientGetOptions contains the optional parameters for the ServicePrincipalsClient.Get method.

type ServicePrincipalsClientGetResponse added in v0.3.0

type ServicePrincipalsClientGetResponse struct {
	// The Service Principal Id for the subscription.
	ServicePrincipal
}

ServicePrincipalsClientGetResponse contains the response from method ServicePrincipalsClient.Get.

type ServicePrincipalsClientListBySubscriptionOptions added in v0.3.0

type ServicePrincipalsClientListBySubscriptionOptions struct {
}

ServicePrincipalsClientListBySubscriptionOptions contains the optional parameters for the ServicePrincipalsClient.NewListBySubscriptionPager method.

type ServicePrincipalsClientListBySubscriptionResponse added in v0.3.0

type ServicePrincipalsClientListBySubscriptionResponse struct {
	// The list of ServicePrincipals.
	ServicePrincipalListResult
}

ServicePrincipalsClientListBySubscriptionResponse contains the response from method ServicePrincipalsClient.NewListBySubscriptionPager.

type SystemData added in v0.2.0

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 added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TrackedResource

type TrackedResource struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'

func (TrackedResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

func (*TrackedResource) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

type UpdateResource

type UpdateResource struct {
	// The tags of the resource.
	Tags map[string]*string
}

UpdateResource - Represents an update resource

func (UpdateResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UpdateResource.

func (*UpdateResource) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateResource.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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