armmanagementgroups

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: MIT Imports: 15 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 := 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{
    Host: arm.AzureChina,
}
client := 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

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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewAPIClient(cred, nil)
	res, err := client.CheckNameAvailability(ctx,
		armmanagementgroups.CheckNameAvailabilityRequest{
			Name: to.StringPtr("<name>"),
			Type: to.StringPtr("<type>"),
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.APIClientCheckNameAvailabilityResult)
}
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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewAPIClient(cred, nil)
	res, err := client.StartTenantBackfill(ctx,
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.APIClientStartTenantBackfillResult)
}
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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewAPIClient(cred, nil)
	res, err := client.TenantBackfillStatus(ctx,
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.APIClientTenantBackfillStatusResult)
}
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 {
	APIClientCheckNameAvailabilityResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

APIClientCheckNameAvailabilityResponse contains the response from method APIClient.CheckNameAvailability.

type APIClientCheckNameAvailabilityResult added in v0.3.0

type APIClientCheckNameAvailabilityResult struct {
	CheckNameAvailabilityResult
}

APIClientCheckNameAvailabilityResult contains the result 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 {
	APIClientStartTenantBackfillResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

APIClientStartTenantBackfillResponse contains the response from method APIClient.StartTenantBackfill.

type APIClientStartTenantBackfillResult added in v0.3.0

type APIClientStartTenantBackfillResult struct {
	TenantBackfillStatusResult
}

APIClientStartTenantBackfillResult contains the result 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 {
	APIClientTenantBackfillStatusResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

APIClientTenantBackfillStatusResponse contains the response from method APIClient.TenantBackfillStatus.

type APIClientTenantBackfillStatusResult added in v0.3.0

type APIClientTenantBackfillStatusResult struct {
	TenantBackfillStatusResult
}

APIClientTenantBackfillStatusResult contains the result 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

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) (ClientCreateOrUpdatePollerResponse, 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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewClient(cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<group-id>",
		armmanagementgroups.CreateManagementGroupRequest{
			Properties: &armmanagementgroups.CreateManagementGroupProperties{
				DisplayName: to.StringPtr("<display-name>"),
				Details: &armmanagementgroups.CreateManagementGroupDetails{
					Parent: &armmanagementgroups.CreateParentGroupInfo{
						ID: to.StringPtr("<id>"),
					},
				},
			},
		},
		&armmanagementgroups.ClientBeginCreateOrUpdateOptions{CacheControl: to.StringPtr("<cache-control>")})
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ClientCreateOrUpdateResult)
}
Output:

func (*Client) BeginDelete added in v0.3.0

func (client *Client) BeginDelete(ctx context.Context, groupID string, options *ClientBeginDeleteOptions) (ClientDeletePollerResponse, 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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewClient(cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<group-id>",
		&armmanagementgroups.ClientBeginDeleteOptions{CacheControl: to.StringPtr("<cache-control>")})
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewClient(cred, nil)
	res, err := client.Get(ctx,
		"<group-id>",
		&armmanagementgroups.ClientGetOptions{Expand: nil,
			Recurse:      nil,
			Filter:       nil,
			CacheControl: to.StringPtr("<cache-control>"),
		})
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ClientGetResult)
}
Output:

func (*Client) GetDescendants added in v0.3.0

func (client *Client) GetDescendants(groupID string, options *ClientGetDescendantsOptions) *ClientGetDescendantsPager

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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewClient(cred, nil)
	pager := client.GetDescendants("<group-id>",
		&armmanagementgroups.ClientGetDescendantsOptions{Skiptoken: nil,
			Top: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*Client) List added in v0.3.0

func (client *Client) List(options *ClientListOptions) *ClientListPager

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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewClient(cred, nil)
	pager := client.List(&armmanagementgroups.ClientListOptions{CacheControl: to.StringPtr("<cache-control>"),
		Skiptoken: nil,
	})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", 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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewClient(cred, nil)
	res, err := client.Update(ctx,
		"<group-id>",
		armmanagementgroups.PatchManagementGroupRequest{
			DisplayName:   to.StringPtr("<display-name>"),
			ParentGroupID: to.StringPtr("<parent-group-id>"),
		},
		&armmanagementgroups.ClientUpdateOptions{CacheControl: to.StringPtr("<cache-control>")})
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ClientUpdateResult)
}
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
}

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
}

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

type ClientCreateOrUpdatePoller added in v0.3.0

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

ClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ClientCreateOrUpdatePoller) Done added in v0.3.0

func (p *ClientCreateOrUpdatePoller) Done() bool

Done returns true if the LRO has reached a terminal state.

func (*ClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ClientCreateOrUpdateResponse will be returned.

func (*ClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

func (p *ClientCreateOrUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ClientCreateOrUpdatePollerResponse added in v0.3.0

type ClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ClientCreateOrUpdatePollerResponse contains the response from method Client.CreateOrUpdate.

func (ClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

func (l *ClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *Client, token string) error

Resume rehydrates a ClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ClientCreateOrUpdateResponse added in v0.3.0

type ClientCreateOrUpdateResponse struct {
	ClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ClientCreateOrUpdateResponse contains the response from method Client.CreateOrUpdate.

type ClientCreateOrUpdateResult added in v0.3.0

type ClientCreateOrUpdateResult struct {
	ManagementGroup
}

ClientCreateOrUpdateResult contains the result from method Client.CreateOrUpdate.

type ClientDeletePoller added in v0.3.0

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

ClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ClientDeletePoller) Done added in v0.3.0

func (p *ClientDeletePoller) Done() bool

Done returns true if the LRO has reached a terminal state.

func (*ClientDeletePoller) FinalResponse added in v0.3.0

func (p *ClientDeletePoller) FinalResponse(ctx context.Context) (ClientDeleteResponse, error)

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ClientDeleteResponse will be returned.

func (*ClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ClientDeletePoller) ResumeToken added in v0.3.0

func (p *ClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ClientDeletePollerResponse added in v0.3.0

type ClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ClientDeletePollerResponse contains the response from method Client.Delete.

func (ClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ClientDeletePollerResponse) Resume added in v0.3.0

func (l *ClientDeletePollerResponse) Resume(ctx context.Context, client *Client, token string) error

Resume rehydrates a ClientDeletePollerResponse from the provided client and resume token.

type ClientDeleteResponse added in v0.3.0

type ClientDeleteResponse struct {
	ClientDeleteResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ClientDeleteResponse contains the response from method Client.Delete.

type ClientDeleteResult added in v0.3.0

type ClientDeleteResult struct {
	AzureAsyncOperationResults
}

ClientDeleteResult contains the result 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 ClientGetDescendantsPager added in v0.3.0

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

ClientGetDescendantsPager provides operations for iterating over paged responses.

func (*ClientGetDescendantsPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ClientGetDescendantsPager) NextPage added in v0.3.0

func (p *ClientGetDescendantsPager) NextPage(ctx context.Context) bool

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ClientGetDescendantsPager) PageResponse added in v0.3.0

PageResponse returns the current ClientGetDescendantsResponse page.

type ClientGetDescendantsResponse added in v0.3.0

type ClientGetDescendantsResponse struct {
	ClientGetDescendantsResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ClientGetDescendantsResponse contains the response from method Client.GetDescendants.

type ClientGetDescendantsResult added in v0.3.0

type ClientGetDescendantsResult struct {
	DescendantListResult
}

ClientGetDescendantsResult contains the result 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 *Enum0
	// 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 {
	ClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ClientGetResponse contains the response from method Client.Get.

type ClientGetResult added in v0.3.0

type ClientGetResult struct {
	ManagementGroup
}

ClientGetResult contains the result 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 ClientListPager added in v0.3.0

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

ClientListPager provides operations for iterating over paged responses.

func (*ClientListPager) Err added in v0.3.0

func (p *ClientListPager) Err() error

Err returns the last error encountered while paging.

func (*ClientListPager) NextPage added in v0.3.0

func (p *ClientListPager) NextPage(ctx context.Context) bool

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ClientListPager) PageResponse added in v0.3.0

func (p *ClientListPager) PageResponse() ClientListResponse

PageResponse returns the current ClientListResponse page.

type ClientListResponse added in v0.3.0

type ClientListResponse struct {
	ClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ClientListResponse contains the response from method Client.List.

type ClientListResult added in v0.3.0

type ClientListResult struct {
	ManagementGroupListResult
}

ClientListResult contains the result 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 {
	ClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ClientUpdateResponse contains the response from method Client.Update.

type ClientUpdateResult added in v0.3.0

type ClientUpdateResult struct {
	ManagementGroup
}

ClientUpdateResult contains the result 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

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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewEntitiesClient(cred, nil)
	pager := client.List(&armmanagementgroups.EntitiesClientListOptions{Skiptoken: nil,
		Skip:         nil,
		Top:          nil,
		Select:       nil,
		Search:       nil,
		Filter:       nil,
		View:         nil,
		GroupName:    nil,
		CacheControl: nil,
	})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", 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 *Enum2
	// 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 *Enum3
}

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

type EntitiesClientListPager added in v0.3.0

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

EntitiesClientListPager provides operations for iterating over paged responses.

func (*EntitiesClientListPager) Err added in v0.3.0

func (p *EntitiesClientListPager) Err() error

Err returns the last error encountered while paging.

func (*EntitiesClientListPager) NextPage added in v0.3.0

func (p *EntitiesClientListPager) NextPage(ctx context.Context) bool

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*EntitiesClientListPager) PageResponse added in v0.3.0

PageResponse returns the current EntitiesClientListResponse page.

type EntitiesClientListResponse added in v0.3.0

type EntitiesClientListResponse struct {
	EntitiesClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

EntitiesClientListResponse contains the response from method EntitiesClient.List.

type EntitiesClientListResult added in v0.3.0

type EntitiesClientListResult struct {
	EntityListResult
}

EntitiesClientListResult contains the result 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 Enum0

type Enum0 string
const (
	Enum0Ancestors Enum0 = "ancestors"
	Enum0Children  Enum0 = "children"
	Enum0Path      Enum0 = "path"
)

func PossibleEnum0Values

func PossibleEnum0Values() []Enum0

PossibleEnum0Values returns the possible values for the Enum0 const type.

func (Enum0) ToPtr

func (c Enum0) ToPtr() *Enum0

ToPtr returns a *Enum0 pointing to the current value.

type Enum2

type Enum2 string
const (
	Enum2AllowedChildren             Enum2 = "AllowedChildren"
	Enum2AllowedParents              Enum2 = "AllowedParents"
	Enum2ChildrenOnly                Enum2 = "ChildrenOnly"
	Enum2ParentAndFirstLevelChildren Enum2 = "ParentAndFirstLevelChildren"
	Enum2ParentOnly                  Enum2 = "ParentOnly"
)

func PossibleEnum2Values

func PossibleEnum2Values() []Enum2

PossibleEnum2Values returns the possible values for the Enum2 const type.

func (Enum2) ToPtr

func (c Enum2) ToPtr() *Enum2

ToPtr returns a *Enum2 pointing to the current value.

type Enum3

type Enum3 string
const (
	Enum3Audit             Enum3 = "Audit"
	Enum3FullHierarchy     Enum3 = "FullHierarchy"
	Enum3GroupsOnly        Enum3 = "GroupsOnly"
	Enum3SubscriptionsOnly Enum3 = "SubscriptionsOnly"
)

func PossibleEnum3Values

func PossibleEnum3Values() []Enum3

PossibleEnum3Values returns the possible values for the Enum3 const type.

func (Enum3) ToPtr

func (c Enum3) ToPtr() *Enum3

ToPtr returns a *Enum3 pointing to the current value.

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

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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewHierarchySettingsClient(cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<group-id>",
		armmanagementgroups.CreateOrUpdateSettingsRequest{
			Properties: &armmanagementgroups.CreateOrUpdateSettingsProperties{
				DefaultManagementGroup:               to.StringPtr("<default-management-group>"),
				RequireAuthorizationForGroupCreation: to.BoolPtr(true),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.HierarchySettingsClientCreateOrUpdateResult)
}
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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewHierarchySettingsClient(cred, nil)
	_, err = client.Delete(ctx,
		"<group-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewHierarchySettingsClient(cred, nil)
	res, err := client.Get(ctx,
		"<group-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.HierarchySettingsClientGetResult)
}
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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewHierarchySettingsClient(cred, nil)
	res, err := client.List(ctx,
		"<group-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.HierarchySettingsClientListResult)
}
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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewHierarchySettingsClient(cred, nil)
	res, err := client.Update(ctx,
		"<group-id>",
		armmanagementgroups.CreateOrUpdateSettingsRequest{
			Properties: &armmanagementgroups.CreateOrUpdateSettingsProperties{
				DefaultManagementGroup:               to.StringPtr("<default-management-group>"),
				RequireAuthorizationForGroupCreation: to.BoolPtr(true),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.HierarchySettingsClientUpdateResult)
}
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 {
	HierarchySettingsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

HierarchySettingsClientCreateOrUpdateResponse contains the response from method HierarchySettingsClient.CreateOrUpdate.

type HierarchySettingsClientCreateOrUpdateResult added in v0.3.0

type HierarchySettingsClientCreateOrUpdateResult struct {
	HierarchySettings
}

HierarchySettingsClientCreateOrUpdateResult contains the result 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 {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

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 {
	HierarchySettingsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

HierarchySettingsClientGetResponse contains the response from method HierarchySettingsClient.Get.

type HierarchySettingsClientGetResult added in v0.3.0

type HierarchySettingsClientGetResult struct {
	HierarchySettings
}

HierarchySettingsClientGetResult contains the result 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 {
	HierarchySettingsClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

HierarchySettingsClientListResponse contains the response from method HierarchySettingsClient.List.

type HierarchySettingsClientListResult added in v0.3.0

type HierarchySettingsClientListResult struct {
	HierarchySettingsList
}

HierarchySettingsClientListResult contains the result 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 {
	HierarchySettingsClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

HierarchySettingsClientUpdateResponse contains the response from method HierarchySettingsClient.Update.

type HierarchySettingsClientUpdateResult added in v0.3.0

type HierarchySettingsClientUpdateResult struct {
	HierarchySettings
}

HierarchySettingsClientUpdateResult contains the result 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.

func (ManagementGroupChildType) ToPtr

ToPtr returns a *ManagementGroupChildType pointing to the current value.

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

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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewManagementGroupSubscriptionsClient(cred, nil)
	res, err := client.Create(ctx,
		"<group-id>",
		"<subscription-id>",
		&armmanagementgroups.ManagementGroupSubscriptionsClientCreateOptions{CacheControl: to.StringPtr("<cache-control>")})
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagementGroupSubscriptionsClientCreateResult)
}
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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewManagementGroupSubscriptionsClient(cred, nil)
	_, err = client.Delete(ctx,
		"<group-id>",
		"<subscription-id>",
		&armmanagementgroups.ManagementGroupSubscriptionsClientDeleteOptions{CacheControl: to.StringPtr("<cache-control>")})
	if err != nil {
		log.Fatal(err)
	}
}
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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewManagementGroupSubscriptionsClient(cred, nil)
	res, err := client.GetSubscription(ctx,
		"<group-id>",
		"<subscription-id>",
		&armmanagementgroups.ManagementGroupSubscriptionsClientGetSubscriptionOptions{CacheControl: to.StringPtr("<cache-control>")})
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagementGroupSubscriptionsClientGetSubscriptionResult)
}
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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewManagementGroupSubscriptionsClient(cred, nil)
	pager := client.GetSubscriptionsUnderManagementGroup("<group-id>",
		&armmanagementgroups.ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupOptions{Skiptoken: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", 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 {
	ManagementGroupSubscriptionsClientCreateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagementGroupSubscriptionsClientCreateResponse contains the response from method ManagementGroupSubscriptionsClient.Create.

type ManagementGroupSubscriptionsClientCreateResult added in v0.3.0

type ManagementGroupSubscriptionsClientCreateResult struct {
	SubscriptionUnderManagementGroup
}

ManagementGroupSubscriptionsClientCreateResult contains the result 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 {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

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 {
	ManagementGroupSubscriptionsClientGetSubscriptionResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagementGroupSubscriptionsClientGetSubscriptionResponse contains the response from method ManagementGroupSubscriptionsClient.GetSubscription.

type ManagementGroupSubscriptionsClientGetSubscriptionResult added in v0.3.0

type ManagementGroupSubscriptionsClientGetSubscriptionResult struct {
	SubscriptionUnderManagementGroup
}

ManagementGroupSubscriptionsClientGetSubscriptionResult contains the result 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 ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupPager added in v0.3.0

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

ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupPager provides operations for iterating over paged responses.

func (*ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupPager) PageResponse added in v0.3.0

PageResponse returns the current ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResponse page.

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResponse added in v0.3.0

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResponse struct {
	ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResponse contains the response from method ManagementGroupSubscriptionsClient.GetSubscriptionsUnderManagementGroup.

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResult added in v0.3.0

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResult struct {
	ListSubscriptionUnderManagementGroup
}

ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResult contains the result 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

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

x-ms-original-file: 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)
	}
	ctx := context.Background()
	client := armmanagementgroups.NewOperationsClient(cred, nil)
	pager := client.List(nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type OperationsClientListOptions added in v0.3.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListPager added in v0.3.0

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

OperationsClientListPager provides operations for iterating over paged responses.

func (*OperationsClientListPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*OperationsClientListPager) NextPage added in v0.3.0

func (p *OperationsClientListPager) NextPage(ctx context.Context) bool

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*OperationsClientListPager) PageResponse added in v0.3.0

PageResponse returns the current OperationsClientListResponse page.

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	OperationsClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type OperationsClientListResult added in v0.3.0

type OperationsClientListResult struct {
	OperationListResult
}

OperationsClientListResult contains the result 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.

func (Permissions) ToPtr

func (c Permissions) ToPtr() *Permissions

ToPtr returns a *Permissions pointing to the current value.

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.

func (Reason) ToPtr

func (c Reason) ToPtr() *Reason

ToPtr returns a *Reason pointing to the current value.

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.

func (Status) ToPtr

func (c Status) ToPtr() *Status

ToPtr returns a *Status pointing to the current value.

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