armportal

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 12 Imported by: 3

README

Azure Portal Module for Go

PkgGoDev

The armportal module provides operations for working with Azure Portal.

Source code

Getting started

Prerequisites

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

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Portal module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal

Authorization

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

cred, err := azidentity.NewDefaultAzureCredential(nil)

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

Client Factory

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

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

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

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

Clients

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

client := clientFactory.NewDashboardsClient()

Fakes

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

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

Provide Feedback

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

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

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

func NewClientFactory added in v0.6.0

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

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

  • subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewDashboardsClient added in v0.6.0

func (c *ClientFactory) NewDashboardsClient() *DashboardsClient

NewDashboardsClient creates a new instance of DashboardsClient.

func (*ClientFactory) NewListTenantConfigurationViolationsClient added in v0.6.0

func (c *ClientFactory) NewListTenantConfigurationViolationsClient() *ListTenantConfigurationViolationsClient

NewListTenantConfigurationViolationsClient creates a new instance of ListTenantConfigurationViolationsClient.

func (*ClientFactory) NewOperationsClient added in v0.6.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewTenantConfigurationsClient added in v0.6.0

func (c *ClientFactory) NewTenantConfigurationsClient() *TenantConfigurationsClient

NewTenantConfigurationsClient creates a new instance of TenantConfigurationsClient.

type Configuration

type Configuration struct {
	// Tenant configuration properties.
	Properties *ConfigurationProperties

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

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

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

Configuration - Tenant configuration.

func (Configuration) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type Configuration.

func (*Configuration) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Configuration.

type ConfigurationList

type ConfigurationList struct {
	// The URL to use for getting the next set of results.
	NextLink *string

	// The array of tenant configurations.
	Value []*Configuration
}

ConfigurationList - List of tenant configurations.

func (ConfigurationList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationList.

func (*ConfigurationList) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationList.

type ConfigurationName

type ConfigurationName string
const (
	ConfigurationNameDefault ConfigurationName = "default"
)

func PossibleConfigurationNameValues

func PossibleConfigurationNameValues() []ConfigurationName

PossibleConfigurationNameValues returns the possible values for the ConfigurationName const type.

type ConfigurationProperties

type ConfigurationProperties struct {
	// When flag is set to true Markdown tile will require external storage configuration (URI). The inline content configuration
	// will be prohibited.
	EnforcePrivateMarkdownStorage *bool
}

ConfigurationProperties - Tenant configuration properties.

func (ConfigurationProperties) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationProperties.

func (*ConfigurationProperties) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProperties.

type Dashboard

type Dashboard struct {
	// REQUIRED; Resource location
	Location *string

	// The shared dashboard properties.
	Properties *DashboardProperties

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Resource Id
	ID *string

	// READ-ONLY; Resource name
	Name *string

	// READ-ONLY; Resource type
	Type *string
}

Dashboard - The shared dashboard resource definition.

func (Dashboard) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Dashboard.

func (*Dashboard) UnmarshalJSON added in v0.6.0

func (d *Dashboard) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Dashboard.

type DashboardLens

type DashboardLens struct {
	// REQUIRED; The lens order.
	Order *int32

	// REQUIRED; The dashboard parts.
	Parts []*DashboardParts

	// The dashboard len's metadata.
	Metadata map[string]any
}

DashboardLens - A dashboard lens.

func (DashboardLens) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DashboardLens.

func (*DashboardLens) UnmarshalJSON added in v0.6.0

func (d *DashboardLens) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DashboardLens.

type DashboardListResult

type DashboardListResult struct {
	// The URL to use for getting the next set of results.
	NextLink *string

	// The array of custom resource provider manifests.
	Value []*Dashboard
}

DashboardListResult - List of dashboards.

func (DashboardListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DashboardListResult.

func (*DashboardListResult) UnmarshalJSON added in v0.6.0

func (d *DashboardListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DashboardListResult.

type DashboardPartMetadata

type DashboardPartMetadata struct {
	// REQUIRED; The type of dashboard part.
	Type *string

	// OPTIONAL; Contains additional key/value pairs not defined in the schema.
	AdditionalProperties map[string]any
}

DashboardPartMetadata - A dashboard part metadata.

func (*DashboardPartMetadata) GetDashboardPartMetadata

func (d *DashboardPartMetadata) GetDashboardPartMetadata() *DashboardPartMetadata

GetDashboardPartMetadata implements the DashboardPartMetadataClassification interface for type DashboardPartMetadata.

func (DashboardPartMetadata) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type DashboardPartMetadata.

func (*DashboardPartMetadata) UnmarshalJSON

func (d *DashboardPartMetadata) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DashboardPartMetadata.

type DashboardPartMetadataClassification

type DashboardPartMetadataClassification interface {
	// GetDashboardPartMetadata returns the DashboardPartMetadata content of the underlying type.
	GetDashboardPartMetadata() *DashboardPartMetadata
}

DashboardPartMetadataClassification provides polymorphic access to related types. Call the interface's GetDashboardPartMetadata() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *DashboardPartMetadata, *MarkdownPartMetadata

type DashboardParts

type DashboardParts struct {
	// REQUIRED; The dashboard's part position.
	Position *DashboardPartsPosition

	// The dashboard part's metadata.
	Metadata DashboardPartMetadataClassification
}

DashboardParts - A dashboard part.

func (DashboardParts) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DashboardParts.

func (*DashboardParts) UnmarshalJSON

func (d *DashboardParts) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DashboardParts.

type DashboardPartsPosition

type DashboardPartsPosition struct {
	// REQUIRED; The dashboard's part column span.
	ColSpan *int32

	// REQUIRED; The dashboard's part row span.
	RowSpan *int32

	// REQUIRED; The dashboard's part x coordinate.
	X *int32

	// REQUIRED; The dashboard's part y coordinate.
	Y *int32

	// The dashboard part's metadata.
	Metadata map[string]any
}

DashboardPartsPosition - The dashboard's part position.

func (DashboardPartsPosition) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DashboardPartsPosition.

func (*DashboardPartsPosition) UnmarshalJSON added in v0.6.0

func (d *DashboardPartsPosition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DashboardPartsPosition.

type DashboardProperties

type DashboardProperties struct {
	// The dashboard lenses.
	Lenses []*DashboardLens

	// The dashboard metadata.
	Metadata map[string]any
}

DashboardProperties - The shared dashboard properties.

func (DashboardProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DashboardProperties.

func (*DashboardProperties) UnmarshalJSON added in v0.6.0

func (d *DashboardProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DashboardProperties.

type DashboardsClient

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

DashboardsClient contains the methods for the Dashboards group. Don't use this type directly, use NewDashboardsClient() instead.

func NewDashboardsClient

func NewDashboardsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DashboardsClient, error)

NewDashboardsClient creates a new instance of DashboardsClient with the specified values.

  • subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*DashboardsClient) CreateOrUpdate

func (client *DashboardsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, dashboardName string, dashboard Dashboard, options *DashboardsClientCreateOrUpdateOptions) (DashboardsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a Dashboard. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-09-01-preview

  • resourceGroupName - The name of the resource group.
  • dashboardName - The name of the dashboard.
  • dashboard - The parameters required to create or update a dashboard.
  • options - DashboardsClientCreateOrUpdateOptions contains the optional parameters for the DashboardsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/createOrUpdateDashboard.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/portal/armportal"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armportal.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDashboardsClient().CreateOrUpdate(ctx, "testRG", "testDashboard", armportal.Dashboard{
		Location: to.Ptr("eastus"),
		Properties: &armportal.DashboardProperties{
			Lenses: []*armportal.DashboardLens{
				{
					Order: to.Ptr[int32](1),
					Parts: []*armportal.DashboardParts{
						{
							Position: &armportal.DashboardPartsPosition{
								ColSpan: to.Ptr[int32](3),
								RowSpan: to.Ptr[int32](4),
								X:       to.Ptr[int32](1),
								Y:       to.Ptr[int32](2),
							},
						},
						{
							Position: &armportal.DashboardPartsPosition{
								ColSpan: to.Ptr[int32](6),
								RowSpan: to.Ptr[int32](6),
								X:       to.Ptr[int32](5),
								Y:       to.Ptr[int32](5),
							},
						}},
				},
				{
					Order: to.Ptr[int32](2),
					Parts: []*armportal.DashboardParts{},
				}},
			Metadata: map[string]any{
				"metadata": map[string]any{
					"ColSpan": float64(2),
					"RowSpan": float64(1),
					"X":       float64(4),
					"Y":       float64(3),
				},
			},
		},
		Tags: map[string]*string{
			"aKey":       to.Ptr("aValue"),
			"anotherKey": to.Ptr("anotherValue"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Dashboard = armportal.Dashboard{
	// 	Name: to.Ptr("testDashboard"),
	// 	Type: to.Ptr("Microsoft.Portal/dashboards"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard"),
	// 	Location: to.Ptr("eastus"),
	// 	Properties: &armportal.DashboardProperties{
	// 		Lenses: []*armportal.DashboardLens{
	// 			{
	// 				Order: to.Ptr[int32](1),
	// 				Parts: []*armportal.DashboardParts{
	// 					{
	// 						Position: &armportal.DashboardPartsPosition{
	// 							ColSpan: to.Ptr[int32](3),
	// 							RowSpan: to.Ptr[int32](4),
	// 							X: to.Ptr[int32](1),
	// 							Y: to.Ptr[int32](2),
	// 						},
	// 					},
	// 					{
	// 						Position: &armportal.DashboardPartsPosition{
	// 							ColSpan: to.Ptr[int32](6),
	// 							RowSpan: to.Ptr[int32](6),
	// 							X: to.Ptr[int32](5),
	// 							Y: to.Ptr[int32](5),
	// 						},
	// 				}},
	// 			},
	// 			{
	// 				Order: to.Ptr[int32](2),
	// 				Parts: []*armportal.DashboardParts{
	// 				},
	// 		}},
	// 		Metadata: map[string]any{
	// 			"metadata": map[string]any{
	// 				"ColSpan": float64(2),
	// 				"RowSpan": float64(1),
	// 				"X": float64(4),
	// 				"Y": float64(3),
	// 			},
	// 		},
	// 	},
	// 	Tags: map[string]*string{
	// 		"aKey": to.Ptr("aValue"),
	// 		"anotherKey": to.Ptr("anotherValue"),
	// 	},
	// }
}
Output:

func (*DashboardsClient) Delete

func (client *DashboardsClient) Delete(ctx context.Context, resourceGroupName string, dashboardName string, options *DashboardsClientDeleteOptions) (DashboardsClientDeleteResponse, error)

Delete - Deletes the Dashboard. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-09-01-preview

  • resourceGroupName - The name of the resource group.
  • dashboardName - The name of the dashboard.
  • options - DashboardsClientDeleteOptions contains the optional parameters for the DashboardsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/deleteDashboard.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal"
)

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

func (*DashboardsClient) Get

func (client *DashboardsClient) Get(ctx context.Context, resourceGroupName string, dashboardName string, options *DashboardsClientGetOptions) (DashboardsClientGetResponse, error)

Get - Gets the Dashboard. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-09-01-preview

  • resourceGroupName - The name of the resource group.
  • dashboardName - The name of the dashboard.
  • options - DashboardsClientGetOptions contains the optional parameters for the DashboardsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/getDashboard.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armportal.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDashboardsClient().Get(ctx, "testRG", "testDashboard", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Dashboard = armportal.Dashboard{
	// 	Name: to.Ptr("testDashboard"),
	// 	Type: to.Ptr("Microsoft.Portal/dashboards"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard"),
	// 	Location: to.Ptr("eastus"),
	// 	Properties: &armportal.DashboardProperties{
	// 		Lenses: []*armportal.DashboardLens{
	// 			{
	// 				Order: to.Ptr[int32](1),
	// 				Parts: []*armportal.DashboardParts{
	// 					{
	// 						Position: &armportal.DashboardPartsPosition{
	// 							ColSpan: to.Ptr[int32](3),
	// 							RowSpan: to.Ptr[int32](4),
	// 							X: to.Ptr[int32](1),
	// 							Y: to.Ptr[int32](2),
	// 						},
	// 					},
	// 					{
	// 						Position: &armportal.DashboardPartsPosition{
	// 							ColSpan: to.Ptr[int32](6),
	// 							RowSpan: to.Ptr[int32](6),
	// 							X: to.Ptr[int32](5),
	// 							Y: to.Ptr[int32](5),
	// 						},
	// 				}},
	// 			},
	// 			{
	// 				Order: to.Ptr[int32](2),
	// 				Parts: []*armportal.DashboardParts{
	// 				},
	// 		}},
	// 		Metadata: map[string]any{
	// 			"metadata": map[string]any{
	// 				"ColSpan": float64(2),
	// 				"RowSpan": float64(1),
	// 				"X": float64(4),
	// 				"Y": float64(3),
	// 			},
	// 		},
	// 	},
	// 	Tags: map[string]*string{
	// 		"aKey": to.Ptr("aValue"),
	// 		"anotherKey": to.Ptr("anotherValue"),
	// 	},
	// }
}
Output:

func (*DashboardsClient) NewListByResourceGroupPager added in v0.4.0

func (client *DashboardsClient) NewListByResourceGroupPager(resourceGroupName string, options *DashboardsClientListByResourceGroupOptions) *runtime.Pager[DashboardsClientListByResourceGroupResponse]

NewListByResourceGroupPager - Gets all the Dashboards within a resource group.

Generated from API version 2020-09-01-preview

  • resourceGroupName - The name of the resource group.
  • options - DashboardsClientListByResourceGroupOptions contains the optional parameters for the DashboardsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/listDashboardsByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armportal.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDashboardsClient().NewListByResourceGroupPager("testRG", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.DashboardListResult = armportal.DashboardListResult{
		// 	Value: []*armportal.Dashboard{
		// 		{
		// 			Name: to.Ptr("testDashboard"),
		// 			Type: to.Ptr("Microsoft.Portal/dashboards"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard"),
		// 			Location: to.Ptr("eastus"),
		// 			Properties: &armportal.DashboardProperties{
		// 				Lenses: []*armportal.DashboardLens{
		// 					{
		// 						Order: to.Ptr[int32](1),
		// 						Parts: []*armportal.DashboardParts{
		// 							{
		// 								Position: &armportal.DashboardPartsPosition{
		// 									ColSpan: to.Ptr[int32](3),
		// 									RowSpan: to.Ptr[int32](4),
		// 									X: to.Ptr[int32](1),
		// 									Y: to.Ptr[int32](2),
		// 								},
		// 							},
		// 							{
		// 								Position: &armportal.DashboardPartsPosition{
		// 									ColSpan: to.Ptr[int32](6),
		// 									RowSpan: to.Ptr[int32](6),
		// 									X: to.Ptr[int32](5),
		// 									Y: to.Ptr[int32](5),
		// 								},
		// 						}},
		// 					},
		// 					{
		// 						Order: to.Ptr[int32](2),
		// 						Parts: []*armportal.DashboardParts{
		// 						},
		// 				}},
		// 				Metadata: map[string]any{
		// 					"metadata": map[string]any{
		// 						"ColSpan": float64(2),
		// 						"RowSpan": float64(1),
		// 						"X": float64(4),
		// 						"Y": float64(3),
		// 					},
		// 				},
		// 			},
		// 			Tags: map[string]*string{
		// 				"aKey": to.Ptr("aValue"),
		// 				"anotherKey": to.Ptr("anotherValue"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testDashboard2"),
		// 			Type: to.Ptr("Microsoft.Portal/dashboards"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard2"),
		// 			Location: to.Ptr("eastus"),
		// 			Properties: &armportal.DashboardProperties{
		// 				Lenses: []*armportal.DashboardLens{
		// 					{
		// 						Order: to.Ptr[int32](1),
		// 						Parts: []*armportal.DashboardParts{
		// 							{
		// 								Position: &armportal.DashboardPartsPosition{
		// 									ColSpan: to.Ptr[int32](3),
		// 									RowSpan: to.Ptr[int32](4),
		// 									X: to.Ptr[int32](1),
		// 									Y: to.Ptr[int32](2),
		// 								},
		// 							},
		// 							{
		// 								Position: &armportal.DashboardPartsPosition{
		// 									ColSpan: to.Ptr[int32](6),
		// 									RowSpan: to.Ptr[int32](6),
		// 									X: to.Ptr[int32](5),
		// 									Y: to.Ptr[int32](5),
		// 								},
		// 						}},
		// 					},
		// 					{
		// 						Order: to.Ptr[int32](2),
		// 						Parts: []*armportal.DashboardParts{
		// 						},
		// 				}},
		// 				Metadata: map[string]any{
		// 					"metadata": map[string]any{
		// 						"ColSpan": float64(2),
		// 						"RowSpan": float64(1),
		// 						"X": float64(4),
		// 						"Y": float64(3),
		// 					},
		// 				},
		// 			},
		// 			Tags: map[string]*string{
		// 				"aKey": to.Ptr("aValue"),
		// 				"anotherKey": to.Ptr("anotherValue"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*DashboardsClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Gets all the dashboards within a subscription.

Generated from API version 2020-09-01-preview

  • options - DashboardsClientListBySubscriptionOptions contains the optional parameters for the DashboardsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/listDashboardsBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armportal.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDashboardsClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.DashboardListResult = armportal.DashboardListResult{
		// 	Value: []*armportal.Dashboard{
		// 		{
		// 			Name: to.Ptr("testDashboard"),
		// 			Type: to.Ptr("Microsoft.Portal/dashboards"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard"),
		// 			Location: to.Ptr("eastus"),
		// 			Properties: &armportal.DashboardProperties{
		// 				Lenses: []*armportal.DashboardLens{
		// 					{
		// 						Order: to.Ptr[int32](1),
		// 						Parts: []*armportal.DashboardParts{
		// 							{
		// 								Position: &armportal.DashboardPartsPosition{
		// 									ColSpan: to.Ptr[int32](3),
		// 									RowSpan: to.Ptr[int32](4),
		// 									X: to.Ptr[int32](1),
		// 									Y: to.Ptr[int32](2),
		// 								},
		// 							},
		// 							{
		// 								Position: &armportal.DashboardPartsPosition{
		// 									ColSpan: to.Ptr[int32](6),
		// 									RowSpan: to.Ptr[int32](6),
		// 									X: to.Ptr[int32](5),
		// 									Y: to.Ptr[int32](5),
		// 								},
		// 						}},
		// 					},
		// 					{
		// 						Order: to.Ptr[int32](2),
		// 						Parts: []*armportal.DashboardParts{
		// 						},
		// 				}},
		// 				Metadata: map[string]any{
		// 					"metadata": map[string]any{
		// 						"ColSpan": float64(2),
		// 						"RowSpan": float64(1),
		// 						"X": float64(4),
		// 						"Y": float64(3),
		// 					},
		// 				},
		// 			},
		// 			Tags: map[string]*string{
		// 				"aKey": to.Ptr("aValue"),
		// 				"anotherKey": to.Ptr("anotherValue"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testDashboard2"),
		// 			Type: to.Ptr("Microsoft.Portal/dashboards"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard2"),
		// 			Location: to.Ptr("eastus"),
		// 			Properties: &armportal.DashboardProperties{
		// 				Lenses: []*armportal.DashboardLens{
		// 					{
		// 						Order: to.Ptr[int32](1),
		// 						Parts: []*armportal.DashboardParts{
		// 							{
		// 								Position: &armportal.DashboardPartsPosition{
		// 									ColSpan: to.Ptr[int32](3),
		// 									RowSpan: to.Ptr[int32](4),
		// 									X: to.Ptr[int32](1),
		// 									Y: to.Ptr[int32](2),
		// 								},
		// 							},
		// 							{
		// 								Position: &armportal.DashboardPartsPosition{
		// 									ColSpan: to.Ptr[int32](6),
		// 									RowSpan: to.Ptr[int32](6),
		// 									X: to.Ptr[int32](5),
		// 									Y: to.Ptr[int32](5),
		// 								},
		// 						}},
		// 					},
		// 					{
		// 						Order: to.Ptr[int32](2),
		// 						Parts: []*armportal.DashboardParts{
		// 						},
		// 				}},
		// 				Metadata: map[string]any{
		// 					"metadata": map[string]any{
		// 						"ColSpan": float64(2),
		// 						"RowSpan": float64(1),
		// 						"X": float64(4),
		// 						"Y": float64(3),
		// 					},
		// 				},
		// 			},
		// 			Tags: map[string]*string{
		// 				"aKey": to.Ptr("aValue"),
		// 				"anotherKey": to.Ptr("anotherValue"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*DashboardsClient) Update

func (client *DashboardsClient) Update(ctx context.Context, resourceGroupName string, dashboardName string, dashboard PatchableDashboard, options *DashboardsClientUpdateOptions) (DashboardsClientUpdateResponse, error)

Update - Updates an existing Dashboard. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-09-01-preview

  • resourceGroupName - The name of the resource group.
  • dashboardName - The name of the dashboard.
  • dashboard - The updatable fields of a Dashboard.
  • options - DashboardsClientUpdateOptions contains the optional parameters for the DashboardsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/updateDashboard.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/portal/armportal"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armportal.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDashboardsClient().Update(ctx, "testRG", "testDashboard", armportal.PatchableDashboard{
		Tags: map[string]*string{
			"aKey":       to.Ptr("bValue"),
			"anotherKey": to.Ptr("anotherValue2"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Dashboard = armportal.Dashboard{
	// 	Name: to.Ptr("testDashboard"),
	// 	Type: to.Ptr("Microsoft.Portal/dashboards"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard"),
	// 	Location: to.Ptr("eastus"),
	// 	Properties: &armportal.DashboardProperties{
	// 		Lenses: []*armportal.DashboardLens{
	// 			{
	// 				Order: to.Ptr[int32](1),
	// 				Parts: []*armportal.DashboardParts{
	// 					{
	// 						Position: &armportal.DashboardPartsPosition{
	// 							ColSpan: to.Ptr[int32](3),
	// 							RowSpan: to.Ptr[int32](4),
	// 							X: to.Ptr[int32](1),
	// 							Y: to.Ptr[int32](2),
	// 						},
	// 					},
	// 					{
	// 						Position: &armportal.DashboardPartsPosition{
	// 							ColSpan: to.Ptr[int32](6),
	// 							RowSpan: to.Ptr[int32](6),
	// 							X: to.Ptr[int32](5),
	// 							Y: to.Ptr[int32](5),
	// 						},
	// 				}},
	// 			},
	// 			{
	// 				Order: to.Ptr[int32](2),
	// 				Parts: []*armportal.DashboardParts{
	// 				},
	// 		}},
	// 		Metadata: map[string]any{
	// 			"metadata": map[string]any{
	// 				"ColSpan": float64(2),
	// 				"RowSpan": float64(1),
	// 				"X": float64(4),
	// 				"Y": float64(3),
	// 			},
	// 		},
	// 	},
	// 	Tags: map[string]*string{
	// 		"aKey": to.Ptr("bValue"),
	// 		"anotherKey": to.Ptr("anotherValue2"),
	// 	},
	// }
}
Output:

type DashboardsClientCreateOrUpdateOptions added in v0.2.0

type DashboardsClientCreateOrUpdateOptions struct {
}

DashboardsClientCreateOrUpdateOptions contains the optional parameters for the DashboardsClient.CreateOrUpdate method.

type DashboardsClientCreateOrUpdateResponse added in v0.2.0

type DashboardsClientCreateOrUpdateResponse struct {
	// The shared dashboard resource definition.
	Dashboard
}

DashboardsClientCreateOrUpdateResponse contains the response from method DashboardsClient.CreateOrUpdate.

type DashboardsClientDeleteOptions added in v0.2.0

type DashboardsClientDeleteOptions struct {
}

DashboardsClientDeleteOptions contains the optional parameters for the DashboardsClient.Delete method.

type DashboardsClientDeleteResponse added in v0.2.0

type DashboardsClientDeleteResponse struct {
}

DashboardsClientDeleteResponse contains the response from method DashboardsClient.Delete.

type DashboardsClientGetOptions added in v0.2.0

type DashboardsClientGetOptions struct {
}

DashboardsClientGetOptions contains the optional parameters for the DashboardsClient.Get method.

type DashboardsClientGetResponse added in v0.2.0

type DashboardsClientGetResponse struct {
	// The shared dashboard resource definition.
	Dashboard
}

DashboardsClientGetResponse contains the response from method DashboardsClient.Get.

type DashboardsClientListByResourceGroupOptions added in v0.2.0

type DashboardsClientListByResourceGroupOptions struct {
}

DashboardsClientListByResourceGroupOptions contains the optional parameters for the DashboardsClient.NewListByResourceGroupPager method.

type DashboardsClientListByResourceGroupResponse added in v0.2.0

type DashboardsClientListByResourceGroupResponse struct {
	// List of dashboards.
	DashboardListResult
}

DashboardsClientListByResourceGroupResponse contains the response from method DashboardsClient.NewListByResourceGroupPager.

type DashboardsClientListBySubscriptionOptions added in v0.2.0

type DashboardsClientListBySubscriptionOptions struct {
}

DashboardsClientListBySubscriptionOptions contains the optional parameters for the DashboardsClient.NewListBySubscriptionPager method.

type DashboardsClientListBySubscriptionResponse added in v0.2.0

type DashboardsClientListBySubscriptionResponse struct {
	// List of dashboards.
	DashboardListResult
}

DashboardsClientListBySubscriptionResponse contains the response from method DashboardsClient.NewListBySubscriptionPager.

type DashboardsClientUpdateOptions added in v0.2.0

type DashboardsClientUpdateOptions struct {
}

DashboardsClientUpdateOptions contains the optional parameters for the DashboardsClient.Update method.

type DashboardsClientUpdateResponse added in v0.2.0

type DashboardsClientUpdateResponse struct {
	// The shared dashboard resource definition.
	Dashboard
}

DashboardsClientUpdateResponse contains the response from method DashboardsClient.Update.

type ErrorDefinition

type ErrorDefinition struct {
	// READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code.
	Code *int32

	// READ-ONLY; Internal error details.
	Details []*ErrorDefinition

	// READ-ONLY; Description of the error.
	Message *string
}

ErrorDefinition - Error definition.

func (ErrorDefinition) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorDefinition.

func (*ErrorDefinition) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDefinition.

type ErrorResponse

type ErrorResponse struct {
	// The error details.
	Error *ErrorDefinition
}

ErrorResponse - Error response.

func (ErrorResponse) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ListTenantConfigurationViolationsClient

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

ListTenantConfigurationViolationsClient contains the methods for the ListTenantConfigurationViolations group. Don't use this type directly, use NewListTenantConfigurationViolationsClient() instead.

func NewListTenantConfigurationViolationsClient

func NewListTenantConfigurationViolationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ListTenantConfigurationViolationsClient, error)

NewListTenantConfigurationViolationsClient creates a new instance of ListTenantConfigurationViolationsClient with the specified values.

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

func (*ListTenantConfigurationViolationsClient) NewListPager added in v0.4.0

NewListPager - Gets list of items that violate tenant's configuration.

Generated from API version 2020-09-01-preview

  • options - ListTenantConfigurationViolationsClientListOptions contains the optional parameters for the ListTenantConfigurationViolationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/TenantConfiguration/GetListOfTenantConfigurationViolations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armportal.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewListTenantConfigurationViolationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ViolationsList = armportal.ViolationsList{
		// 	Value: []*armportal.Violation{
		// 		{
		// 			ErrorMessage: to.Ptr("Tenant is configured to allow only URI configuration for the Markdown tiles on dashboards."),
		// 			ID: to.Ptr("private/5f4ff99a-efa9-40f9-9c04-6b5716828c0e"),
		// 			UserID: to.Ptr("<some user id>"),
		// 	}},
		// }
	}
}
Output:

type ListTenantConfigurationViolationsClientListOptions added in v0.2.0

type ListTenantConfigurationViolationsClientListOptions struct {
}

ListTenantConfigurationViolationsClientListOptions contains the optional parameters for the ListTenantConfigurationViolationsClient.NewListPager method.

type ListTenantConfigurationViolationsClientListResponse added in v0.2.0

type ListTenantConfigurationViolationsClientListResponse struct {
	// List of list of items that violate tenant's configuration.
	ViolationsList
}

ListTenantConfigurationViolationsClientListResponse contains the response from method ListTenantConfigurationViolationsClient.NewListPager.

type MarkdownPartMetadata

type MarkdownPartMetadata struct {
	// REQUIRED; The type of dashboard part.
	Type *string

	// OPTIONAL; Contains additional key/value pairs not defined in the schema.
	AdditionalProperties map[string]any

	// Input to dashboard part.
	Inputs []any

	// Markdown part settings.
	Settings *MarkdownPartMetadataSettings
}

MarkdownPartMetadata - Markdown part metadata.

func (*MarkdownPartMetadata) GetDashboardPartMetadata added in v0.2.0

func (m *MarkdownPartMetadata) GetDashboardPartMetadata() *DashboardPartMetadata

GetDashboardPartMetadata implements the DashboardPartMetadataClassification interface for type MarkdownPartMetadata.

func (MarkdownPartMetadata) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MarkdownPartMetadata.

func (*MarkdownPartMetadata) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MarkdownPartMetadata.

type MarkdownPartMetadataSettings

type MarkdownPartMetadataSettings struct {
	// The content of markdown part.
	Content *MarkdownPartMetadataSettingsContent
}

MarkdownPartMetadataSettings - Markdown part settings.

func (MarkdownPartMetadataSettings) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type MarkdownPartMetadataSettings.

func (*MarkdownPartMetadataSettings) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MarkdownPartMetadataSettings.

type MarkdownPartMetadataSettingsContent

type MarkdownPartMetadataSettingsContent struct {
	// The setting of the content of markdown part.
	Settings *MarkdownPartMetadataSettingsContentSettings
}

MarkdownPartMetadataSettingsContent - The content of markdown part.

func (MarkdownPartMetadataSettingsContent) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type MarkdownPartMetadataSettingsContent.

func (*MarkdownPartMetadataSettingsContent) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MarkdownPartMetadataSettingsContent.

type MarkdownPartMetadataSettingsContentSettings

type MarkdownPartMetadataSettingsContentSettings struct {
	// The content of the markdown part.
	Content *string

	// The source of the content of the markdown part.
	MarkdownSource *int32

	// The uri of markdown content.
	MarkdownURI *string

	// The subtitle of the markdown part.
	Subtitle *string

	// The title of the markdown part.
	Title *string
}

MarkdownPartMetadataSettingsContentSettings - The setting of the content of markdown part.

func (MarkdownPartMetadataSettingsContentSettings) MarshalJSON added in v0.6.0

MarshalJSON implements the json.Marshaller interface for type MarkdownPartMetadataSettingsContentSettings.

func (*MarkdownPartMetadataSettingsContentSettings) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MarkdownPartMetadataSettingsContentSettings.

type OperationsClient

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

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

func NewOperationsClient

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

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

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

func (*OperationsClient) NewListPager added in v0.4.0

NewListPager - The Microsoft Portal operations API.

Generated from API version 2020-09-01-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/operationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armportal.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ResourceProviderOperationList = armportal.ResourceProviderOperationList{
		// 	Value: []*armportal.ResourceProviderOperation{
		// 		{
		// 			Name: to.Ptr("Microsoft.Portal/dashboards/read"),
		// 			Display: &armportal.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Reads the dashboards for the subscription."),
		// 				Operation: to.Ptr("Get Dashboard"),
		// 				Provider: to.Ptr("Microsoft Portal"),
		// 				Resource: to.Ptr("Dashboards"),
		// 			},
		// 			IsDataAction: to.Ptr("false"),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Portal/dashboards/write"),
		// 			Display: &armportal.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Add or modify dashboard to a subscription."),
		// 				Operation: to.Ptr("Set Dashboard"),
		// 				Provider: to.Ptr("Microsoft Portal"),
		// 				Resource: to.Ptr("Dashboards"),
		// 			},
		// 			IsDataAction: to.Ptr("false"),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Portal/dashboards/delete"),
		// 			Display: &armportal.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Removes the dashboard from the subscription."),
		// 				Operation: to.Ptr("Delete Dashboard"),
		// 				Provider: to.Ptr("Microsoft Portal"),
		// 				Resource: to.Ptr("Dashboards"),
		// 			},
		// 			IsDataAction: to.Ptr("false"),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Portal/register/action"),
		// 			Display: &armportal.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Registers the subscription for the portal resource provider and enables shared dashboards."),
		// 				Operation: to.Ptr("Registers the Portal Resource Provider"),
		// 				Provider: to.Ptr("Microsoft Portal"),
		// 				Resource: to.Ptr("Portal Resource Provider"),
		// 			},
		// 			IsDataAction: to.Ptr("false"),
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	// Results of the request to list operations.
	ResourceProviderOperationList
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type PatchableDashboard

type PatchableDashboard struct {
	// The shared dashboard properties.
	Properties *DashboardProperties

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

PatchableDashboard - The shared dashboard resource definition.

func (PatchableDashboard) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PatchableDashboard.

func (*PatchableDashboard) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PatchableDashboard.

type ProxyResource

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

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

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

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

func (ProxyResource) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type ProxyResource.

func (*ProxyResource) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.

type Resource

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

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

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

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

func (Resource) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourceProviderOperation

type ResourceProviderOperation struct {
	// Display metadata associated with the operation.
	Display *ResourceProviderOperationDisplay

	// Indicates whether the operation applies to data-plane.
	IsDataAction *string

	// Operation name, in format of {provider}/{resource}/{operation}
	Name *string
}

ResourceProviderOperation - Supported operations of this resource provider.

func (ResourceProviderOperation) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperation.

func (*ResourceProviderOperation) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperation.

type ResourceProviderOperationDisplay

type ResourceProviderOperationDisplay struct {
	// Description of this operation.
	Description *string

	// Type of operation: get, read, delete, etc.
	Operation *string

	// Resource provider: Microsoft Custom Providers.
	Provider *string

	// Resource on which the operation is performed.
	Resource *string
}

ResourceProviderOperationDisplay - Display metadata associated with the operation.

func (ResourceProviderOperationDisplay) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationDisplay.

func (*ResourceProviderOperationDisplay) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationDisplay.

type ResourceProviderOperationList

type ResourceProviderOperationList struct {
	// The URL to use for getting the next set of results.
	NextLink *string

	// List of operations supported by this resource provider.
	Value []*ResourceProviderOperation
}

ResourceProviderOperationList - Results of the request to list operations.

func (ResourceProviderOperationList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList.

func (*ResourceProviderOperationList) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationList.

type TenantConfigurationsClient

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

TenantConfigurationsClient contains the methods for the TenantConfigurations group. Don't use this type directly, use NewTenantConfigurationsClient() instead.

func NewTenantConfigurationsClient

func NewTenantConfigurationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantConfigurationsClient, error)

NewTenantConfigurationsClient creates a new instance of TenantConfigurationsClient with the specified values.

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

func (*TenantConfigurationsClient) Create

Create - Create the tenant configuration. If configuration already exists - update it. User has to be a Tenant Admin for this operation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-09-01-preview

  • configurationName - The configuration name. Value must be 'default'
  • tenantConfiguration - The parameters required to create or update tenant configuration.
  • options - TenantConfigurationsClientCreateOptions contains the optional parameters for the TenantConfigurationsClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/TenantConfiguration/CreateOrUpdateTenantConfiguration.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/portal/armportal"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armportal.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTenantConfigurationsClient().Create(ctx, armportal.ConfigurationNameDefault, armportal.Configuration{
		Properties: &armportal.ConfigurationProperties{
			EnforcePrivateMarkdownStorage: to.Ptr(true),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Configuration = armportal.Configuration{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Portal/tenantConfiguration"),
	// 	ID: to.Ptr("/providers/Microsoft.Portal/tenantConfigurations/default"),
	// 	Properties: &armportal.ConfigurationProperties{
	// 		EnforcePrivateMarkdownStorage: to.Ptr(true),
	// 	},
	// }
}
Output:

func (*TenantConfigurationsClient) Delete

Delete - Delete the tenant configuration. User has to be a Tenant Admin for this operation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-09-01-preview

  • configurationName - The configuration name. Value must be 'default'
  • options - TenantConfigurationsClientDeleteOptions contains the optional parameters for the TenantConfigurationsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/TenantConfiguration/DeleteTenantConfiguration.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal"
)

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

func (*TenantConfigurationsClient) Get

Get - Gets the tenant configuration. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-09-01-preview

  • configurationName - The configuration name. Value must be 'default'
  • options - TenantConfigurationsClientGetOptions contains the optional parameters for the TenantConfigurationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/TenantConfiguration/GetTenantConfiguration.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armportal.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTenantConfigurationsClient().Get(ctx, armportal.ConfigurationNameDefault, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Configuration = armportal.Configuration{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Portal/tenantConfiguration"),
	// 	ID: to.Ptr("/providers/Microsoft.Portal/tenantConfigurations/default"),
	// 	Properties: &armportal.ConfigurationProperties{
	// 		EnforcePrivateMarkdownStorage: to.Ptr(true),
	// 	},
	// }
}
Output:

func (*TenantConfigurationsClient) NewListPager added in v0.4.0

NewListPager - Gets list of the tenant configurations.

Generated from API version 2020-09-01-preview

  • options - TenantConfigurationsClientListOptions contains the optional parameters for the TenantConfigurationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/TenantConfiguration/GetListOfTenantConfigurations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armportal.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTenantConfigurationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ConfigurationList = armportal.ConfigurationList{
		// 	Value: []*armportal.Configuration{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Portal/tenantConfiguration"),
		// 			ID: to.Ptr("/providers/Microsoft.Portal/tenantConfigurations"),
		// 			Properties: &armportal.ConfigurationProperties{
		// 				EnforcePrivateMarkdownStorage: to.Ptr(true),
		// 			},
		// 	}},
		// }
	}
}
Output:

type TenantConfigurationsClientCreateOptions added in v0.2.0

type TenantConfigurationsClientCreateOptions struct {
}

TenantConfigurationsClientCreateOptions contains the optional parameters for the TenantConfigurationsClient.Create method.

type TenantConfigurationsClientCreateResponse added in v0.2.0

type TenantConfigurationsClientCreateResponse struct {
	// Tenant configuration.
	Configuration
}

TenantConfigurationsClientCreateResponse contains the response from method TenantConfigurationsClient.Create.

type TenantConfigurationsClientDeleteOptions added in v0.2.0

type TenantConfigurationsClientDeleteOptions struct {
}

TenantConfigurationsClientDeleteOptions contains the optional parameters for the TenantConfigurationsClient.Delete method.

type TenantConfigurationsClientDeleteResponse added in v0.2.0

type TenantConfigurationsClientDeleteResponse struct {
}

TenantConfigurationsClientDeleteResponse contains the response from method TenantConfigurationsClient.Delete.

type TenantConfigurationsClientGetOptions added in v0.2.0

type TenantConfigurationsClientGetOptions struct {
}

TenantConfigurationsClientGetOptions contains the optional parameters for the TenantConfigurationsClient.Get method.

type TenantConfigurationsClientGetResponse added in v0.2.0

type TenantConfigurationsClientGetResponse struct {
	// Tenant configuration.
	Configuration
}

TenantConfigurationsClientGetResponse contains the response from method TenantConfigurationsClient.Get.

type TenantConfigurationsClientListOptions added in v0.2.0

type TenantConfigurationsClientListOptions struct {
}

TenantConfigurationsClientListOptions contains the optional parameters for the TenantConfigurationsClient.NewListPager method.

type TenantConfigurationsClientListResponse added in v0.2.0

type TenantConfigurationsClientListResponse struct {
	// List of tenant configurations.
	ConfigurationList
}

TenantConfigurationsClientListResponse contains the response from method TenantConfigurationsClient.NewListPager.

type Violation

type Violation struct {
	// READ-ONLY; Error message.
	ErrorMessage *string

	// READ-ONLY; Id of the item that violates tenant configuration.
	ID *string

	// READ-ONLY; Id of the user who owns violated item.
	UserID *string
}

Violation information.

func (Violation) MarshalJSON added in v0.6.0

func (v Violation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Violation.

func (*Violation) UnmarshalJSON added in v0.6.0

func (v *Violation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Violation.

type ViolationsList

type ViolationsList struct {
	// The URL to use for getting the next set of results.
	NextLink *string

	// The array of violations.
	Value []*Violation
}

ViolationsList - List of list of items that violate tenant's configuration.

func (ViolationsList) MarshalJSON

func (v ViolationsList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ViolationsList.

func (*ViolationsList) UnmarshalJSON added in v0.6.0

func (v *ViolationsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ViolationsList.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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