armazuredata

package module
v0.7.0 Latest Latest
Warning

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

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

README

Azure Hybrid Data Module for Go

PkgGoDev

The armazuredata module provides operations for working with Azure Hybrid Data.

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 Hybrid Data module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azuredata/armazuredata

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Hybrid Data. 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 Hybrid Data 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 := armazuredata.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 := armazuredata.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.NewSQLServersClient()

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 Hybrid Data 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 - Subscription ID that identifies an Azure subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewOperationsClient added in v0.6.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewSQLServerRegistrationsClient added in v0.6.0

func (c *ClientFactory) NewSQLServerRegistrationsClient() *SQLServerRegistrationsClient

NewSQLServerRegistrationsClient creates a new instance of SQLServerRegistrationsClient.

func (*ClientFactory) NewSQLServersClient added in v0.6.0

func (c *ClientFactory) NewSQLServersClient() *SQLServersClient

NewSQLServersClient creates a new instance of SQLServersClient.

type Identity

type Identity struct {
	// The identity type.
	Type *string

	// READ-ONLY; The principal ID of resource identity.
	PrincipalID *string

	// READ-ONLY; The tenant ID of resource.
	TenantID *string
}

Identity for the resource.

func (Identity) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type Identity.

func (*Identity) UnmarshalJSON added in v0.6.0

func (i *Identity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Identity.

type IdentityType

type IdentityType string

IdentityType - The type of identity that creates/modifies resources

const (
	IdentityTypeApplication     IdentityType = "application"
	IdentityTypeKey             IdentityType = "key"
	IdentityTypeManagedIdentity IdentityType = "managedIdentity"
	IdentityTypeUser            IdentityType = "user"
)

func PossibleIdentityTypeValues

func PossibleIdentityTypeValues() []IdentityType

PossibleIdentityTypeValues returns the possible values for the IdentityType const type.

type ODataError

type ODataError struct {
	// A language-independent error name.
	Code *string

	// The error details.
	Details []*ODataError

	// The error message.
	Message *string

	// The target of the error (for example, the name of the property in error).
	Target *string
}

ODataError - Information about an error.

func (ODataError) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ODataError.

func (*ODataError) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ODataError.

type Operation

type Operation struct {
	// READ-ONLY; The localized display information for this particular operation / action.
	Display *OperationDisplay

	// READ-ONLY; The name of the operation being performed on this particular object.
	Name *string

	// READ-ONLY; The intended executor of the operation.
	Origin *OperationOrigin

	// READ-ONLY; Additional descriptions for the operation.
	Properties map[string]any
}

Operation - SQL REST API operation definition.

func (Operation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The localized friendly description for the operation.
	Description *string

	// READ-ONLY; The localized friendly name for the operation.
	Operation *string

	// READ-ONLY; The localized friendly form of the resource provider name.
	Provider *string

	// READ-ONLY; The localized friendly form of the resource type related to this action/operation.
	Resource *string
}

OperationDisplay - Display metadata associated with the operation.

func (OperationDisplay) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; Array of results.
	Value []*Operation
}

OperationListResult - Result of the request to list SQL operations.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationOrigin

type OperationOrigin string

OperationOrigin - The intended executor of the operation.

const (
	OperationOriginSystem OperationOrigin = "system"
	OperationOriginUser   OperationOrigin = "user"
)

func PossibleOperationOriginValues

func PossibleOperationOriginValues() []OperationOrigin

PossibleOperationOriginValues returns the possible values for the OperationOrigin const type.

type OperationsClient

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

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

func NewOperationsClient

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

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

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

func (*OperationsClient) NewListPager added in v0.4.0

NewListPager - Lists all of the available SQL Server Registration API operations.

Generated from API version 2019-07-24-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/azuredata/resource-manager/Microsoft.AzureData/preview/2019-07-24-preview/examples/ListOperation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azuredata/armazuredata"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazuredata.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.OperationListResult = armazuredata.OperationListResult{
		// 	Value: []*armazuredata.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/sqlServerRegistrations/read"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Retrives details of SQL Server Registration"),
		// 				Operation: to.Ptr("Get SQL Server Registration details"),
		// 				Resource: to.Ptr("SQL Server Registration"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/sqlServerRegistrations/write"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Create a new or change properties of existing SQL Server Registration"),
		// 				Operation: to.Ptr("Create a new or update existing SQL Server Registration"),
		// 				Resource: to.Ptr("SQL Server Registration"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/sqlServerRegistrations/delete"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Delete existing SQL Server Registration"),
		// 				Operation: to.Ptr("Delete existing SQL Server Registration"),
		// 				Resource: to.Ptr("SQL Server Registration"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/operations/read"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Resource: to.Ptr("Available REST operations"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/sqlServers/read"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Retrieves details of SQL Server"),
		// 				Operation: to.Ptr("Get SQL Server Instance details"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/sqlServers/write"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Create a new or change properties of existing SQL Server"),
		// 				Operation: to.Ptr("Create new or update existing SQL Server"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/sqlServers/delete"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Delete exisiting SQL Server"),
		// 				Operation: to.Ptr("Delete exisiting SQL Server"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/sqlInstance/read"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Retrieves details of SQL Instance"),
		// 				Operation: to.Ptr("Get SQL Instance details"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/sqlInstance/write"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Create a new or change properties of existing SQL Instance"),
		// 				Operation: to.Ptr("Create new or update existing SQL Instance"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/sqlInstance/delete"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Delete exisiting SQL Instance"),
		// 				Operation: to.Ptr("Delete exisiting SQL Instance"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/postgresInstances/read"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Retrieves details of Postgres Instances"),
		// 				Operation: to.Ptr("Get Postgres Instance details"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/postgresInstances/write"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Create a new or change properties of existing Postgres Instances"),
		// 				Operation: to.Ptr("Create new or update existing Postgres Instances"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/postgresInstances/delete"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Delete exisiting Postgres Instances"),
		// 				Operation: to.Ptr("Delete exisiting Postgres Instances"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/hybridDataManagers/read"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Retrieves details of HybridDataManagers"),
		// 				Operation: to.Ptr("Get HybridDataManagers details"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/hybridDataManagers/write"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Create a new or change properties of existing HybridDataManagers"),
		// 				Operation: to.Ptr("Create new or update existing HybridDataManagers"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/hybridDataManagers/delete"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Delete exisiting HybridDataManagers"),
		// 				Operation: to.Ptr("Delete exisiting HybridDataManagers"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/SqlBigDataClusters/read"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Retrieves details of SqlBigDataClusters"),
		// 				Operation: to.Ptr("Get SqlBigDataClusters details"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/SqlBigDataClusters/write"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Create a new or change properties of existing SqlBigDataClusters"),
		// 				Operation: to.Ptr("Create new or update existing SqlBigDataClusters"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.AzureData/SqlBigDataClusters/delete"),
		// 			Display: &armazuredata.OperationDisplay{
		// 				Description: to.Ptr("Delete exisiting SqlBigDataClusters"),
		// 				Operation: to.Ptr("Delete exisiting SqlBigDataClusters"),
		// 			},
		// 	}},
		// }
	}
}
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 {
	// Result of the request to list SQL operations.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type Plan

type Plan struct {
	// REQUIRED; A user defined name of the 3rd Party Artifact that is being procured.
	Name *string

	// REQUIRED; The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact
	// at the time of Data Market onboarding.
	Product *string

	// REQUIRED; The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic
	Publisher *string

	// A publisher provided promotion code as provisioned in Data Market for the said product/artifact.
	PromotionCode *string

	// The version of the desired product/artifact.
	Version *string
}

Plan for the resource.

func (Plan) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type Plan.

func (*Plan) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Plan.

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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
	Type *string
}

ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location and tags

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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
	Type *string
}

func (Resource) MarshalJSON

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 ResourceModelWithAllowedPropertySet

type ResourceModelWithAllowedPropertySet struct {
	Identity *ResourceModelWithAllowedPropertySetIdentity

	// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are
	// a kind of Microsoft.Web/sites type. If supported, the resource provider must
	// validate and persist this value.
	Kind *string

	// The geo-location where the resource lives
	Location *string

	// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another
	// azure resource. If this is present, complete mode deployment will not
	// delete the resource if it is removed from the template since it is managed by another resource.
	ManagedBy *string
	Plan      *ResourceModelWithAllowedPropertySetPlan
	SKU       *ResourceModelWithAllowedPropertySetSKU

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

	// READ-ONLY; The etag field is not required. If it is provided in the response body, it must also be provided as a header
	// per the normal etag convention. Entity tags are used for comparing two or more entities
	// from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match
	// (section 14.26), and If-Range (section 14.27) header fields.
	Etag *string

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

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

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

ResourceModelWithAllowedPropertySet - The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set.

func (ResourceModelWithAllowedPropertySet) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySet.

func (*ResourceModelWithAllowedPropertySet) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySet.

type ResourceModelWithAllowedPropertySetIdentity

type ResourceModelWithAllowedPropertySetIdentity struct {
	// The identity type.
	Type *string

	// READ-ONLY; The principal ID of resource identity.
	PrincipalID *string

	// READ-ONLY; The tenant ID of resource.
	TenantID *string
}

func (ResourceModelWithAllowedPropertySetIdentity) MarshalJSON added in v0.6.0

MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySetIdentity.

func (*ResourceModelWithAllowedPropertySetIdentity) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySetIdentity.

type ResourceModelWithAllowedPropertySetPlan

type ResourceModelWithAllowedPropertySetPlan struct {
	// REQUIRED; A user defined name of the 3rd Party Artifact that is being procured.
	Name *string

	// REQUIRED; The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact
	// at the time of Data Market onboarding.
	Product *string

	// REQUIRED; The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic
	Publisher *string

	// A publisher provided promotion code as provisioned in Data Market for the said product/artifact.
	PromotionCode *string

	// The version of the desired product/artifact.
	Version *string
}

func (ResourceModelWithAllowedPropertySetPlan) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySetPlan.

func (*ResourceModelWithAllowedPropertySetPlan) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySetPlan.

type ResourceModelWithAllowedPropertySetSKU

type ResourceModelWithAllowedPropertySetSKU struct {
	// REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code
	Name *string

	// If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the
	// resource this may be omitted.
	Capacity *int32

	// If the service has different generations of hardware, for the same SKU, then that can be captured here.
	Family *string

	// The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code.
	Size *string

	// This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required
	// on a PUT.
	Tier *SKUTier
}

func (ResourceModelWithAllowedPropertySetSKU) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySetSKU.

func (*ResourceModelWithAllowedPropertySetSKU) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySetSKU.

type ResourceSKU

type ResourceSKU struct {
	Capacity *int32
	Family   *string
	Name     *string
	Size     *string
	Tier     *string
}

func (ResourceSKU) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceSKU.

func (*ResourceSKU) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU.

type SKU

type SKU struct {
	// REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code
	Name *string

	// If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the
	// resource this may be omitted.
	Capacity *int32

	// If the service has different generations of hardware, for the same SKU, then that can be captured here.
	Family *string

	// The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code.
	Size *string

	// This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required
	// on a PUT.
	Tier *SKUTier
}

SKU - The resource model definition representing SKU

func (SKU) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type SKU.

func (*SKU) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKU.

type SKUTier

type SKUTier string

SKUTier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.

const (
	SKUTierBasic    SKUTier = "Basic"
	SKUTierFree     SKUTier = "Free"
	SKUTierPremium  SKUTier = "Premium"
	SKUTierStandard SKUTier = "Standard"
)

func PossibleSKUTierValues

func PossibleSKUTierValues() []SKUTier

PossibleSKUTierValues returns the possible values for the SKUTier const type.

type SQLServer

type SQLServer struct {
	// Resource properties.
	Properties *SQLServerProperties

	// 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
	Type *string
}

SQLServer - A SQL server.

func (SQLServer) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLServer.

func (*SQLServer) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLServer.

type SQLServerListResult

type SQLServerListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; Array of results.
	Value []*SQLServer
}

SQLServerListResult - A list of SQL servers.

func (SQLServerListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLServerListResult.

func (*SQLServerListResult) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerListResult.

type SQLServerProperties

type SQLServerProperties struct {
	// Cores of the Sql Server.
	Cores *int32

	// Sql Server Edition.
	Edition *string

	// Sql Server Json Property Bag.
	PropertyBag *string

	// ID for Parent Sql Server Registration.
	RegistrationID *string

	// Version of the Sql Server.
	Version *string
}

SQLServerProperties - The SQL server properties.

func (SQLServerProperties) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type SQLServerProperties.

func (*SQLServerProperties) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerProperties.

type SQLServerRegistration

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

	// Resource properties.
	Properties *SQLServerRegistrationProperties

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

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

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

	// READ-ONLY; Read only system data
	SystemData *SystemData

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

SQLServerRegistration - A SQL server registration.

func (SQLServerRegistration) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLServerRegistration.

func (*SQLServerRegistration) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerRegistration.

type SQLServerRegistrationListResult

type SQLServerRegistrationListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; Array of results.
	Value []*SQLServerRegistration
}

SQLServerRegistrationListResult - Server

func (SQLServerRegistrationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLServerRegistrationListResult.

func (*SQLServerRegistrationListResult) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerRegistrationListResult.

type SQLServerRegistrationProperties

type SQLServerRegistrationProperties struct {
	// Optional Properties as JSON string
	PropertyBag *string

	// Resource Group Name
	ResourceGroup *string

	// Subscription Id
	SubscriptionID *string
}

SQLServerRegistrationProperties - The SQL server Registration properties.

func (SQLServerRegistrationProperties) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type SQLServerRegistrationProperties.

func (*SQLServerRegistrationProperties) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerRegistrationProperties.

type SQLServerRegistrationUpdate

type SQLServerRegistrationUpdate struct {
	// Resource tags.
	Tags map[string]*string
}

SQLServerRegistrationUpdate - An update to a SQL Server Registration.

func (SQLServerRegistrationUpdate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLServerRegistrationUpdate.

func (*SQLServerRegistrationUpdate) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerRegistrationUpdate.

type SQLServerRegistrationsClient

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

SQLServerRegistrationsClient contains the methods for the SQLServerRegistrations group. Don't use this type directly, use NewSQLServerRegistrationsClient() instead.

func NewSQLServerRegistrationsClient

func NewSQLServerRegistrationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLServerRegistrationsClient, error)

NewSQLServerRegistrationsClient creates a new instance of SQLServerRegistrationsClient with the specified values.

  • subscriptionID - Subscription ID that identifies an Azure subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SQLServerRegistrationsClient) CreateOrUpdate

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

Generated from API version 2019-07-24-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlServerRegistrationName - Name of the SQL Server registration.
  • parameters - The SQL Server registration to be created or updated.
  • options - SQLServerRegistrationsClientCreateOrUpdateOptions contains the optional parameters for the SQLServerRegistrationsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azuredata/resource-manager/Microsoft.AzureData/preview/2019-07-24-preview/examples/CreateOrUpdateSqlServerRegistration.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/azuredata/armazuredata"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazuredata.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSQLServerRegistrationsClient().CreateOrUpdate(ctx, "testrg", "testsqlregistration", armazuredata.SQLServerRegistration{
		Location: to.Ptr("northeurope"),
		Tags: map[string]*string{
			"mytag": to.Ptr("myval"),
		},
		Properties: &armazuredata.SQLServerRegistrationProperties{},
	}, 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.SQLServerRegistration = armazuredata.SQLServerRegistration{
	// 	Name: to.Ptr("testsqlregistration"),
	// 	Type: to.Ptr("Microsoft.AzureData/SqlServerRegistrations"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration"),
	// 	Location: to.Ptr("northeurope"),
	// 	Tags: map[string]*string{
	// 		"mytag": to.Ptr("myval"),
	// 	},
	// 	Properties: &armazuredata.SQLServerRegistrationProperties{
	// 	},
	// }
}
Output:

func (*SQLServerRegistrationsClient) Delete

func (client *SQLServerRegistrationsClient) Delete(ctx context.Context, resourceGroupName string, sqlServerRegistrationName string, options *SQLServerRegistrationsClientDeleteOptions) (SQLServerRegistrationsClientDeleteResponse, error)

Delete - Deletes a SQL Server registration. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-07-24-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlServerRegistrationName - Name of the SQL Server registration.
  • options - SQLServerRegistrationsClientDeleteOptions contains the optional parameters for the SQLServerRegistrationsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azuredata/resource-manager/Microsoft.AzureData/preview/2019-07-24-preview/examples/DeleteSqlServerRegistration.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azuredata/armazuredata"
)

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

func (*SQLServerRegistrationsClient) Get

func (client *SQLServerRegistrationsClient) Get(ctx context.Context, resourceGroupName string, sqlServerRegistrationName string, options *SQLServerRegistrationsClientGetOptions) (SQLServerRegistrationsClientGetResponse, error)

Get - Gets a SQL Server registration. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-07-24-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlServerRegistrationName - Name of the SQL Server registration.
  • options - SQLServerRegistrationsClientGetOptions contains the optional parameters for the SQLServerRegistrationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azuredata/resource-manager/Microsoft.AzureData/preview/2019-07-24-preview/examples/GetSqlServerRegistration.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azuredata/armazuredata"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazuredata.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSQLServerRegistrationsClient().Get(ctx, "testrg", "testsqlregistration", 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.SQLServerRegistration = armazuredata.SQLServerRegistration{
	// 	Name: to.Ptr("testsqlregistration"),
	// 	Type: to.Ptr("Microsoft.AzureData/SqlServerRegistrations"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration"),
	// 	Location: to.Ptr("northeurope"),
	// 	Tags: map[string]*string{
	// 		"mytag": to.Ptr("myval"),
	// 	},
	// 	Properties: &armazuredata.SQLServerRegistrationProperties{
	// 	},
	// }
}
Output:

func (*SQLServerRegistrationsClient) NewListByResourceGroupPager added in v0.4.0

NewListByResourceGroupPager - Gets all SQL Server registrations in a resource group.

Generated from API version 2019-07-24-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • options - SQLServerRegistrationsClientListByResourceGroupOptions contains the optional parameters for the SQLServerRegistrationsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azuredata/resource-manager/Microsoft.AzureData/preview/2019-07-24-preview/examples/ListByResourceGroupSqlServerRegistration.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azuredata/armazuredata"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazuredata.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSQLServerRegistrationsClient().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.SQLServerRegistrationListResult = armazuredata.SQLServerRegistrationListResult{
		// 	Value: []*armazuredata.SQLServerRegistration{
		// 		{
		// 			Name: to.Ptr("testsqlregistration1"),
		// 			Type: to.Ptr("Microsoft.AzureData/SqlServerRegistrations"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration1"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"mytag": to.Ptr("myval"),
		// 			},
		// 			Properties: &armazuredata.SQLServerRegistrationProperties{
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testsqlregistration2"),
		// 			Type: to.Ptr("Microsoft.AzureData/SqlServerRegistrations"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration2"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"mytag": to.Ptr("myval"),
		// 			},
		// 			Properties: &armazuredata.SQLServerRegistrationProperties{
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*SQLServerRegistrationsClient) NewListPager added in v0.4.0

NewListPager - Gets all SQL Server registrations in a subscription.

Generated from API version 2019-07-24-preview

  • options - SQLServerRegistrationsClientListOptions contains the optional parameters for the SQLServerRegistrationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azuredata/resource-manager/Microsoft.AzureData/preview/2019-07-24-preview/examples/ListSubscriptionSqlServerRegistration.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azuredata/armazuredata"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazuredata.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSQLServerRegistrationsClient().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.SQLServerRegistrationListResult = armazuredata.SQLServerRegistrationListResult{
		// 	Value: []*armazuredata.SQLServerRegistration{
		// 		{
		// 			Name: to.Ptr("testsqlregistration1"),
		// 			Type: to.Ptr("Microsoft.AzureData/SqlServerRegistrations"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration1"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"mytag": to.Ptr("myval"),
		// 			},
		// 			Properties: &armazuredata.SQLServerRegistrationProperties{
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testsqlregistration2"),
		// 			Type: to.Ptr("Microsoft.AzureData/SqlServerRegistrations"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration2"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"mytag": to.Ptr("myval"),
		// 			},
		// 			Properties: &armazuredata.SQLServerRegistrationProperties{
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*SQLServerRegistrationsClient) Update

Update - Updates SQL Server Registration tags. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-07-24-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlServerRegistrationName - Name of the SQL Server registration.
  • parameters - The SQL Server Registration.
  • options - SQLServerRegistrationsClientUpdateOptions contains the optional parameters for the SQLServerRegistrationsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azuredata/resource-manager/Microsoft.AzureData/preview/2019-07-24-preview/examples/UpdateSqlServerRegistration.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/azuredata/armazuredata"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazuredata.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSQLServerRegistrationsClient().Update(ctx, "testrg", "testsqlregistration", armazuredata.SQLServerRegistrationUpdate{
		Tags: map[string]*string{
			"mytag": to.Ptr("myval"),
		},
	}, 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.SQLServerRegistration = armazuredata.SQLServerRegistration{
	// 	Name: to.Ptr("testsqlregistration"),
	// 	Type: to.Ptr("Microsoft.AzureData/SqlServerRegistrations"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration"),
	// 	Location: to.Ptr("northeurope"),
	// 	Tags: map[string]*string{
	// 		"mytag": to.Ptr("myval"),
	// 	},
	// 	Properties: &armazuredata.SQLServerRegistrationProperties{
	// 	},
	// }
}
Output:

type SQLServerRegistrationsClientCreateOrUpdateOptions added in v0.2.0

type SQLServerRegistrationsClientCreateOrUpdateOptions struct {
}

SQLServerRegistrationsClientCreateOrUpdateOptions contains the optional parameters for the SQLServerRegistrationsClient.CreateOrUpdate method.

type SQLServerRegistrationsClientCreateOrUpdateResponse added in v0.2.0

type SQLServerRegistrationsClientCreateOrUpdateResponse struct {
	// A SQL server registration.
	SQLServerRegistration
}

SQLServerRegistrationsClientCreateOrUpdateResponse contains the response from method SQLServerRegistrationsClient.CreateOrUpdate.

type SQLServerRegistrationsClientDeleteOptions added in v0.2.0

type SQLServerRegistrationsClientDeleteOptions struct {
}

SQLServerRegistrationsClientDeleteOptions contains the optional parameters for the SQLServerRegistrationsClient.Delete method.

type SQLServerRegistrationsClientDeleteResponse added in v0.2.0

type SQLServerRegistrationsClientDeleteResponse struct {
}

SQLServerRegistrationsClientDeleteResponse contains the response from method SQLServerRegistrationsClient.Delete.

type SQLServerRegistrationsClientGetOptions added in v0.2.0

type SQLServerRegistrationsClientGetOptions struct {
}

SQLServerRegistrationsClientGetOptions contains the optional parameters for the SQLServerRegistrationsClient.Get method.

type SQLServerRegistrationsClientGetResponse added in v0.2.0

type SQLServerRegistrationsClientGetResponse struct {
	// A SQL server registration.
	SQLServerRegistration
}

SQLServerRegistrationsClientGetResponse contains the response from method SQLServerRegistrationsClient.Get.

type SQLServerRegistrationsClientListByResourceGroupOptions added in v0.2.0

type SQLServerRegistrationsClientListByResourceGroupOptions struct {
}

SQLServerRegistrationsClientListByResourceGroupOptions contains the optional parameters for the SQLServerRegistrationsClient.NewListByResourceGroupPager method.

type SQLServerRegistrationsClientListByResourceGroupResponse added in v0.2.0

type SQLServerRegistrationsClientListByResourceGroupResponse struct {
	// Server
	SQLServerRegistrationListResult
}

SQLServerRegistrationsClientListByResourceGroupResponse contains the response from method SQLServerRegistrationsClient.NewListByResourceGroupPager.

type SQLServerRegistrationsClientListOptions added in v0.2.0

type SQLServerRegistrationsClientListOptions struct {
}

SQLServerRegistrationsClientListOptions contains the optional parameters for the SQLServerRegistrationsClient.NewListPager method.

type SQLServerRegistrationsClientListResponse added in v0.2.0

type SQLServerRegistrationsClientListResponse struct {
	// Server
	SQLServerRegistrationListResult
}

SQLServerRegistrationsClientListResponse contains the response from method SQLServerRegistrationsClient.NewListPager.

type SQLServerRegistrationsClientUpdateOptions added in v0.2.0

type SQLServerRegistrationsClientUpdateOptions struct {
}

SQLServerRegistrationsClientUpdateOptions contains the optional parameters for the SQLServerRegistrationsClient.Update method.

type SQLServerRegistrationsClientUpdateResponse added in v0.2.0

type SQLServerRegistrationsClientUpdateResponse struct {
	// A SQL server registration.
	SQLServerRegistration
}

SQLServerRegistrationsClientUpdateResponse contains the response from method SQLServerRegistrationsClient.Update.

type SQLServersClient

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

SQLServersClient contains the methods for the SQLServers group. Don't use this type directly, use NewSQLServersClient() instead.

func NewSQLServersClient

func NewSQLServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLServersClient, error)

NewSQLServersClient creates a new instance of SQLServersClient with the specified values.

  • subscriptionID - Subscription ID that identifies an Azure subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SQLServersClient) CreateOrUpdate

func (client *SQLServersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, sqlServerRegistrationName string, sqlServerName string, parameters SQLServer, options *SQLServersClientCreateOrUpdateOptions) (SQLServersClientCreateOrUpdateResponse, error)

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

Generated from API version 2019-07-24-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlServerRegistrationName - Name of the SQL Server registration.
  • sqlServerName - Name of the SQL Server.
  • parameters - The SQL Server to be created or updated.
  • options - SQLServersClientCreateOrUpdateOptions contains the optional parameters for the SQLServersClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azuredata/resource-manager/Microsoft.AzureData/preview/2019-07-24-preview/examples/CreateOrUpdateSqlServerWithRegistrationGroup.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/azuredata/armazuredata"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazuredata.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSQLServersClient().CreateOrUpdate(ctx, "testrg", "testsqlregistration", "testsqlserver", armazuredata.SQLServer{
		Properties: &armazuredata.SQLServerProperties{
			Cores:          to.Ptr[int32](8),
			Edition:        to.Ptr("Latin"),
			PropertyBag:    to.Ptr(""),
			RegistrationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration"),
			Version:        to.Ptr("2008"),
		},
	}, 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.SQLServer = armazuredata.SQLServer{
	// 	Name: to.Ptr("testsqlserver"),
	// 	Type: to.Ptr("Microsoft.AzureData/SqlServerRegistrations/SqlServers"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration/sqlServers/testsqlserver"),
	// 	Properties: &armazuredata.SQLServerProperties{
	// 		Cores: to.Ptr[int32](8),
	// 		Edition: to.Ptr("Latin"),
	// 		PropertyBag: to.Ptr(""),
	// 		RegistrationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration"),
	// 		Version: to.Ptr("2008"),
	// 	},
	// }
}
Output:

func (*SQLServersClient) Delete

func (client *SQLServersClient) Delete(ctx context.Context, resourceGroupName string, sqlServerRegistrationName string, sqlServerName string, options *SQLServersClientDeleteOptions) (SQLServersClientDeleteResponse, error)

Delete - Deletes a SQL Server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-07-24-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlServerRegistrationName - Name of the SQL Server registration.
  • sqlServerName - Name of the SQL Server.
  • options - SQLServersClientDeleteOptions contains the optional parameters for the SQLServersClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azuredata/resource-manager/Microsoft.AzureData/preview/2019-07-24-preview/examples/DeleteSqlServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azuredata/armazuredata"
)

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

func (*SQLServersClient) Get

func (client *SQLServersClient) Get(ctx context.Context, resourceGroupName string, sqlServerRegistrationName string, sqlServerName string, options *SQLServersClientGetOptions) (SQLServersClientGetResponse, error)

Get - Gets a SQL Server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-07-24-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlServerRegistrationName - Name of the SQL Server registration.
  • sqlServerName - Name of the SQL Server.
  • options - SQLServersClientGetOptions contains the optional parameters for the SQLServersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azuredata/resource-manager/Microsoft.AzureData/preview/2019-07-24-preview/examples/GetSqlServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azuredata/armazuredata"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazuredata.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSQLServersClient().Get(ctx, "testrg", "testsqlregistration", "testsqlserver", &armazuredata.SQLServersClientGetOptions{Expand: 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.SQLServer = armazuredata.SQLServer{
	// 	Name: to.Ptr("testsqlserver"),
	// 	Type: to.Ptr("Microsoft.AzureData/SqlServerRegistrations/SqlServers"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration/sqlServers/testsqlserver"),
	// 	Properties: &armazuredata.SQLServerProperties{
	// 		Cores: to.Ptr[int32](8),
	// 		Edition: to.Ptr("Latin"),
	// 		PropertyBag: to.Ptr(""),
	// 		RegistrationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration"),
	// 		Version: to.Ptr("2008"),
	// 	},
	// }
}
Output:

func (*SQLServersClient) NewListByResourceGroupPager added in v0.4.0

func (client *SQLServersClient) NewListByResourceGroupPager(resourceGroupName string, sqlServerRegistrationName string, options *SQLServersClientListByResourceGroupOptions) *runtime.Pager[SQLServersClientListByResourceGroupResponse]

NewListByResourceGroupPager - Gets all SQL Servers in a SQL Server Registration.

Generated from API version 2019-07-24-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlServerRegistrationName - Name of the SQL Server registration.
  • options - SQLServersClientListByResourceGroupOptions contains the optional parameters for the SQLServersClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azuredata/resource-manager/Microsoft.AzureData/preview/2019-07-24-preview/examples/ListByResourceGroupSqlServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azuredata/armazuredata"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazuredata.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSQLServersClient().NewListByResourceGroupPager("testrg", "testsqlregistration", &armazuredata.SQLServersClientListByResourceGroupOptions{Expand: 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.SQLServerListResult = armazuredata.SQLServerListResult{
		// 	Value: []*armazuredata.SQLServer{
		// 		{
		// 			Name: to.Ptr("testsqlserver1"),
		// 			Type: to.Ptr("Microsoft.AzureData/SqlServerRegistrations/SqlServers"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration/sqlServers/testsqlserver1"),
		// 			Properties: &armazuredata.SQLServerProperties{
		// 				Cores: to.Ptr[int32](8),
		// 				Edition: to.Ptr("Latin"),
		// 				PropertyBag: to.Ptr(""),
		// 				RegistrationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration"),
		// 				Version: to.Ptr("2008"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testsqlserver2"),
		// 			Type: to.Ptr("Microsoft.AzureData/SqlServerRegistrations/SqlServers"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration/sqlServers/testsqlserver2"),
		// 			Properties: &armazuredata.SQLServerProperties{
		// 				Cores: to.Ptr[int32](16),
		// 				Edition: to.Ptr("Latin"),
		// 				PropertyBag: to.Ptr(""),
		// 				RegistrationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureData/SqlServerRegistrations/testsqlregistration"),
		// 				Version: to.Ptr("2008"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type SQLServersClientCreateOrUpdateOptions added in v0.2.0

type SQLServersClientCreateOrUpdateOptions struct {
}

SQLServersClientCreateOrUpdateOptions contains the optional parameters for the SQLServersClient.CreateOrUpdate method.

type SQLServersClientCreateOrUpdateResponse added in v0.2.0

type SQLServersClientCreateOrUpdateResponse struct {
	// A SQL server.
	SQLServer
}

SQLServersClientCreateOrUpdateResponse contains the response from method SQLServersClient.CreateOrUpdate.

type SQLServersClientDeleteOptions added in v0.2.0

type SQLServersClientDeleteOptions struct {
}

SQLServersClientDeleteOptions contains the optional parameters for the SQLServersClient.Delete method.

type SQLServersClientDeleteResponse added in v0.2.0

type SQLServersClientDeleteResponse struct {
}

SQLServersClientDeleteResponse contains the response from method SQLServersClient.Delete.

type SQLServersClientGetOptions added in v0.2.0

type SQLServersClientGetOptions struct {
	// The child resources to include in the response.
	Expand *string
}

SQLServersClientGetOptions contains the optional parameters for the SQLServersClient.Get method.

type SQLServersClientGetResponse added in v0.2.0

type SQLServersClientGetResponse struct {
	// A SQL server.
	SQLServer
}

SQLServersClientGetResponse contains the response from method SQLServersClient.Get.

type SQLServersClientListByResourceGroupOptions added in v0.2.0

type SQLServersClientListByResourceGroupOptions struct {
	// The child resources to include in the response.
	Expand *string
}

SQLServersClientListByResourceGroupOptions contains the optional parameters for the SQLServersClient.NewListByResourceGroupPager method.

type SQLServersClientListByResourceGroupResponse added in v0.2.0

type SQLServersClientListByResourceGroupResponse struct {
	// A list of SQL servers.
	SQLServerListResult
}

SQLServersClientListByResourceGroupResponse contains the response from method SQLServersClient.NewListByResourceGroupPager.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC)
	CreatedAt *time.Time

	// An identifier for the identity that created the resource
	CreatedBy *string

	// The type of identity that created the resource
	CreatedByType *IdentityType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// An identifier for the identity that last modified the resource
	LastModifiedBy *string

	// The type of identity that last modified the resource
	LastModifiedByType *IdentityType
}

SystemData - Read only system data

func (SystemData) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TrackedResource

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

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

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

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

	// READ-ONLY; Read only system data
	SystemData *SystemData

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

TrackedResource - The resource model definition for a ARM tracked top level resource

func (TrackedResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

func (*TrackedResource) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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