armmanagementgroups

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 16 Imported by: 4

README

Azure Management Groups Module for Go

PkgGoDev

The armmanagementgroups module provides operations for working with Azure Management Groups.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Management Groups module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups

Authorization

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

Clients

Azure Management Groups modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client, err := armmanagementgroups.NewOperationsClient(<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,
    },
}
client, err := armmanagementgroups.NewOperationsClient(<subscription ID>, cred, &options)

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Management Groups 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 APIClient added in v0.3.0

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

APIClient contains the methods for the ManagementGroupsAPI group. Don't use this type directly, use NewAPIClient() instead.

func NewAPIClient added in v0.3.0

func NewAPIClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*APIClient, error)

NewAPIClient creates a new instance of APIClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*APIClient) CheckNameAvailability added in v0.3.0

func (client *APIClient) CheckNameAvailability(ctx context.Context, checkNameAvailabilityRequest CheckNameAvailabilityRequest, options *APIClientCheckNameAvailabilityOptions) (APIClientCheckNameAvailabilityResponse, error)

CheckNameAvailability - Checks if the specified management group name is valid and unique If the operation fails it returns an *azcore.ResponseError type. checkNameAvailabilityRequest - Management group name availability check parameters. options - APIClientCheckNameAvailabilityOptions contains the optional parameters for the APIClient.CheckNameAvailability method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/CheckManagementGroupNameAvailability.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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewAPIClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	res, err := client.CheckNameAvailability(ctx,
		armmanagementgroups.CheckNameAvailabilityRequest{
			Name: to.Ptr("<name>"),
			Type: to.Ptr("<type>"),
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

func (*APIClient) StartTenantBackfill added in v0.3.0

StartTenantBackfill - Starts backfilling subscriptions for the Tenant. If the operation fails it returns an *azcore.ResponseError type. options - APIClientStartTenantBackfillOptions contains the optional parameters for the APIClient.StartTenantBackfill method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/StartTenantBackfillRequest.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewAPIClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	res, err := client.StartTenantBackfill(ctx,
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

func (*APIClient) TenantBackfillStatus added in v0.3.0

TenantBackfillStatus - Gets tenant backfill status If the operation fails it returns an *azcore.ResponseError type. options - APIClientTenantBackfillStatusOptions contains the optional parameters for the APIClient.TenantBackfillStatus method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/TenantBackfillStatusRequest.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewAPIClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	res, err := client.TenantBackfillStatus(ctx,
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

type APIClientCheckNameAvailabilityOptions added in v0.3.0

type APIClientCheckNameAvailabilityOptions struct {
}

APIClientCheckNameAvailabilityOptions contains the optional parameters for the APIClient.CheckNameAvailability method.

type APIClientCheckNameAvailabilityResponse added in v0.3.0

type APIClientCheckNameAvailabilityResponse struct {
	CheckNameAvailabilityResult
}

APIClientCheckNameAvailabilityResponse contains the response from method APIClient.CheckNameAvailability.

type APIClientStartTenantBackfillOptions added in v0.3.0

type APIClientStartTenantBackfillOptions struct {
}

APIClientStartTenantBackfillOptions contains the optional parameters for the APIClient.StartTenantBackfill method.

type APIClientStartTenantBackfillResponse added in v0.3.0

type APIClientStartTenantBackfillResponse struct {
	TenantBackfillStatusResult
}

APIClientStartTenantBackfillResponse contains the response from method APIClient.StartTenantBackfill.

type APIClientTenantBackfillStatusOptions added in v0.3.0

type APIClientTenantBackfillStatusOptions struct {
}

APIClientTenantBackfillStatusOptions contains the optional parameters for the APIClient.TenantBackfillStatus method.

type APIClientTenantBackfillStatusResponse added in v0.3.0

type APIClientTenantBackfillStatusResponse struct {
	TenantBackfillStatusResult
}

APIClientTenantBackfillStatusResponse contains the response from method APIClient.TenantBackfillStatus.

type AzureAsyncOperationResults

type AzureAsyncOperationResults struct {
	// The generic properties of a management group.
	Properties *ManagementGroupInfoProperties `json:"properties,omitempty"`

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The current status of the asynchronous operation performed . For example, Running, Succeeded, Failed
	Status *string `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string `json:"type,omitempty" azure:"ro"`
}

AzureAsyncOperationResults - The results of Azure-AsyncOperation.

type CheckNameAvailabilityRequest

type CheckNameAvailabilityRequest struct {
	// the name to check for availability
	Name *string `json:"name,omitempty"`

	// fully qualified resource type which includes provider namespace
	Type *string `json:"type,omitempty"`
}

CheckNameAvailabilityRequest - Management group name availability check parameters.

type CheckNameAvailabilityResult

type CheckNameAvailabilityResult struct {
	// READ-ONLY; Required if nameAvailable == false. Localized. If reason == invalid, provide the user with the reason why the
	// given name is invalid, and provide the resource naming requirements so that the user can
	// select a valid name. If reason == AlreadyExists, explain that is already in use, and direct them to select a different
	// name.
	Message *string `json:"message,omitempty" azure:"ro"`

	// READ-ONLY; Required. True indicates name is valid and available. False indicates the name is invalid, unavailable, or both.
	NameAvailable *bool `json:"nameAvailable,omitempty" azure:"ro"`

	// READ-ONLY; Required if nameAvailable == false. Invalid indicates the name provided does not match the resource provider's
	// naming requirements (incorrect length, unsupported characters, etc.) AlreadyExists
	// indicates that the name is already in use and is therefore unavailable.
	Reason *Reason `json:"reason,omitempty" azure:"ro"`
}

CheckNameAvailabilityResult - Describes the result of the request to check management group name availability.

type Client added in v0.3.0

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

Client contains the methods for the ManagementGroups group. Don't use this type directly, use NewClient() instead.

func NewClient added in v0.3.0

func NewClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error)

NewClient creates a new instance of Client with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*Client) BeginCreateOrUpdate added in v0.3.0

func (client *Client) BeginCreateOrUpdate(ctx context.Context, groupID string, createManagementGroupRequest CreateManagementGroupRequest, options *ClientBeginCreateOrUpdateOptions) (*armruntime.Poller[ClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or update a management group. If a management group is already created and a subsequent create request is issued with different properties, the management group properties will be updated. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. createManagementGroupRequest - Management group creation parameters. options - ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/PutManagementGroup.json

package main

import (
	"context"
	"log"

	"time"

	"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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<group-id>",
		armmanagementgroups.CreateManagementGroupRequest{
			Properties: &armmanagementgroups.CreateManagementGroupProperties{
				DisplayName: to.Ptr("<display-name>"),
				Details: &armmanagementgroups.CreateManagementGroupDetails{
					Parent: &armmanagementgroups.CreateParentGroupInfo{
						ID: to.Ptr("<id>"),
					},
				},
			},
		},
		&armmanagementgroups.ClientBeginCreateOrUpdateOptions{CacheControl: to.Ptr("<cache-control>"),
			ResumeToken: "",
		})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

func (*Client) BeginDelete added in v0.3.0

func (client *Client) BeginDelete(ctx context.Context, groupID string, options *ClientBeginDeleteOptions) (*armruntime.Poller[ClientDeleteResponse], error)

BeginDelete - Delete management group. If a management group contains child resources, the request will fail. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. options - ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/DeleteManagementGroup.json

package main

import (
	"context"
	"log"

	"time"

	"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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	poller, err := client.BeginDelete(ctx,
		"<group-id>",
		&armmanagementgroups.ClientBeginDeleteOptions{CacheControl: to.Ptr("<cache-control>"),
			ResumeToken: "",
		})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
		return
	}
}
Output:

func (*Client) Get added in v0.3.0

func (client *Client) Get(ctx context.Context, groupID string, options *ClientGetOptions) (ClientGetResponse, error)

Get - Get the details of the management group. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. options - ClientGetOptions contains the optional parameters for the Client.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetManagementGroup.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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	res, err := client.Get(ctx,
		"<group-id>",
		&armmanagementgroups.ClientGetOptions{Expand: nil,
			Recurse:      nil,
			Filter:       nil,
			CacheControl: to.Ptr("<cache-control>"),
		})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

func (*Client) GetDescendants added in v0.3.0

func (client *Client) GetDescendants(groupID string, options *ClientGetDescendantsOptions) *runtime.Pager[ClientGetDescendantsResponse]

GetDescendants - List all entities that descend from a management group. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. options - ClientGetDescendantsOptions contains the optional parameters for the Client.GetDescendants method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetDescendants.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	pager := client.GetDescendants("<group-id>",
		&armmanagementgroups.ClientGetDescendantsOptions{Skiptoken: nil,
			Top: nil,
		})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
			return
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*Client) List added in v0.3.0

func (client *Client) List(options *ClientListOptions) *runtime.Pager[ClientListResponse]

List - List management groups for the authenticated user. If the operation fails it returns an *azcore.ResponseError type. options - ClientListOptions contains the optional parameters for the Client.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/ListManagementGroups.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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	pager := client.List(&armmanagementgroups.ClientListOptions{CacheControl: to.Ptr("<cache-control>"),
		Skiptoken: nil,
	})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
			return
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*Client) Update added in v0.3.0

func (client *Client) Update(ctx context.Context, groupID string, patchGroupRequest PatchManagementGroupRequest, options *ClientUpdateOptions) (ClientUpdateResponse, error)

Update - Update a management group. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. patchGroupRequest - Management group patch parameters. options - ClientUpdateOptions contains the optional parameters for the Client.Update method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/PatchManagementGroup.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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	res, err := client.Update(ctx,
		"<group-id>",
		armmanagementgroups.PatchManagementGroupRequest{
			DisplayName:   to.Ptr("<display-name>"),
			ParentGroupID: to.Ptr("<parent-group-id>"),
		},
		&armmanagementgroups.ClientUpdateOptions{CacheControl: to.Ptr("<cache-control>")})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

type ClientBeginCreateOrUpdateOptions added in v0.3.0

type ClientBeginCreateOrUpdateOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method.

type ClientBeginDeleteOptions added in v0.3.0

type ClientBeginDeleteOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method.

type ClientCreateOrUpdateResponse added in v0.3.0

type ClientCreateOrUpdateResponse struct {
	ManagementGroup
}

ClientCreateOrUpdateResponse contains the response from method Client.CreateOrUpdate.

type ClientDeleteResponse added in v0.3.0

type ClientDeleteResponse struct {
	AzureAsyncOperationResults
}

ClientDeleteResponse contains the response from method Client.Delete.

type ClientGetDescendantsOptions added in v0.3.0

type ClientGetDescendantsOptions struct {
	// Page continuation token is only used if a previous operation returned a partial result. If a previous response contains
	// a nextLink element, the value of the nextLink element will include a token
	// parameter that specifies a starting point to use for subsequent calls.
	Skiptoken *string
	// Number of elements to return when retrieving results. Passing this in will override $skipToken.
	Top *int32
}

ClientGetDescendantsOptions contains the optional parameters for the Client.GetDescendants method.

type ClientGetDescendantsResponse added in v0.3.0

type ClientGetDescendantsResponse struct {
	DescendantListResult
}

ClientGetDescendantsResponse contains the response from method Client.GetDescendants.

type ClientGetOptions added in v0.3.0

type ClientGetOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
	// The $expand=children query string parameter allows clients to request inclusion of children in the response payload. $expand=path
	// includes the path from the root group to the current group.
	// $expand=ancestors includes the ancestor Ids of the current group.
	Expand *ManagementGroupExpandType
	// A filter which allows the exclusion of subscriptions from results (i.e. '$filter=children.childType ne Subscription')
	Filter *string
	// The $recurse=true query string parameter allows clients to request inclusion of entire hierarchy in the response payload.
	// Note that $expand=children must be passed up if $recurse is set to true.
	Recurse *bool
}

ClientGetOptions contains the optional parameters for the Client.Get method.

type ClientGetResponse added in v0.3.0

type ClientGetResponse struct {
	ManagementGroup
}

ClientGetResponse contains the response from method Client.Get.

type ClientListOptions added in v0.3.0

type ClientListOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
	// Page continuation token is only used if a previous operation returned a partial result. If a previous response contains
	// a nextLink element, the value of the nextLink element will include a token
	// parameter that specifies a starting point to use for subsequent calls.
	Skiptoken *string
}

ClientListOptions contains the optional parameters for the Client.List method.

type ClientListResponse added in v0.3.0

type ClientListResponse struct {
	ManagementGroupListResult
}

ClientListResponse contains the response from method Client.List.

type ClientUpdateOptions added in v0.3.0

type ClientUpdateOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
}

ClientUpdateOptions contains the optional parameters for the Client.Update method.

type ClientUpdateResponse added in v0.3.0

type ClientUpdateResponse struct {
	ManagementGroup
}

ClientUpdateResponse contains the response from method Client.Update.

type CreateManagementGroupChildInfo

type CreateManagementGroupChildInfo struct {
	// READ-ONLY; The list of children.
	Children []*CreateManagementGroupChildInfo `json:"children,omitempty" azure:"ro"`

	// READ-ONLY; The friendly name of the child resource.
	DisplayName *string `json:"displayName,omitempty" azure:"ro"`

	// READ-ONLY; The fully qualified ID for the child resource (management group or subscription). For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the child entity.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The fully qualified resource type which includes provider namespace (e.g. Microsoft.Management/managementGroups)
	Type *ManagementGroupChildType `json:"type,omitempty" azure:"ro"`
}

CreateManagementGroupChildInfo - The child information of a management group used during creation.

func (CreateManagementGroupChildInfo) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CreateManagementGroupChildInfo.

type CreateManagementGroupDetails

type CreateManagementGroupDetails struct {
	// (Optional) The ID of the parent management group used during creation.
	Parent *CreateParentGroupInfo `json:"parent,omitempty"`

	// READ-ONLY; The identity of the principal or process that updated the object.
	UpdatedBy *string `json:"updatedBy,omitempty" azure:"ro"`

	// READ-ONLY; The date and time when this object was last updated.
	UpdatedTime *time.Time `json:"updatedTime,omitempty" azure:"ro"`

	// READ-ONLY; The version number of the object.
	Version *int32 `json:"version,omitempty" azure:"ro"`
}

CreateManagementGroupDetails - The details of a management group used during creation.

func (CreateManagementGroupDetails) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CreateManagementGroupDetails.

func (*CreateManagementGroupDetails) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CreateManagementGroupDetails.

type CreateManagementGroupProperties

type CreateManagementGroupProperties struct {
	// The details of a management group used during creation.
	Details *CreateManagementGroupDetails `json:"details,omitempty"`

	// The friendly name of the management group. If no value is passed then this field will be set to the groupId.
	DisplayName *string `json:"displayName,omitempty"`

	// READ-ONLY; The list of children.
	Children []*CreateManagementGroupChildInfo `json:"children,omitempty" azure:"ro"`

	// READ-ONLY; The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string `json:"tenantId,omitempty" azure:"ro"`
}

CreateManagementGroupProperties - The generic properties of a management group used during creation.

func (CreateManagementGroupProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CreateManagementGroupProperties.

type CreateManagementGroupRequest

type CreateManagementGroupRequest struct {
	// The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string `json:"name,omitempty"`

	// The generic properties of a management group used during creation.
	Properties *CreateManagementGroupProperties `json:"properties,omitempty"`

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string `json:"type,omitempty" azure:"ro"`
}

CreateManagementGroupRequest - Management group creation parameters.

type CreateOrUpdateSettingsProperties

type CreateOrUpdateSettingsProperties struct {
	// Settings that sets the default Management Group under which new subscriptions get added in this tenant. For example, /providers/Microsoft.Management/managementGroups/defaultGroup
	DefaultManagementGroup *string `json:"defaultManagementGroup,omitempty"`

	// Indicates whether RBAC access is required upon group creation under the root Management Group. If set to true, user will
	// require Microsoft.Management/managementGroups/write action on the root
	// Management Group scope in order to create new Groups directly under the root. This will prevent new users from creating
	// new Management Groups, unless they are given access.
	RequireAuthorizationForGroupCreation *bool `json:"requireAuthorizationForGroupCreation,omitempty"`
}

CreateOrUpdateSettingsProperties - The properties of the request to create or update Management Group settings

type CreateOrUpdateSettingsRequest

type CreateOrUpdateSettingsRequest struct {
	// The properties of the request to create or update Management Group settings
	Properties *CreateOrUpdateSettingsProperties `json:"properties,omitempty"`
}

CreateOrUpdateSettingsRequest - Parameters for creating or updating Management Group settings

func (CreateOrUpdateSettingsRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CreateOrUpdateSettingsRequest.

type CreateParentGroupInfo

type CreateParentGroupInfo struct {
	// The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty"`

	// READ-ONLY; The friendly name of the parent management group.
	DisplayName *string `json:"displayName,omitempty" azure:"ro"`

	// READ-ONLY; The name of the parent management group
	Name *string `json:"name,omitempty" azure:"ro"`
}

CreateParentGroupInfo - (Optional) The ID of the parent management group used during creation.

type DescendantInfo

type DescendantInfo struct {
	// The generic properties of an descendant.
	Properties *DescendantInfoProperties `json:"properties,omitempty"`

	// READ-ONLY; The fully qualified ID for the descendant. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	// or /subscriptions/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the descendant. For example, 00000000-0000-0000-0000-000000000000
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups or /subscriptions
	Type *string `json:"type,omitempty" azure:"ro"`
}

DescendantInfo - The descendant.

type DescendantInfoProperties

type DescendantInfoProperties struct {
	// The friendly name of the management group.
	DisplayName *string `json:"displayName,omitempty"`

	// The ID of the parent management group.
	Parent *DescendantParentGroupInfo `json:"parent,omitempty"`
}

DescendantInfoProperties - The generic properties of an descendant.

type DescendantListResult

type DescendantListResult struct {
	// The list of descendants.
	Value []*DescendantInfo `json:"value,omitempty"`

	// READ-ONLY; The URL to use for getting the next set of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`
}

DescendantListResult - Describes the result of the request to view descendants.

func (DescendantListResult) MarshalJSON

func (d DescendantListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DescendantListResult.

type DescendantParentGroupInfo

type DescendantParentGroupInfo struct {
	// The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty"`
}

DescendantParentGroupInfo - The ID of the parent management group.

type EntitiesClient

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

EntitiesClient contains the methods for the Entities group. Don't use this type directly, use NewEntitiesClient() instead.

func NewEntitiesClient

func NewEntitiesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*EntitiesClient, error)

NewEntitiesClient creates a new instance of EntitiesClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*EntitiesClient) List

List - List all entities (Management Groups, Subscriptions, etc.) for the authenticated user. If the operation fails it returns an *azcore.ResponseError type. options - EntitiesClientListOptions contains the optional parameters for the EntitiesClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetEntities.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewEntitiesClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	pager := client.List(&armmanagementgroups.EntitiesClientListOptions{Skiptoken: nil,
		Skip:         nil,
		Top:          nil,
		Select:       nil,
		Search:       nil,
		Filter:       nil,
		View:         nil,
		GroupName:    nil,
		CacheControl: nil,
	})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
			return
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type EntitiesClientListOptions added in v0.3.0

type EntitiesClientListOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
	// The filter parameter allows you to filter on the the name or display name fields. You can check for equality on the name
	// field (e.g. name eq '{entityName}') and you can check for substrings on either
	// the name or display name fields(e.g. contains(name, '{substringToSearch}'), contains(displayName, '{substringToSearch')).
	// Note that the '{entityName}' and '{substringToSearch}' fields are checked case
	// insensitively.
	Filter *string
	// A filter which allows the get entities call to focus on a particular group (i.e. "$filter=name eq 'groupName'")
	GroupName *string
	// The $search parameter is used in conjunction with the $filter parameter to return three different outputs depending on
	// the parameter passed in. With $search=AllowedParents the API will return the
	// entity info of all groups that the requested entity will be able to reparent to as determined by the user's permissions.
	// With $search=AllowedChildren the API will return the entity info of all
	// entities that can be added as children of the requested entity. With $search=ParentAndFirstLevelChildren the API will return
	// the parent and first level of children that the user has either direct
	// access to or indirect access via one of their descendants. With $search=ParentOnly the API will return only the group if
	// the user has access to at least one of the descendants of the group. With
	// $search=ChildrenOnly the API will return only the first level of children of the group entity info specified in $filter.
	// The user must have direct access to the children entities or one of it's
	// descendants for it to show up in the results.
	Search *EntitySearchType
	// This parameter specifies the fields to include in the response. Can include any combination of Name,DisplayName,Type,ParentDisplayNameChain,ParentChain,
	// e.g.
	// '$select=Name,DisplayName,Type,ParentDisplayNameChain,ParentNameChain'. When specified the $select parameter can override
	// select in $skipToken.
	Select *string
	// Number of entities to skip over when retrieving results. Passing this in will override $skipToken.
	Skip *int32
	// Page continuation token is only used if a previous operation returned a partial result. If a previous response contains
	// a nextLink element, the value of the nextLink element will include a token
	// parameter that specifies a starting point to use for subsequent calls.
	Skiptoken *string
	// Number of elements to return when retrieving results. Passing this in will override $skipToken.
	Top *int32
	// The view parameter allows clients to filter the type of data that is returned by the getEntities call.
	View *EntityViewParameterType
}

EntitiesClientListOptions contains the optional parameters for the EntitiesClient.List method.

type EntitiesClientListResponse added in v0.3.0

type EntitiesClientListResponse struct {
	EntityListResult
}

EntitiesClientListResponse contains the response from method EntitiesClient.List.

type EntityHierarchyItem

type EntityHierarchyItem struct {
	// The generic properties of a management group.
	Properties *EntityHierarchyItemProperties `json:"properties,omitempty"`

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string `json:"type,omitempty" azure:"ro"`
}

EntityHierarchyItem - The management group details for the hierarchy view.

type EntityHierarchyItemProperties

type EntityHierarchyItemProperties struct {
	// The list of children.
	Children []*EntityHierarchyItem `json:"children,omitempty"`

	// The friendly name of the management group.
	DisplayName *string `json:"displayName,omitempty"`

	// The users specific permissions to this item.
	Permissions *Permissions `json:"permissions,omitempty"`
}

EntityHierarchyItemProperties - The generic properties of a management group.

func (EntityHierarchyItemProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EntityHierarchyItemProperties.

type EntityInfo

type EntityInfo struct {
	// The generic properties of an entity.
	Properties *EntityInfoProperties `json:"properties,omitempty"`

	// READ-ONLY; The fully qualified ID for the entity. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the entity. For example, 00000000-0000-0000-0000-000000000000
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string `json:"type,omitempty" azure:"ro"`
}

EntityInfo - The entity.

type EntityInfoProperties

type EntityInfoProperties struct {
	// The friendly name of the management group.
	DisplayName *string `json:"displayName,omitempty"`

	// The users specific permissions to this item.
	InheritedPermissions *Permissions `json:"inheritedPermissions,omitempty"`

	// Number of children is the number of Groups that are exactly one level underneath the current Group.
	NumberOfChildGroups *int32 `json:"numberOfChildGroups,omitempty"`

	// Number of children is the number of Groups and Subscriptions that are exactly one level underneath the current Group.
	NumberOfChildren *int32 `json:"numberOfChildren,omitempty"`

	// Number of Descendants
	NumberOfDescendants *int32 `json:"numberOfDescendants,omitempty"`

	// (Optional) The ID of the parent management group.
	Parent *EntityParentGroupInfo `json:"parent,omitempty"`

	// The parent display name chain from the root group to the immediate parent
	ParentDisplayNameChain []*string `json:"parentDisplayNameChain,omitempty"`

	// The parent name chain from the root group to the immediate parent
	ParentNameChain []*string `json:"parentNameChain,omitempty"`

	// The users specific permissions to this item.
	Permissions *Permissions `json:"permissions,omitempty"`

	// The AAD Tenant ID associated with the entity. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string `json:"tenantId,omitempty"`
}

EntityInfoProperties - The generic properties of an entity.

func (EntityInfoProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EntityInfoProperties.

type EntityListResult

type EntityListResult struct {
	// The list of entities.
	Value []*EntityInfo `json:"value,omitempty"`

	// READ-ONLY; Total count of records that match the filter
	Count *int32 `json:"count,omitempty" azure:"ro"`

	// READ-ONLY; The URL to use for getting the next set of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`
}

EntityListResult - Describes the result of the request to view entities.

func (EntityListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EntityListResult.

type EntityParentGroupInfo

type EntityParentGroupInfo struct {
	// The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty"`
}

EntityParentGroupInfo - (Optional) The ID of the parent management group.

type EntitySearchType added in v0.4.0

type EntitySearchType string
const (
	EntitySearchTypeAllowedChildren             EntitySearchType = "AllowedChildren"
	EntitySearchTypeAllowedParents              EntitySearchType = "AllowedParents"
	EntitySearchTypeChildrenOnly                EntitySearchType = "ChildrenOnly"
	EntitySearchTypeParentAndFirstLevelChildren EntitySearchType = "ParentAndFirstLevelChildren"
	EntitySearchTypeParentOnly                  EntitySearchType = "ParentOnly"
)

func PossibleEntitySearchTypeValues added in v0.4.0

func PossibleEntitySearchTypeValues() []EntitySearchType

PossibleEntitySearchTypeValues returns the possible values for the EntitySearchType const type.

type EntityViewParameterType added in v0.4.0

type EntityViewParameterType string
const (
	EntityViewParameterTypeAudit             EntityViewParameterType = "Audit"
	EntityViewParameterTypeFullHierarchy     EntityViewParameterType = "FullHierarchy"
	EntityViewParameterTypeGroupsOnly        EntityViewParameterType = "GroupsOnly"
	EntityViewParameterTypeSubscriptionsOnly EntityViewParameterType = "SubscriptionsOnly"
)

func PossibleEntityViewParameterTypeValues added in v0.4.0

func PossibleEntityViewParameterTypeValues() []EntityViewParameterType

PossibleEntityViewParameterTypeValues returns the possible values for the EntityViewParameterType const type.

type ErrorDetails

type ErrorDetails struct {
	// One of a server-defined set of error codes.
	Code *string `json:"code,omitempty"`

	// A human-readable representation of the error's details.
	Details *string `json:"details,omitempty"`

	// A human-readable representation of the error.
	Message *string `json:"message,omitempty"`
}

ErrorDetails - The details of the error.

type ErrorResponse

type ErrorResponse struct {
	// The details of the error.
	Error *ErrorDetails `json:"error,omitempty"`
}

ErrorResponse - The error object.

type HierarchySettings

type HierarchySettings struct {
	// The generic properties of hierarchy settings.
	Properties *HierarchySettingsProperties `json:"properties,omitempty"`

	// READ-ONLY; The fully qualified ID for the settings object. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/settings/default.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the object. In this case, default.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups/settings.
	Type *string `json:"type,omitempty" azure:"ro"`
}

HierarchySettings - Settings defined at the Management Group scope.

type HierarchySettingsClient

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

HierarchySettingsClient contains the methods for the HierarchySettings group. Don't use this type directly, use NewHierarchySettingsClient() instead.

func NewHierarchySettingsClient

func NewHierarchySettingsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*HierarchySettingsClient, error)

NewHierarchySettingsClient creates a new instance of HierarchySettingsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*HierarchySettingsClient) CreateOrUpdate

CreateOrUpdate - Creates or updates the hierarchy settings defined at the Management Group level. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. createTenantSettingsRequest - Tenant level settings request parameter. options - HierarchySettingsClientCreateOrUpdateOptions contains the optional parameters for the HierarchySettingsClient.CreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/PutHierarchySettings.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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewHierarchySettingsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	res, err := client.CreateOrUpdate(ctx,
		"<group-id>",
		armmanagementgroups.CreateOrUpdateSettingsRequest{
			Properties: &armmanagementgroups.CreateOrUpdateSettingsProperties{
				DefaultManagementGroup:               to.Ptr("<default-management-group>"),
				RequireAuthorizationForGroupCreation: to.Ptr(true),
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

func (*HierarchySettingsClient) Delete

Delete - Deletes the hierarchy settings defined at the Management Group level. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. options - HierarchySettingsClientDeleteOptions contains the optional parameters for the HierarchySettingsClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/DeleteHierarchySettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewHierarchySettingsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	_, err = client.Delete(ctx,
		"<group-id>",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
}
Output:

func (*HierarchySettingsClient) Get

Get - Gets the hierarchy settings defined at the Management Group level. Settings can only be set on the root Management Group of the hierarchy. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. options - HierarchySettingsClientGetOptions contains the optional parameters for the HierarchySettingsClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetHierarchySettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewHierarchySettingsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	res, err := client.Get(ctx,
		"<group-id>",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

func (*HierarchySettingsClient) List

List - Gets all the hierarchy settings defined at the Management Group level. Settings can only be set on the root Management Group of the hierarchy. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. options - HierarchySettingsClientListOptions contains the optional parameters for the HierarchySettingsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/ListHierarchySettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewHierarchySettingsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	res, err := client.List(ctx,
		"<group-id>",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

func (*HierarchySettingsClient) Update

Update - Updates the hierarchy settings defined at the Management Group level. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. createTenantSettingsRequest - Tenant level settings request parameter. options - HierarchySettingsClientUpdateOptions contains the optional parameters for the HierarchySettingsClient.Update method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/PatchHierarchySettings.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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewHierarchySettingsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	res, err := client.Update(ctx,
		"<group-id>",
		armmanagementgroups.CreateOrUpdateSettingsRequest{
			Properties: &armmanagementgroups.CreateOrUpdateSettingsProperties{
				DefaultManagementGroup:               to.Ptr("<default-management-group>"),
				RequireAuthorizationForGroupCreation: to.Ptr(true),
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

type HierarchySettingsClientCreateOrUpdateOptions added in v0.3.0

type HierarchySettingsClientCreateOrUpdateOptions struct {
}

HierarchySettingsClientCreateOrUpdateOptions contains the optional parameters for the HierarchySettingsClient.CreateOrUpdate method.

type HierarchySettingsClientCreateOrUpdateResponse added in v0.3.0

type HierarchySettingsClientCreateOrUpdateResponse struct {
	HierarchySettings
}

HierarchySettingsClientCreateOrUpdateResponse contains the response from method HierarchySettingsClient.CreateOrUpdate.

type HierarchySettingsClientDeleteOptions added in v0.3.0

type HierarchySettingsClientDeleteOptions struct {
}

HierarchySettingsClientDeleteOptions contains the optional parameters for the HierarchySettingsClient.Delete method.

type HierarchySettingsClientDeleteResponse added in v0.3.0

type HierarchySettingsClientDeleteResponse struct {
}

HierarchySettingsClientDeleteResponse contains the response from method HierarchySettingsClient.Delete.

type HierarchySettingsClientGetOptions added in v0.3.0

type HierarchySettingsClientGetOptions struct {
}

HierarchySettingsClientGetOptions contains the optional parameters for the HierarchySettingsClient.Get method.

type HierarchySettingsClientGetResponse added in v0.3.0

type HierarchySettingsClientGetResponse struct {
	HierarchySettings
}

HierarchySettingsClientGetResponse contains the response from method HierarchySettingsClient.Get.

type HierarchySettingsClientListOptions added in v0.3.0

type HierarchySettingsClientListOptions struct {
}

HierarchySettingsClientListOptions contains the optional parameters for the HierarchySettingsClient.List method.

type HierarchySettingsClientListResponse added in v0.3.0

type HierarchySettingsClientListResponse struct {
	HierarchySettingsList
}

HierarchySettingsClientListResponse contains the response from method HierarchySettingsClient.List.

type HierarchySettingsClientUpdateOptions added in v0.3.0

type HierarchySettingsClientUpdateOptions struct {
}

HierarchySettingsClientUpdateOptions contains the optional parameters for the HierarchySettingsClient.Update method.

type HierarchySettingsClientUpdateResponse added in v0.3.0

type HierarchySettingsClientUpdateResponse struct {
	HierarchySettings
}

HierarchySettingsClientUpdateResponse contains the response from method HierarchySettingsClient.Update.

type HierarchySettingsInfo

type HierarchySettingsInfo struct {
	// The generic properties of hierarchy settings.
	Properties *HierarchySettingsProperties `json:"properties,omitempty"`

	// READ-ONLY; The fully qualified ID for the settings object. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/settings/default.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the object. In this case, default.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups/settings.
	Type *string `json:"type,omitempty" azure:"ro"`
}

HierarchySettingsInfo - The hierarchy settings resource.

type HierarchySettingsList

type HierarchySettingsList struct {
	// The list of hierarchy settings.
	Value []*HierarchySettingsInfo `json:"value,omitempty"`

	// READ-ONLY; The URL to use for getting the next set of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`
}

HierarchySettingsList - Lists all hierarchy settings.

func (HierarchySettingsList) MarshalJSON

func (h HierarchySettingsList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HierarchySettingsList.

type HierarchySettingsProperties

type HierarchySettingsProperties struct {
	// Settings that sets the default Management Group under which new subscriptions get added in this tenant. For example, /providers/Microsoft.Management/managementGroups/defaultGroup
	DefaultManagementGroup *string `json:"defaultManagementGroup,omitempty"`

	// Indicates whether RBAC access is required upon group creation under the root Management Group. If set to true, user will
	// require Microsoft.Management/managementGroups/write action on the root
	// Management Group scope in order to create new Groups directly under the root. This will prevent new users from creating
	// new Management Groups, unless they are given access.
	RequireAuthorizationForGroupCreation *bool `json:"requireAuthorizationForGroupCreation,omitempty"`

	// The AAD Tenant ID associated with the hierarchy settings. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string `json:"tenantId,omitempty"`
}

HierarchySettingsProperties - The generic properties of hierarchy settings.

type ListSubscriptionUnderManagementGroup

type ListSubscriptionUnderManagementGroup struct {
	// The list of subscriptions.
	Value []*SubscriptionUnderManagementGroup `json:"value,omitempty"`

	// READ-ONLY; The URL to use for getting the next set of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`
}

ListSubscriptionUnderManagementGroup - The details of all subscriptions under management group.

func (ListSubscriptionUnderManagementGroup) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ListSubscriptionUnderManagementGroup.

type ManagementGroup

type ManagementGroup struct {
	// The generic properties of a management group.
	Properties *ManagementGroupProperties `json:"properties,omitempty"`

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagementGroup - The management group details.

type ManagementGroupChildInfo

type ManagementGroupChildInfo struct {
	// The list of children.
	Children []*ManagementGroupChildInfo `json:"children,omitempty"`

	// The friendly name of the child resource.
	DisplayName *string `json:"displayName,omitempty"`

	// The fully qualified ID for the child resource (management group or subscription). For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty"`

	// The name of the child entity.
	Name *string `json:"name,omitempty"`

	// The fully qualified resource type which includes provider namespace (e.g. Microsoft.Management/managementGroups)
	Type *ManagementGroupChildType `json:"type,omitempty"`
}

ManagementGroupChildInfo - The child information of a management group.

func (ManagementGroupChildInfo) MarshalJSON

func (m ManagementGroupChildInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroupChildInfo.

type ManagementGroupChildType

type ManagementGroupChildType string

ManagementGroupChildType - The type of child resource.

const (
	ManagementGroupChildTypeMicrosoftManagementManagementGroups ManagementGroupChildType = "Microsoft.Management/managementGroups"
	ManagementGroupChildTypeSubscriptions                       ManagementGroupChildType = "/subscriptions"
)

func PossibleManagementGroupChildTypeValues

func PossibleManagementGroupChildTypeValues() []ManagementGroupChildType

PossibleManagementGroupChildTypeValues returns the possible values for the ManagementGroupChildType const type.

type ManagementGroupDetails

type ManagementGroupDetails struct {
	// The ancestors of the management group.
	ManagementGroupAncestors []*string `json:"managementGroupAncestors,omitempty"`

	// The ancestors of the management group displayed in reversed order, from immediate parent to the root.
	ManagementGroupAncestorsChain []*ManagementGroupPathElement `json:"managementGroupAncestorsChain,omitempty"`

	// (Optional) The ID of the parent management group.
	Parent *ParentGroupInfo `json:"parent,omitempty"`

	// The path from the root to the current group.
	Path []*ManagementGroupPathElement `json:"path,omitempty"`

	// The identity of the principal or process that updated the object.
	UpdatedBy *string `json:"updatedBy,omitempty"`

	// The date and time when this object was last updated.
	UpdatedTime *time.Time `json:"updatedTime,omitempty"`

	// The version number of the object.
	Version *int32 `json:"version,omitempty"`
}

ManagementGroupDetails - The details of a management group.

func (ManagementGroupDetails) MarshalJSON

func (m ManagementGroupDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroupDetails.

func (*ManagementGroupDetails) UnmarshalJSON

func (m *ManagementGroupDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupDetails.

type ManagementGroupExpandType added in v0.4.0

type ManagementGroupExpandType string
const (
	ManagementGroupExpandTypeAncestors ManagementGroupExpandType = "ancestors"
	ManagementGroupExpandTypeChildren  ManagementGroupExpandType = "children"
	ManagementGroupExpandTypePath      ManagementGroupExpandType = "path"
)

func PossibleManagementGroupExpandTypeValues added in v0.4.0

func PossibleManagementGroupExpandTypeValues() []ManagementGroupExpandType

PossibleManagementGroupExpandTypeValues returns the possible values for the ManagementGroupExpandType const type.

type ManagementGroupInfo

type ManagementGroupInfo struct {
	// The generic properties of a management group.
	Properties *ManagementGroupInfoProperties `json:"properties,omitempty"`

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagementGroupInfo - The management group resource.

type ManagementGroupInfoProperties

type ManagementGroupInfoProperties struct {
	// The friendly name of the management group.
	DisplayName *string `json:"displayName,omitempty"`

	// The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string `json:"tenantId,omitempty"`
}

ManagementGroupInfoProperties - The generic properties of a management group.

type ManagementGroupListResult

type ManagementGroupListResult struct {
	// The list of management groups.
	Value []*ManagementGroupInfo `json:"value,omitempty"`

	// READ-ONLY; The URL to use for getting the next set of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`
}

ManagementGroupListResult - Describes the result of the request to list management groups.

func (ManagementGroupListResult) MarshalJSON

func (m ManagementGroupListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroupListResult.

type ManagementGroupPathElement

type ManagementGroupPathElement struct {
	// The friendly name of the group.
	DisplayName *string `json:"displayName,omitempty"`

	// The name of the group.
	Name *string `json:"name,omitempty"`
}

ManagementGroupPathElement - A path element of a management group ancestors.

type ManagementGroupProperties

type ManagementGroupProperties struct {
	// The list of children.
	Children []*ManagementGroupChildInfo `json:"children,omitempty"`

	// The details of a management group.
	Details *ManagementGroupDetails `json:"details,omitempty"`

	// The friendly name of the management group.
	DisplayName *string `json:"displayName,omitempty"`

	// The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string `json:"tenantId,omitempty"`
}

ManagementGroupProperties - The generic properties of a management group.

func (ManagementGroupProperties) MarshalJSON

func (m ManagementGroupProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroupProperties.

type ManagementGroupSubscriptionsClient

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

ManagementGroupSubscriptionsClient contains the methods for the ManagementGroupSubscriptions group. Don't use this type directly, use NewManagementGroupSubscriptionsClient() instead.

func NewManagementGroupSubscriptionsClient

func NewManagementGroupSubscriptionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementGroupSubscriptionsClient, error)

NewManagementGroupSubscriptionsClient creates a new instance of ManagementGroupSubscriptionsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*ManagementGroupSubscriptionsClient) Create

Create - Associates existing subscription with the management group. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. subscriptionID - Subscription ID. options - ManagementGroupSubscriptionsClientCreateOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.Create method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/AddManagementGroupSubscription.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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewManagementGroupSubscriptionsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	res, err := client.Create(ctx,
		"<group-id>",
		"<subscription-id>",
		&armmanagementgroups.ManagementGroupSubscriptionsClientCreateOptions{CacheControl: to.Ptr("<cache-control>")})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

func (*ManagementGroupSubscriptionsClient) Delete

Delete - De-associates subscription from the management group. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. subscriptionID - Subscription ID. options - ManagementGroupSubscriptionsClientDeleteOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/RemoveManagementGroupSubscription.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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewManagementGroupSubscriptionsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	_, err = client.Delete(ctx,
		"<group-id>",
		"<subscription-id>",
		&armmanagementgroups.ManagementGroupSubscriptionsClientDeleteOptions{CacheControl: to.Ptr("<cache-control>")})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
}
Output:

func (*ManagementGroupSubscriptionsClient) GetSubscription

GetSubscription - Retrieves details about given subscription which is associated with the management group. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. subscriptionID - Subscription ID. options - ManagementGroupSubscriptionsClientGetSubscriptionOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.GetSubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetSubscriptionFromManagementGroup.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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewManagementGroupSubscriptionsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	res, err := client.GetSubscription(ctx,
		"<group-id>",
		"<subscription-id>",
		&armmanagementgroups.ManagementGroupSubscriptionsClientGetSubscriptionOptions{CacheControl: to.Ptr("<cache-control>")})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
		return
	}
	// TODO: use response item
	_ = res
}
Output:

func (*ManagementGroupSubscriptionsClient) GetSubscriptionsUnderManagementGroup

GetSubscriptionsUnderManagementGroup - Retrieves details about all subscriptions which are associated with the management group. If the operation fails it returns an *azcore.ResponseError type. groupID - Management Group ID. options - ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.GetSubscriptionsUnderManagementGroup method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetAllSubscriptionsFromManagementGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewManagementGroupSubscriptionsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	pager := client.GetSubscriptionsUnderManagementGroup("<group-id>",
		&armmanagementgroups.ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupOptions{Skiptoken: nil})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
			return
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type ManagementGroupSubscriptionsClientCreateOptions added in v0.3.0

type ManagementGroupSubscriptionsClientCreateOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
}

ManagementGroupSubscriptionsClientCreateOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.Create method.

type ManagementGroupSubscriptionsClientCreateResponse added in v0.3.0

type ManagementGroupSubscriptionsClientCreateResponse struct {
	SubscriptionUnderManagementGroup
}

ManagementGroupSubscriptionsClientCreateResponse contains the response from method ManagementGroupSubscriptionsClient.Create.

type ManagementGroupSubscriptionsClientDeleteOptions added in v0.3.0

type ManagementGroupSubscriptionsClientDeleteOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
}

ManagementGroupSubscriptionsClientDeleteOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.Delete method.

type ManagementGroupSubscriptionsClientDeleteResponse added in v0.3.0

type ManagementGroupSubscriptionsClientDeleteResponse struct {
}

ManagementGroupSubscriptionsClientDeleteResponse contains the response from method ManagementGroupSubscriptionsClient.Delete.

type ManagementGroupSubscriptionsClientGetSubscriptionOptions added in v0.3.0

type ManagementGroupSubscriptionsClientGetSubscriptionOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
}

ManagementGroupSubscriptionsClientGetSubscriptionOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.GetSubscription method.

type ManagementGroupSubscriptionsClientGetSubscriptionResponse added in v0.3.0

type ManagementGroupSubscriptionsClientGetSubscriptionResponse struct {
	SubscriptionUnderManagementGroup
}

ManagementGroupSubscriptionsClientGetSubscriptionResponse contains the response from method ManagementGroupSubscriptionsClient.GetSubscription.

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupOptions added in v0.3.0

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupOptions struct {
	// Page continuation token is only used if a previous operation returned a partial result. If a previous response contains
	// a nextLink element, the value of the nextLink element will include a token
	// parameter that specifies a starting point to use for subsequent calls.
	Skiptoken *string
}

ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.GetSubscriptionsUnderManagementGroup method.

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResponse added in v0.3.0

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResponse struct {
	ListSubscriptionUnderManagementGroup
}

ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResponse contains the response from method ManagementGroupSubscriptionsClient.GetSubscriptionsUnderManagementGroup.

type Operation

type Operation struct {
	// The object that represents the operation.
	Display *OperationDisplayProperties `json:"display,omitempty"`

	// READ-ONLY; Operation name: {provider}/{resource}/{operation}.
	Name *string `json:"name,omitempty" azure:"ro"`
}

Operation supported by the Microsoft.Management resource provider.

type OperationDisplayProperties

type OperationDisplayProperties struct {
	// READ-ONLY; Operation description.
	Description *string `json:"description,omitempty" azure:"ro"`

	// READ-ONLY; The operation that can be performed.
	Operation *string `json:"operation,omitempty" azure:"ro"`

	// READ-ONLY; The name of the provider.
	Provider *string `json:"provider,omitempty" azure:"ro"`

	// READ-ONLY; The resource on which the operation is performed.
	Resource *string `json:"resource,omitempty" azure:"ro"`
}

OperationDisplayProperties - The object that represents the operation.

type OperationListResult

type OperationListResult struct {
	// READ-ONLY; URL to get the next set of operation list results if there are any.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; List of operations supported by the Microsoft.Management resource provider.
	Value []*Operation `json:"value,omitempty" azure:"ro"`
}

OperationListResult - Describes the result of the request to list Microsoft.Management operations.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

type OperationResults

type OperationResults struct {
	// The generic properties of a management group.
	Properties *ManagementGroupInfoProperties `json:"properties,omitempty"`

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string `json:"type,omitempty" azure:"ro"`
}

OperationResults - The results of an asynchronous operation.

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) List

List - Lists all of the available Management REST API operations. If the operation fails it returns an *azcore.ResponseError type. options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/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/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
		return
	}
	ctx := context.Background()
	client, err := armmanagementgroups.NewOperationsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
		return
	}
	pager := client.List(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
			return
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type OperationsClientListOptions added in v0.3.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type ParentGroupInfo

type ParentGroupInfo struct {
	// The friendly name of the parent management group.
	DisplayName *string `json:"displayName,omitempty"`

	// The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string `json:"id,omitempty"`

	// The name of the parent management group
	Name *string `json:"name,omitempty"`
}

ParentGroupInfo - (Optional) The ID of the parent management group.

type PatchManagementGroupRequest

type PatchManagementGroupRequest struct {
	// The friendly name of the management group.
	DisplayName *string `json:"displayName,omitempty"`

	// (Optional) The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ParentGroupID *string `json:"parentGroupId,omitempty"`
}

PatchManagementGroupRequest - Management group patch parameters.

func (PatchManagementGroupRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PatchManagementGroupRequest.

type Permissions

type Permissions string

Permissions - The users specific permissions to this item.

const (
	PermissionsDelete   Permissions = "delete"
	PermissionsEdit     Permissions = "edit"
	PermissionsNoaccess Permissions = "noaccess"
	PermissionsView     Permissions = "view"
)

func PossiblePermissionsValues

func PossiblePermissionsValues() []Permissions

PossiblePermissionsValues returns the possible values for the Permissions const type.

type Reason

type Reason string

Reason - Required if nameAvailable == false. Invalid indicates the name provided does not match the resource provider's naming requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable.

const (
	ReasonInvalid       Reason = "Invalid"
	ReasonAlreadyExists Reason = "AlreadyExists"
)

func PossibleReasonValues

func PossibleReasonValues() []Reason

PossibleReasonValues returns the possible values for the Reason const type.

type Status

type Status string

Status - The status of the Tenant Backfill

const (
	StatusNotStarted               Status = "NotStarted"
	StatusNotStartedButGroupsExist Status = "NotStartedButGroupsExist"
	StatusStarted                  Status = "Started"
	StatusFailed                   Status = "Failed"
	StatusCancelled                Status = "Cancelled"
	StatusCompleted                Status = "Completed"
)

func PossibleStatusValues

func PossibleStatusValues() []Status

PossibleStatusValues returns the possible values for the Status const type.

type SubscriptionUnderManagementGroup

type SubscriptionUnderManagementGroup struct {
	// The generic properties of subscription under a management group.
	Properties *SubscriptionUnderManagementGroupProperties `json:"properties,omitempty"`

	// READ-ONLY; The fully qualified ID for the subscription. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/subscriptions/0000000-0000-0000-0000-000000000001
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The stringified id of the subscription. For example, 00000000-0000-0000-0000-000000000000
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups/subscriptions
	Type *string `json:"type,omitempty" azure:"ro"`
}

SubscriptionUnderManagementGroup - The details of subscription under management group.

type SubscriptionUnderManagementGroupProperties

type SubscriptionUnderManagementGroupProperties struct {
	// The friendly name of the subscription.
	DisplayName *string `json:"displayName,omitempty"`

	// The ID of the parent management group.
	Parent *DescendantParentGroupInfo `json:"parent,omitempty"`

	// The state of the subscription.
	State *string `json:"state,omitempty"`

	// The AAD Tenant ID associated with the subscription. For example, 00000000-0000-0000-0000-000000000000
	Tenant *string `json:"tenant,omitempty"`
}

SubscriptionUnderManagementGroupProperties - The generic properties of subscription under a management group.

type TenantBackfillStatusResult

type TenantBackfillStatusResult struct {
	// READ-ONLY; The status of the Tenant Backfill
	Status *Status `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string `json:"tenantId,omitempty" azure:"ro"`
}

TenantBackfillStatusResult - The tenant backfill status

Jump to

Keyboard shortcuts

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