armcosmos

package module
v3.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 14 Imported by: 0

README

Azure Cosmos DB Module for Go

PkgGoDev

The armcosmos module provides operations for working with Azure Cosmos DB.

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 Cosmos DB module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Cosmos DB. 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 Cosmos DB 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 := armcosmos.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 := armcosmos.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.NewCassandraClustersClient()

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.

More sample code

Major Version Upgrade

Go uses semantic import versioning to ensure a good backward compatibility for modules. For Azure Go management SDK, we usually upgrade module version according to cooresponding service's API version. Regarding it could be a complicated experience for major version upgrade, we will try our best to keep the SDK API stable and release new version in backward compatible way. However, if any unavoidable breaking changes and a new major version releases for SDK modules, you could use these commands under your module folder to upgrade:

go install github.com/icholy/gomajor@latest
gomajor get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute@latest

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Cosmos DB 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 APIProperties

type APIProperties struct {
	// Describes the ServerVersion of an a MongoDB account.
	ServerVersion *ServerVersion
}

func (APIProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIProperties.

func (*APIProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIProperties.

type APIType

type APIType string

APIType - Enum to indicate the API type of the restorable database account.

const (
	APITypeCassandra APIType = "Cassandra"
	APITypeGremlin   APIType = "Gremlin"
	APITypeGremlinV2 APIType = "GremlinV2"
	APITypeMongoDB   APIType = "MongoDB"
	APITypeSQL       APIType = "Sql"
	APITypeTable     APIType = "Table"
)

func PossibleAPITypeValues

func PossibleAPITypeValues() []APIType

PossibleAPITypeValues returns the possible values for the APIType const type.

type ARMProxyResource

type ARMProxyResource struct {
	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

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

func (ARMProxyResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ARMProxyResource.

func (*ARMProxyResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ARMProxyResource.

type ARMResourceProperties

type ARMResourceProperties struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

ARMResourceProperties - The core properties of ARM resources.

func (ARMResourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ARMResourceProperties.

func (*ARMResourceProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ARMResourceProperties.

type AccountKeyMetadata

type AccountKeyMetadata struct {
	// READ-ONLY; Generation time in UTC of the key in ISO-8601 format. If the value is missing from the object, it means that
	// the last key regeneration was triggered before 2022-06-18.
	GenerationTime *time.Time
}

AccountKeyMetadata - The metadata related to an access key for a given database account.

func (AccountKeyMetadata) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AccountKeyMetadata.

func (*AccountKeyMetadata) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AccountKeyMetadata.

type AnalyticalStorageConfiguration

type AnalyticalStorageConfiguration struct {
	// Describes the types of schema for analytical storage.
	SchemaType *AnalyticalStorageSchemaType
}

AnalyticalStorageConfiguration - Analytical storage specific properties.

func (AnalyticalStorageConfiguration) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AnalyticalStorageConfiguration.

func (*AnalyticalStorageConfiguration) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AnalyticalStorageConfiguration.

type AnalyticalStorageSchemaType

type AnalyticalStorageSchemaType string

AnalyticalStorageSchemaType - Describes the types of schema for analytical storage.

const (
	AnalyticalStorageSchemaTypeFullFidelity AnalyticalStorageSchemaType = "FullFidelity"
	AnalyticalStorageSchemaTypeWellDefined  AnalyticalStorageSchemaType = "WellDefined"
)

func PossibleAnalyticalStorageSchemaTypeValues

func PossibleAnalyticalStorageSchemaTypeValues() []AnalyticalStorageSchemaType

PossibleAnalyticalStorageSchemaTypeValues returns the possible values for the AnalyticalStorageSchemaType const type.

type AuthenticationMethod

type AuthenticationMethod string

AuthenticationMethod - Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'.

const (
	AuthenticationMethodCassandra AuthenticationMethod = "Cassandra"
	AuthenticationMethodLdap      AuthenticationMethod = "Ldap"
	AuthenticationMethodNone      AuthenticationMethod = "None"
)

func PossibleAuthenticationMethodValues

func PossibleAuthenticationMethodValues() []AuthenticationMethod

PossibleAuthenticationMethodValues returns the possible values for the AuthenticationMethod const type.

type AuthenticationMethodLdapProperties

type AuthenticationMethodLdapProperties struct {
	// Timeout for connecting to the LDAP server in miliseconds. The default is 5000 ms.
	ConnectionTimeoutInMs *int32

	// Distinguished name of the object to start the recursive search of users from.
	SearchBaseDistinguishedName *string

	// Template to use for searching. Defaults to (cn=%s) where %s will be replaced by the username used to login.
	SearchFilterTemplate *string
	ServerCertificates   []*Certificate

	// Hostname of the LDAP server.
	ServerHostname *string

	// Port of the LDAP server.
	ServerPort *int32

	// Distinguished name of the look up user account, who can look up user details on authentication.
	ServiceUserDistinguishedName *string

	// Password of the look up user.
	ServiceUserPassword *string
}

AuthenticationMethodLdapProperties - Ldap authentication method properties. This feature is in preview.

func (AuthenticationMethodLdapProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AuthenticationMethodLdapProperties.

func (*AuthenticationMethodLdapProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AuthenticationMethodLdapProperties.

type AutoReplicate

type AutoReplicate string

AutoReplicate - The form of AutoReplicate that is being used by this cluster.

const (
	AutoReplicateAllKeyspaces    AutoReplicate = "AllKeyspaces"
	AutoReplicateNone            AutoReplicate = "None"
	AutoReplicateSystemKeyspaces AutoReplicate = "SystemKeyspaces"
)

func PossibleAutoReplicateValues

func PossibleAutoReplicateValues() []AutoReplicate

PossibleAutoReplicateValues returns the possible values for the AutoReplicate const type.

type AutoUpgradePolicyResource

type AutoUpgradePolicyResource struct {
	// Represents throughput policy which service must adhere to for auto-upgrade
	ThroughputPolicy *ThroughputPolicyResource
}

AutoUpgradePolicyResource - Cosmos DB resource auto-upgrade policy

func (AutoUpgradePolicyResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AutoUpgradePolicyResource.

func (*AutoUpgradePolicyResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AutoUpgradePolicyResource.

type AutoscaleSettings

type AutoscaleSettings struct {
	// Represents maximum throughput, the resource can scale up to.
	MaxThroughput *int32
}

func (AutoscaleSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AutoscaleSettings.

func (*AutoscaleSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AutoscaleSettings.

type AutoscaleSettingsResource

type AutoscaleSettingsResource struct {
	// REQUIRED; Represents maximum throughput container can scale up to.
	MaxThroughput *int32

	// Cosmos DB resource auto-upgrade policy
	AutoUpgradePolicy *AutoUpgradePolicyResource

	// READ-ONLY; Represents target maximum throughput container can scale up to once offer is no longer in pending state.
	TargetMaxThroughput *int32
}

AutoscaleSettingsResource - Cosmos DB provisioned throughput settings object

func (AutoscaleSettingsResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AutoscaleSettingsResource.

func (*AutoscaleSettingsResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AutoscaleSettingsResource.

type AzureBlobDataTransferDataSourceSink

type AzureBlobDataTransferDataSourceSink struct {
	// REQUIRED
	Component *DataTransferComponent

	// REQUIRED
	ContainerName *string
	EndpointURL   *string
}

AzureBlobDataTransferDataSourceSink - An Azure Blob Storage data source/sink

func (*AzureBlobDataTransferDataSourceSink) GetDataTransferDataSourceSink

func (a *AzureBlobDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink

GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type AzureBlobDataTransferDataSourceSink.

func (AzureBlobDataTransferDataSourceSink) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AzureBlobDataTransferDataSourceSink.

func (*AzureBlobDataTransferDataSourceSink) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobDataTransferDataSourceSink.

type AzureConnectionType

type AzureConnectionType string

AzureConnectionType - How to connect to the azure services needed for running the cluster

const (
	AzureConnectionTypeNone AzureConnectionType = "None"
	AzureConnectionTypeVPN  AzureConnectionType = "VPN"
)

func PossibleAzureConnectionTypeValues

func PossibleAzureConnectionTypeValues() []AzureConnectionType

PossibleAzureConnectionTypeValues returns the possible values for the AzureConnectionType const type.

type BackupInformation

type BackupInformation struct {
	// READ-ONLY; Information about the status of continuous backups.
	ContinuousBackupInformation *ContinuousBackupInformation
}

BackupInformation - Backup information of a resource.

func (BackupInformation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type BackupInformation.

func (*BackupInformation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type BackupInformation.

type BackupPolicy

type BackupPolicy struct {
	// REQUIRED; Describes the mode of backups.
	Type *BackupPolicyType

	// The object representing the state of the migration between the backup policies.
	MigrationState *BackupPolicyMigrationState
}

BackupPolicy - The object representing the policy for taking backups on an account.

func (*BackupPolicy) GetBackupPolicy

func (b *BackupPolicy) GetBackupPolicy() *BackupPolicy

GetBackupPolicy implements the BackupPolicyClassification interface for type BackupPolicy.

func (BackupPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type BackupPolicy.

func (*BackupPolicy) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type BackupPolicy.

type BackupPolicyClassification

type BackupPolicyClassification interface {
	// GetBackupPolicy returns the BackupPolicy content of the underlying type.
	GetBackupPolicy() *BackupPolicy
}

BackupPolicyClassification provides polymorphic access to related types. Call the interface's GetBackupPolicy() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *BackupPolicy, *ContinuousModeBackupPolicy, *PeriodicModeBackupPolicy

type BackupPolicyMigrationState

type BackupPolicyMigrationState struct {
	// Time at which the backup policy migration started (ISO-8601 format).
	StartTime *time.Time

	// Describes the status of migration between backup policy types.
	Status *BackupPolicyMigrationStatus

	// Describes the target backup policy type of the backup policy migration.
	TargetType *BackupPolicyType
}

BackupPolicyMigrationState - The object representing the state of the migration between the backup policies.

func (BackupPolicyMigrationState) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type BackupPolicyMigrationState.

func (*BackupPolicyMigrationState) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type BackupPolicyMigrationState.

type BackupPolicyMigrationStatus

type BackupPolicyMigrationStatus string

BackupPolicyMigrationStatus - Describes the status of migration between backup policy types.

const (
	BackupPolicyMigrationStatusCompleted  BackupPolicyMigrationStatus = "Completed"
	BackupPolicyMigrationStatusFailed     BackupPolicyMigrationStatus = "Failed"
	BackupPolicyMigrationStatusInProgress BackupPolicyMigrationStatus = "InProgress"
	BackupPolicyMigrationStatusInvalid    BackupPolicyMigrationStatus = "Invalid"
)

func PossibleBackupPolicyMigrationStatusValues

func PossibleBackupPolicyMigrationStatusValues() []BackupPolicyMigrationStatus

PossibleBackupPolicyMigrationStatusValues returns the possible values for the BackupPolicyMigrationStatus const type.

type BackupPolicyType

type BackupPolicyType string

BackupPolicyType - Describes the mode of backups.

const (
	BackupPolicyTypeContinuous BackupPolicyType = "Continuous"
	BackupPolicyTypePeriodic   BackupPolicyType = "Periodic"
)

func PossibleBackupPolicyTypeValues

func PossibleBackupPolicyTypeValues() []BackupPolicyType

PossibleBackupPolicyTypeValues returns the possible values for the BackupPolicyType const type.

type BackupResource

type BackupResource struct {
	// The time at which the backup will expire.
	BackupExpiryTimestamp *time.Time

	// The unique identifier of backup.
	BackupID *string

	// The time at which the backup process begins.
	BackupStartTimestamp *time.Time

	// The current state of the backup.
	BackupState *BackupState

	// The time at which the backup process ends.
	BackupStopTimestamp *time.Time
}

BackupResource - A restorable backup of a Cassandra cluster.

func (BackupResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type BackupResource.

func (*BackupResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type BackupResource.

type BackupSchedule

type BackupSchedule struct {
	// The cron expression that defines when you want to back up your data.
	CronExpression *string

	// The retention period (hours) of the backups. If you want to retain data forever, set retention to 0.
	RetentionInHours *int32

	// The unique identifier of backup schedule.
	ScheduleName *string
}

func (BackupSchedule) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type BackupSchedule.

func (*BackupSchedule) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type BackupSchedule.

type BackupState

type BackupState string

BackupState - The current state of the backup.

const (
	BackupStateFailed     BackupState = "Failed"
	BackupStateInProgress BackupState = "InProgress"
	BackupStateInitiated  BackupState = "Initiated"
	BackupStateSucceeded  BackupState = "Succeeded"
)

func PossibleBackupStateValues

func PossibleBackupStateValues() []BackupState

PossibleBackupStateValues returns the possible values for the BackupState const type.

type BackupStorageRedundancy

type BackupStorageRedundancy string

BackupStorageRedundancy - Enum to indicate type of backup storage redundancy.

const (
	BackupStorageRedundancyGeo   BackupStorageRedundancy = "Geo"
	BackupStorageRedundancyLocal BackupStorageRedundancy = "Local"
	BackupStorageRedundancyZone  BackupStorageRedundancy = "Zone"
)

func PossibleBackupStorageRedundancyValues

func PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy

PossibleBackupStorageRedundancyValues returns the possible values for the BackupStorageRedundancy const type.

type BaseCosmosDataTransferDataSourceSink

type BaseCosmosDataTransferDataSourceSink struct {
	// REQUIRED
	Component         *DataTransferComponent
	RemoteAccountName *string
}

BaseCosmosDataTransferDataSourceSink - A base CosmosDB data source/sink

func (*BaseCosmosDataTransferDataSourceSink) GetBaseCosmosDataTransferDataSourceSink

func (b *BaseCosmosDataTransferDataSourceSink) GetBaseCosmosDataTransferDataSourceSink() *BaseCosmosDataTransferDataSourceSink

GetBaseCosmosDataTransferDataSourceSink implements the BaseCosmosDataTransferDataSourceSinkClassification interface for type BaseCosmosDataTransferDataSourceSink.

func (*BaseCosmosDataTransferDataSourceSink) GetDataTransferDataSourceSink

func (b *BaseCosmosDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink

GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type BaseCosmosDataTransferDataSourceSink.

func (BaseCosmosDataTransferDataSourceSink) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type BaseCosmosDataTransferDataSourceSink.

func (*BaseCosmosDataTransferDataSourceSink) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type BaseCosmosDataTransferDataSourceSink.

type BaseCosmosDataTransferDataSourceSinkClassification

type BaseCosmosDataTransferDataSourceSinkClassification interface {
	DataTransferDataSourceSinkClassification
	// GetBaseCosmosDataTransferDataSourceSink returns the BaseCosmosDataTransferDataSourceSink content of the underlying type.
	GetBaseCosmosDataTransferDataSourceSink() *BaseCosmosDataTransferDataSourceSink
}

BaseCosmosDataTransferDataSourceSinkClassification provides polymorphic access to related types. Call the interface's GetBaseCosmosDataTransferDataSourceSink() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *BaseCosmosDataTransferDataSourceSink, *CassandraDataTransferDataSourceSink, *MongoDataTransferDataSourceSink, *SQLDataTransferDataSourceSink

type Capability

type Capability struct {
	// Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and
	// "EnableGremlin".
	Name *string
}

Capability - Cosmos DB capability object

func (Capability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Capability.

func (*Capability) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Capability.

type Capacity

type Capacity struct {
	// The total throughput limit imposed on the account. A totalThroughputLimit of 2000 imposes a strict limit of max throughput
	// that can be provisioned on that account to be 2000. A totalThroughputLimit of
	// -1 indicates no limits on provisioning of throughput.
	TotalThroughputLimit *int32
}

Capacity - The object that represents all properties related to capacity enforcement on an account.

func (Capacity) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Capacity.

func (*Capacity) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Capacity.

type CassandraClusterPublicStatus

type CassandraClusterPublicStatus struct {
	// List relevant information about any connection errors to the Datacenters.
	ConnectionErrors []*ConnectionError

	// List of the status of each datacenter in this cluster.
	DataCenters []*CassandraClusterPublicStatusDataCentersItem
	ETag        *string

	// List relevant information about any errors about cluster, data center and connection error.
	Errors       []*CassandraError
	ReaperStatus *ManagedCassandraReaperStatus
}

CassandraClusterPublicStatus - Properties of a managed Cassandra cluster public status.

func (CassandraClusterPublicStatus) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraClusterPublicStatus.

func (*CassandraClusterPublicStatus) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraClusterPublicStatus.

type CassandraClusterPublicStatusDataCentersItem

type CassandraClusterPublicStatusDataCentersItem struct {
	// The name of this Datacenter.
	Name  *string
	Nodes []*ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems

	// A list of all seed nodes in the cluster, managed and unmanaged.
	SeedNodes []*string
}

func (CassandraClusterPublicStatusDataCentersItem) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type CassandraClusterPublicStatusDataCentersItem.

func (*CassandraClusterPublicStatusDataCentersItem) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraClusterPublicStatusDataCentersItem.

type CassandraClustersClient

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

CassandraClustersClient contains the methods for the CassandraClusters group. Don't use this type directly, use NewCassandraClustersClient() instead.

func NewCassandraClustersClient

func NewCassandraClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CassandraClustersClient, error)

NewCassandraClustersClient creates a new instance of CassandraClustersClient with the specified values.

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

func (*CassandraClustersClient) BeginCreateUpdate

BeginCreateUpdate - Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • body - The properties specifying the desired state of the managed Cassandra cluster.
  • options - CassandraClustersClientBeginCreateUpdateOptions contains the optional parameters for the CassandraClustersClient.BeginCreateUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraClustersClient().BeginCreateUpdate(ctx, "cassandra-prod-rg", "cassandra-prod", armcosmos.ClusterResource{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.ClusterResourceProperties{
		AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra),
		CassandraVersion:     to.Ptr("3.11"),
		ClientCertificates: []*armcosmos.Certificate{
			{
				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
			}},
		ClusterNameOverride:         to.Ptr("ClusterNameIllegalForAzureResource"),
		DelegatedManagementSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"),
		ExternalGossipCertificates: []*armcosmos.Certificate{
			{
				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
			}},
		ExternalSeedNodes: []*armcosmos.SeedNode{
			{
				IPAddress: to.Ptr("10.52.221.2"),
			},
			{
				IPAddress: to.Ptr("10.52.221.3"),
			},
			{
				IPAddress: to.Ptr("10.52.221.4"),
			}},
		HoursBetweenBackups:           to.Ptr[int32](24),
		InitialCassandraAdminPassword: to.Ptr("mypassword"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ClusterResource = armcosmos.ClusterResource{
// 	Name: to.Ptr("cassandra-prod"),
// 	Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ClusterResourceProperties{
// 		AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra),
// 		CassandraVersion: to.Ptr("3.11"),
// 		ClientCertificates: []*armcosmos.Certificate{
// 			{
// 				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
// 		}},
// 		ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"),
// 		DelegatedManagementSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"),
// 		ExternalGossipCertificates: []*armcosmos.Certificate{
// 			{
// 				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
// 		}},
// 		ExternalSeedNodes: []*armcosmos.SeedNode{
// 			{
// 				IPAddress: to.Ptr("10.52.221.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.4"),
// 		}},
// 		GossipCertificates: []*armcosmos.Certificate{
// 			{
// 				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
// 		}},
// 		HoursBetweenBackups: to.Ptr[int32](24),
// 		ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded),
// 		SeedNodes: []*armcosmos.SeedNode{
// 			{
// 				IPAddress: to.Ptr("10.52.221.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.4"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.4"),
// 		}},
// 	},
// }
Output:

func (*CassandraClustersClient) BeginDeallocate

BeginDeallocate - Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • options - CassandraClustersClientBeginDeallocateOptions contains the optional parameters for the CassandraClustersClient.BeginDeallocate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraClustersClient().BeginDeallocate(ctx, "cassandra-prod-rg", "cassandra-prod", &armcosmos.CassandraClustersClientBeginDeallocateOptions{XMSForceDeallocate: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*CassandraClustersClient) BeginDelete

BeginDelete - Deletes a managed Cassandra cluster. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • options - CassandraClustersClientBeginDeleteOptions contains the optional parameters for the CassandraClustersClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraClustersClient().BeginDelete(ctx, "cassandra-prod-rg", "cassandra-prod", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*CassandraClustersClient) BeginInvokeCommand

BeginInvokeCommand - Invoke a command like nodetool for cassandra maintenance If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • body - Specification which command to run where
  • options - CassandraClustersClientBeginInvokeCommandOptions contains the optional parameters for the CassandraClustersClient.BeginInvokeCommand method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraCommand.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraClustersClient().BeginInvokeCommand(ctx, "cassandra-prod-rg", "cassandra-prod", armcosmos.CommandPostBody{
	Arguments: map[string]any{
		"status": "",
	},
	Command: to.Ptr("nodetool"),
	Host:    to.Ptr("10.0.1.12"),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*CassandraClustersClient) BeginInvokeCommandAsync

BeginInvokeCommandAsync - Invoke a command like nodetool for cassandra maintenance asynchronously If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • body - Specification which command to run where
  • options - CassandraClustersClientBeginInvokeCommandAsyncOptions contains the optional parameters for the CassandraClustersClient.BeginInvokeCommandAsync method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraCommandAsync.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraClustersClient().BeginInvokeCommandAsync(ctx, "cassandra-prod-rg", "cassandra-prod", armcosmos.CommandPostBody{
	Arguments: map[string]any{
		"status": "",
	},
	Command: to.Ptr("nodetool"),
	Host:    to.Ptr("10.0.1.12"),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.CommandPublicResource = armcosmos.CommandPublicResource{
// 	Arguments: map[string]any{
// 		"status": "",
// 	},
// 	CassandraStopStart: to.Ptr(false),
// 	Command: to.Ptr("nodetool"),
// 	Host: to.Ptr("10.0.1.12"),
// 	IsAdmin: to.Ptr(false),
// 	OutputFile: to.Ptr("301fc7c1-397f-4e4a-89db-478f61f89d67"),
// 	ReadWrite: to.Ptr(false),
// }
Output:

func (*CassandraClustersClient) BeginStart

BeginStart - Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • options - CassandraClustersClientBeginStartOptions contains the optional parameters for the CassandraClustersClient.BeginStart method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterStart.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraClustersClient().BeginStart(ctx, "cassandra-prod-rg", "cassandra-prod", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*CassandraClustersClient) BeginUpdate

BeginUpdate - Updates some of the properties of a managed Cassandra cluster. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • body - Parameters to provide for specifying the managed Cassandra cluster.
  • options - CassandraClustersClientBeginUpdateOptions contains the optional parameters for the CassandraClustersClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterPatch.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraClustersClient().BeginUpdate(ctx, "cassandra-prod-rg", "cassandra-prod", armcosmos.ClusterResource{
	Tags: map[string]*string{
		"owner": to.Ptr("mike"),
	},
	Properties: &armcosmos.ClusterResourceProperties{
		AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodNone),
		ExternalGossipCertificates: []*armcosmos.Certificate{
			{
				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
			}},
		ExternalSeedNodes: []*armcosmos.SeedNode{
			{
				IPAddress: to.Ptr("10.52.221.2"),
			},
			{
				IPAddress: to.Ptr("10.52.221.3"),
			},
			{
				IPAddress: to.Ptr("10.52.221.4"),
			}},
		HoursBetweenBackups: to.Ptr[int32](12),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ClusterResource = armcosmos.ClusterResource{
// 	Name: to.Ptr("cassandra-prod"),
// 	Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters"),
// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ClusterResourceProperties{
// 		AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra),
// 		CassandraVersion: to.Ptr("3.11"),
// 		ClientCertificates: []*armcosmos.Certificate{
// 			{
// 				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
// 		}},
// 		ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"),
// 		DelegatedManagementSubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"),
// 		ExternalGossipCertificates: []*armcosmos.Certificate{
// 			{
// 				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
// 		}},
// 		ExternalSeedNodes: []*armcosmos.SeedNode{
// 			{
// 				IPAddress: to.Ptr("10.52.221.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.4"),
// 		}},
// 		GossipCertificates: []*armcosmos.Certificate{
// 			{
// 				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
// 		}},
// 		HoursBetweenBackups: to.Ptr[int32](24),
// 		ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded),
// 		SeedNodes: []*armcosmos.SeedNode{
// 			{
// 				IPAddress: to.Ptr("10.52.221.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.4"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.4"),
// 		}},
// 	},
// }
Output:

func (*CassandraClustersClient) Get

Get - Get the properties of a managed Cassandra cluster. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • options - CassandraClustersClientGetOptions contains the optional parameters for the CassandraClustersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCassandraClustersClient().Get(ctx, "cassandra-prod-rg", "cassandra-prod", 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.ClusterResource = armcosmos.ClusterResource{
// 	Name: to.Ptr("cassandra-prod"),
// 	Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ClusterResourceProperties{
// 		AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra),
// 		CassandraVersion: to.Ptr("3.11"),
// 		ClientCertificates: []*armcosmos.Certificate{
// 			{
// 				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
// 		}},
// 		ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"),
// 		DelegatedManagementSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"),
// 		ExternalGossipCertificates: []*armcosmos.Certificate{
// 			{
// 				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
// 		}},
// 		ExternalSeedNodes: []*armcosmos.SeedNode{
// 			{
// 				IPAddress: to.Ptr("10.52.221.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.4"),
// 		}},
// 		GossipCertificates: []*armcosmos.Certificate{
// 			{
// 				Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
// 		}},
// 		HoursBetweenBackups: to.Ptr[int32](24),
// 		ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded),
// 		SeedNodes: []*armcosmos.SeedNode{
// 			{
// 				IPAddress: to.Ptr("10.52.221.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("10.52.221.4"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.4"),
// 		}},
// 	},
// }
Output:

func (*CassandraClustersClient) GetBackup

func (client *CassandraClustersClient) GetBackup(ctx context.Context, resourceGroupName string, clusterName string, backupID string, options *CassandraClustersClientGetBackupOptions) (CassandraClustersClientGetBackupResponse, error)

GetBackup - Get the properties of an individual backup of this cluster that is available to restore. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • backupID - Id of a restorable backup of a Cassandra cluster.
  • options - CassandraClustersClientGetBackupOptions contains the optional parameters for the CassandraClustersClient.GetBackup method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraBackup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCassandraClustersClient().GetBackup(ctx, "cassandra-prod-rg", "cassandra-prod", "1611250348", 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.BackupResource = armcosmos.BackupResource{
// 	BackupExpiryTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T20:05:22.384Z"); return t}()),
// 	BackupID: to.Ptr("2517222704776158383"),
// 	BackupStartTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()),
// 	BackupState: to.Ptr(armcosmos.BackupStateSucceeded),
// 	BackupStopTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()),
// }
Output:

func (*CassandraClustersClient) GetCommandAsync

func (client *CassandraClustersClient) GetCommandAsync(ctx context.Context, resourceGroupName string, clusterName string, commandID string, options *CassandraClustersClientGetCommandAsyncOptions) (CassandraClustersClientGetCommandAsyncResponse, error)

GetCommandAsync - Get details about a specified command that was run asynchronously. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • commandID - Managed Cassandra cluster command id.
  • options - CassandraClustersClientGetCommandAsyncOptions contains the optional parameters for the CassandraClustersClient.GetCommandAsync method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraCommandResult.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCassandraClustersClient().GetCommandAsync(ctx, "cassandra-prod-rg", "cassandra-prod", "318653d0-3da5-4814-b8f6-429f2af0b2a4", 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.ListCommands = armcosmos.ListCommands{
// 	Value: []*armcosmos.CommandPublicResource{
// 		{
// 			Arguments: map[string]any{
// 				"status": "",
// 			},
// 			CassandraStopStart: to.Ptr(false),
// 			Command: to.Ptr("nodetool"),
// 			Host: to.Ptr("10.0.1.12"),
// 			IsAdmin: to.Ptr(false),
// 			OutputFile: to.Ptr("318653d0-3da5-4814-b8f6-429f2af0b2a4"),
// 			ReadWrite: to.Ptr(false),
// 			Result: to.Ptr("{\"exitCode\":0, \"CommandOutput\":\"RESULT\"}"),
// 	}},
// }
Output:

func (*CassandraClustersClient) NewListBackupsPager

func (client *CassandraClustersClient) NewListBackupsPager(resourceGroupName string, clusterName string, options *CassandraClustersClientListBackupsOptions) *runtime.Pager[CassandraClustersClientListBackupsResponse]

NewListBackupsPager - List the backups of this cluster that are available to restore.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • options - CassandraClustersClientListBackupsOptions contains the optional parameters for the CassandraClustersClient.NewListBackupsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraBackupsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCassandraClustersClient().NewListBackupsPager("cassandra-prod-rg", "cassandra-prod", 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.ListBackups = armcosmos.ListBackups{
	// 	Value: []*armcosmos.BackupResource{
	// 		{
	// 			BackupExpiryTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T20:10:17.296Z"); return t}()),
	// 			BackupID: to.Ptr("2517222701827037570"),
	// 			BackupStartTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:10:17.296Z"); return t}()),
	// 			BackupState: to.Ptr(armcosmos.BackupStateInitiated),
	// 		},
	// 		{
	// 			BackupExpiryTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T20:05:22.384Z"); return t}()),
	// 			BackupID: to.Ptr("2517222704776158382"),
	// 			BackupStartTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()),
	// 			BackupState: to.Ptr(armcosmos.BackupStateInProgress),
	// 		},
	// 		{
	// 			BackupExpiryTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T20:05:22.384Z"); return t}()),
	// 			BackupID: to.Ptr("2517222704776158383"),
	// 			BackupStartTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()),
	// 			BackupState: to.Ptr(armcosmos.BackupStateSucceeded),
	// 			BackupStopTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()),
	// 		},
	// 		{
	// 			BackupExpiryTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T20:05:22.384Z"); return t}()),
	// 			BackupID: to.Ptr("2517222704776158384"),
	// 			BackupStartTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()),
	// 			BackupState: to.Ptr(armcosmos.BackupStateFailed),
	// 			BackupStopTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-28T19:05:22.384Z"); return t}()),
	// 	}},
	// }
}
Output:

func (*CassandraClustersClient) NewListByResourceGroupPager

NewListByResourceGroupPager - List all managed Cassandra clusters in this resource group.

Generated from API version 2024-02-15-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCassandraClustersClient().NewListByResourceGroupPager("cassandra-prod-rg", 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.ListClusters = armcosmos.ListClusters{
	// 	Value: []*armcosmos.ClusterResource{
	// 		{
	// 			Name: to.Ptr("cassandra-prod"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.ClusterResourceProperties{
	// 				AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra),
	// 				CassandraVersion: to.Ptr("3.11"),
	// 				ClientCertificates: []*armcosmos.Certificate{
	// 					{
	// 						Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
	// 				}},
	// 				ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"),
	// 				DelegatedManagementSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"),
	// 				ExternalGossipCertificates: []*armcosmos.Certificate{
	// 					{
	// 						Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
	// 				}},
	// 				ExternalSeedNodes: []*armcosmos.SeedNode{
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.2"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.3"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.4"),
	// 				}},
	// 				GossipCertificates: []*armcosmos.Certificate{
	// 					{
	// 						Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
	// 				}},
	// 				HoursBetweenBackups: to.Ptr[int32](24),
	// 				ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded),
	// 				SeedNodes: []*armcosmos.SeedNode{
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.2"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.3"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.4"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("192.168.12.2"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("192.168.12.3"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("192.168.12.4"),
	// 				}},
	// 			},
	// 	}},
	// }
}
Output:

func (*CassandraClustersClient) NewListBySubscriptionPager

NewListBySubscriptionPager - List all managed Cassandra clusters in this subscription.

Generated from API version 2024-02-15-preview

  • options - CassandraClustersClientListBySubscriptionOptions contains the optional parameters for the CassandraClustersClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCassandraClustersClient().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.ListClusters = armcosmos.ListClusters{
	// 	Value: []*armcosmos.ClusterResource{
	// 		{
	// 			Name: to.Ptr("cassandra-prod"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/cassandraClusters"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.ClusterResourceProperties{
	// 				AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra),
	// 				CassandraVersion: to.Ptr("3.11"),
	// 				ClientCertificates: []*armcosmos.Certificate{
	// 					{
	// 						Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
	// 				}},
	// 				ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"),
	// 				DelegatedManagementSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"),
	// 				ExternalGossipCertificates: []*armcosmos.Certificate{
	// 					{
	// 						Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
	// 				}},
	// 				ExternalSeedNodes: []*armcosmos.SeedNode{
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.2"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.3"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.4"),
	// 				}},
	// 				GossipCertificates: []*armcosmos.Certificate{
	// 					{
	// 						Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"),
	// 				}},
	// 				HoursBetweenBackups: to.Ptr[int32](24),
	// 				ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded),
	// 				SeedNodes: []*armcosmos.SeedNode{
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.2"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.3"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("10.52.221.4"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("192.168.12.2"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("192.168.12.3"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("192.168.12.4"),
	// 				}},
	// 			},
	// 	}},
	// }
}
Output:

func (*CassandraClustersClient) NewListCommandPager

func (client *CassandraClustersClient) NewListCommandPager(resourceGroupName string, clusterName string, options *CassandraClustersClientListCommandOptions) *runtime.Pager[CassandraClustersClientListCommandResponse]

NewListCommandPager - List all commands currently running on ring info

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • options - CassandraClustersClientListCommandOptions contains the optional parameters for the CassandraClustersClient.NewListCommandPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraListCommand.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCassandraClustersClient().NewListCommandPager("cassandra-prod-rg", "cassandra-prod", 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.ListCommands = armcosmos.ListCommands{
	// 	Value: []*armcosmos.CommandPublicResource{
	// 		{
	// 			Arguments: map[string]any{
	// 				"status": "",
	// 			},
	// 			CassandraStopStart: to.Ptr(false),
	// 			Command: to.Ptr("nodetool"),
	// 			CommandID: to.Ptr("1234"),
	// 			Host: to.Ptr("10.0.1.12"),
	// 			ReadWrite: to.Ptr(true),
	// 			Status: to.Ptr(armcosmos.CommandStatus("Enqueued")),
	// 	}},
	// }
}
Output:

func (*CassandraClustersClient) Status

Status - Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • options - CassandraClustersClientStatusOptions contains the optional parameters for the CassandraClustersClient.Status method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraStatus.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCassandraClustersClient().Status(ctx, "cassandra-prod-rg", "cassandra-prod", 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.CassandraClusterPublicStatus = armcosmos.CassandraClusterPublicStatus{
// 	ConnectionErrors: []*armcosmos.ConnectionError{
// 	},
// 	DataCenters: []*armcosmos.CassandraClusterPublicStatusDataCentersItem{
// 		{
// 			Name: to.Ptr("cassandra-westus2-vmss"),
// 			Nodes: []*armcosmos.ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems{
// 				{
// 					Address: to.Ptr("10.0.8.10"),
// 					CassandraProcessStatus: to.Ptr("Running"),
// 					CPUUsage: to.Ptr[float64](0.9),
// 					DiskFreeKB: to.Ptr[int64](1001260056),
// 					DiskUsedKB: to.Ptr[int64](749836),
// 					HostID: to.Ptr("8ccc00a7-9e22-4ac2-aa63-e5327aa0dc51"),
// 					Load: to.Ptr("84.61 MiB"),
// 					MemoryBuffersAndCachedKB: to.Ptr[int64](10817580),
// 					MemoryFreeKB: to.Ptr[int64](35731832),
// 					MemoryTotalKB: to.Ptr[int64](57610444),
// 					MemoryUsedKB: to.Ptr[int64](11061032),
// 					Rack: to.Ptr("rack1"),
// 					Size: to.Ptr[int32](16),
// 					State: to.Ptr(armcosmos.NodeStateNormal),
// 					Status: to.Ptr("Up"),
// 					Timestamp: to.Ptr("10/05/2021, 14:35:20.028"),
// 					Tokens: []*string{
// 						to.Ptr("-7785254003841681178"),
// 						to.Ptr("-6756518164561476165"),
// 						to.Ptr("-4269720020504480060"),
// 						to.Ptr("-2697657908817852783"),
// 						to.Ptr("-2622387897201218249"),
// 						to.Ptr("-2177258200443022948"),
// 						to.Ptr("-129203941752875603"),
// 						to.Ptr("1738406920822650025"),
// 						to.Ptr("2598053056312400240"),
// 						to.Ptr("3227346424117996872"),
// 						to.Ptr("3644347038875498376"),
// 						to.Ptr("4823546474906050895"),
// 						to.Ptr("5293156680707616627"),
// 						to.Ptr("5485806686603256557"),
// 						to.Ptr("6250058817756969464"),
// 						to.Ptr("7991328665766267709")},
// 					},
// 					{
// 						Address: to.Ptr("10.0.8.11"),
// 						CassandraProcessStatus: to.Ptr("Running"),
// 						CPUUsage: to.Ptr[float64](1.2),
// 						DiskFreeKB: to.Ptr[int64](1001283028),
// 						DiskUsedKB: to.Ptr[int64](726864),
// 						HostID: to.Ptr("14092117-4f77-4ec0-8984-c5b860b88a47"),
// 						Load: to.Ptr("59.67 MiB"),
// 						MemoryBuffersAndCachedKB: to.Ptr[int64](10691520),
// 						MemoryFreeKB: to.Ptr[int64](35863248),
// 						MemoryTotalKB: to.Ptr[int64](57610444),
// 						MemoryUsedKB: to.Ptr[int64](11055676),
// 						Rack: to.Ptr("rack2"),
// 						Size: to.Ptr[int32](16),
// 						State: to.Ptr(armcosmos.NodeStateNormal),
// 						Status: to.Ptr("Up"),
// 						Timestamp: to.Ptr("10/05/2021, 14:35:20.028"),
// 						Tokens: []*string{
// 							to.Ptr("-8726238055665903210"),
// 							to.Ptr("-6687985003871487470"),
// 							to.Ptr("-5269140854976433359"),
// 							to.Ptr("-3989177686905645288"),
// 							to.Ptr("-3957362495277148220"),
// 							to.Ptr("-2539287458896988944"),
// 							to.Ptr("-2460716365393303466"),
// 							to.Ptr("-1848370030729221440"),
// 							to.Ptr("137707733677015122"),
// 							to.Ptr("579467328507000597"),
// 							to.Ptr("1698264534774619627"),
// 							to.Ptr("1904235159942090722"),
// 							to.Ptr("3312208865519999146"),
// 							to.Ptr("4035940456270983993"),
// 							to.Ptr("4412314431151736777"),
// 							to.Ptr("8232565668795426078")},
// 						},
// 						{
// 							Address: to.Ptr("10.0.8.12"),
// 							CassandraProcessStatus: to.Ptr("Running"),
// 							CPUUsage: to.Ptr[float64](0.4),
// 							DiskFreeKB: to.Ptr[int64](1001252352),
// 							DiskUsedKB: to.Ptr[int64](757540),
// 							HostID: to.Ptr("e16ada14-39db-462b-9f9e-5b5f6beb8bbd"),
// 							IsLatestModel: to.Ptr(true),
// 							Load: to.Ptr("93.2 MiB"),
// 							MemoryBuffersAndCachedKB: to.Ptr[int64](10453856),
// 							MemoryFreeKB: to.Ptr[int64](36104980),
// 							MemoryTotalKB: to.Ptr[int64](57610444),
// 							MemoryUsedKB: to.Ptr[int64](11051608),
// 							Rack: to.Ptr("rack3"),
// 							Size: to.Ptr[int32](16),
// 							State: to.Ptr(armcosmos.NodeStateNormal),
// 							Status: to.Ptr("Up"),
// 							Timestamp: to.Ptr("10/05/2021, 14:35:20.028"),
// 							Tokens: []*string{
// 								to.Ptr("-5679481051867296621"),
// 								to.Ptr("-4574115287969297989"),
// 								to.Ptr("-3444578133211470522"),
// 								to.Ptr("-2755931580714972271"),
// 								to.Ptr("-2304431590844389550"),
// 								to.Ptr("-1961946736975068713"),
// 								to.Ptr("-940120277889446704"),
// 								to.Ptr("554469308917912318"),
// 								to.Ptr("1030447162050118004"),
// 								to.Ptr("2745632329542596589"),
// 								to.Ptr("4564547712926446283"),
// 								to.Ptr("5185613478135944116"),
// 								to.Ptr("7280237939830623824"),
// 								to.Ptr("7504213835759531710"),
// 								to.Ptr("7631994478195429959"),
// 								to.Ptr("8139769477321226157")},
// 						}},
// 						SeedNodes: []*string{
// 							to.Ptr("10.0.8.10"),
// 							to.Ptr("10.0.8.11"),
// 							to.Ptr("10.0.8.12")},
// 					}},
// 					ETag: to.Ptr("A350A2CE7E91B6D5A102A5E5EC222B882D981092"),
// 					ReaperStatus: &armcosmos.ManagedCassandraReaperStatus{
// 						Healthy: to.Ptr(true),
// 						RepairRunIDs: map[string]*string{
// 						},
// 						RepairSchedules: map[string]*string{
// 							"00000000-0000-0001-0000-000000000000": to.Ptr("ACTIVE"),
// 						},
// 					},
// 				}
Output:

type CassandraClustersClientBeginCreateUpdateOptions

type CassandraClustersClientBeginCreateUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraClustersClientBeginCreateUpdateOptions contains the optional parameters for the CassandraClustersClient.BeginCreateUpdate method.

type CassandraClustersClientBeginDeallocateOptions

type CassandraClustersClientBeginDeallocateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string

	// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might
	// cause data loss
	XMSForceDeallocate *string
}

CassandraClustersClientBeginDeallocateOptions contains the optional parameters for the CassandraClustersClient.BeginDeallocate method.

type CassandraClustersClientBeginDeleteOptions

type CassandraClustersClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraClustersClientBeginDeleteOptions contains the optional parameters for the CassandraClustersClient.BeginDelete method.

type CassandraClustersClientBeginInvokeCommandAsyncOptions

type CassandraClustersClientBeginInvokeCommandAsyncOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraClustersClientBeginInvokeCommandAsyncOptions contains the optional parameters for the CassandraClustersClient.BeginInvokeCommandAsync method.

type CassandraClustersClientBeginInvokeCommandOptions

type CassandraClustersClientBeginInvokeCommandOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraClustersClientBeginInvokeCommandOptions contains the optional parameters for the CassandraClustersClient.BeginInvokeCommand method.

type CassandraClustersClientBeginStartOptions

type CassandraClustersClientBeginStartOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraClustersClientBeginStartOptions contains the optional parameters for the CassandraClustersClient.BeginStart method.

type CassandraClustersClientBeginUpdateOptions

type CassandraClustersClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraClustersClientBeginUpdateOptions contains the optional parameters for the CassandraClustersClient.BeginUpdate method.

type CassandraClustersClientCreateUpdateResponse

type CassandraClustersClientCreateUpdateResponse struct {
	// Representation of a managed Cassandra cluster.
	ClusterResource
}

CassandraClustersClientCreateUpdateResponse contains the response from method CassandraClustersClient.BeginCreateUpdate.

type CassandraClustersClientDeallocateResponse

type CassandraClustersClientDeallocateResponse struct {
}

CassandraClustersClientDeallocateResponse contains the response from method CassandraClustersClient.BeginDeallocate.

type CassandraClustersClientDeleteResponse

type CassandraClustersClientDeleteResponse struct {
}

CassandraClustersClientDeleteResponse contains the response from method CassandraClustersClient.BeginDelete.

type CassandraClustersClientGetBackupOptions

type CassandraClustersClientGetBackupOptions struct {
}

CassandraClustersClientGetBackupOptions contains the optional parameters for the CassandraClustersClient.GetBackup method.

type CassandraClustersClientGetBackupResponse

type CassandraClustersClientGetBackupResponse struct {
	// A restorable backup of a Cassandra cluster.
	BackupResource
}

CassandraClustersClientGetBackupResponse contains the response from method CassandraClustersClient.GetBackup.

type CassandraClustersClientGetCommandAsyncOptions

type CassandraClustersClientGetCommandAsyncOptions struct {
}

CassandraClustersClientGetCommandAsyncOptions contains the optional parameters for the CassandraClustersClient.GetCommandAsync method.

type CassandraClustersClientGetCommandAsyncResponse

type CassandraClustersClientGetCommandAsyncResponse struct {
	// List of commands for cluster.
	ListCommands
}

CassandraClustersClientGetCommandAsyncResponse contains the response from method CassandraClustersClient.GetCommandAsync.

type CassandraClustersClientGetOptions

type CassandraClustersClientGetOptions struct {
}

CassandraClustersClientGetOptions contains the optional parameters for the CassandraClustersClient.Get method.

type CassandraClustersClientGetResponse

type CassandraClustersClientGetResponse struct {
	// Representation of a managed Cassandra cluster.
	ClusterResource
}

CassandraClustersClientGetResponse contains the response from method CassandraClustersClient.Get.

type CassandraClustersClientInvokeCommandAsyncResponse

type CassandraClustersClientInvokeCommandAsyncResponse struct {
	// resource representing a command
	CommandPublicResource
}

CassandraClustersClientInvokeCommandAsyncResponse contains the response from method CassandraClustersClient.BeginInvokeCommandAsync.

type CassandraClustersClientInvokeCommandResponse

type CassandraClustersClientInvokeCommandResponse struct {
	// Response of /command api
	CommandOutput
}

CassandraClustersClientInvokeCommandResponse contains the response from method CassandraClustersClient.BeginInvokeCommand.

type CassandraClustersClientListBackupsOptions

type CassandraClustersClientListBackupsOptions struct {
}

CassandraClustersClientListBackupsOptions contains the optional parameters for the CassandraClustersClient.NewListBackupsPager method.

type CassandraClustersClientListBackupsResponse

type CassandraClustersClientListBackupsResponse struct {
	// List of restorable backups for a Cassandra cluster.
	ListBackups
}

CassandraClustersClientListBackupsResponse contains the response from method CassandraClustersClient.NewListBackupsPager.

type CassandraClustersClientListByResourceGroupOptions

type CassandraClustersClientListByResourceGroupOptions struct {
}

CassandraClustersClientListByResourceGroupOptions contains the optional parameters for the CassandraClustersClient.NewListByResourceGroupPager method.

type CassandraClustersClientListByResourceGroupResponse

type CassandraClustersClientListByResourceGroupResponse struct {
	// List of managed Cassandra clusters.
	ListClusters
}

CassandraClustersClientListByResourceGroupResponse contains the response from method CassandraClustersClient.NewListByResourceGroupPager.

type CassandraClustersClientListBySubscriptionOptions

type CassandraClustersClientListBySubscriptionOptions struct {
}

CassandraClustersClientListBySubscriptionOptions contains the optional parameters for the CassandraClustersClient.NewListBySubscriptionPager method.

type CassandraClustersClientListBySubscriptionResponse

type CassandraClustersClientListBySubscriptionResponse struct {
	// List of managed Cassandra clusters.
	ListClusters
}

CassandraClustersClientListBySubscriptionResponse contains the response from method CassandraClustersClient.NewListBySubscriptionPager.

type CassandraClustersClientListCommandOptions

type CassandraClustersClientListCommandOptions struct {
}

CassandraClustersClientListCommandOptions contains the optional parameters for the CassandraClustersClient.NewListCommandPager method.

type CassandraClustersClientListCommandResponse

type CassandraClustersClientListCommandResponse struct {
	// List of commands for cluster.
	ListCommands
}

CassandraClustersClientListCommandResponse contains the response from method CassandraClustersClient.NewListCommandPager.

type CassandraClustersClientStartResponse

type CassandraClustersClientStartResponse struct {
}

CassandraClustersClientStartResponse contains the response from method CassandraClustersClient.BeginStart.

type CassandraClustersClientStatusOptions

type CassandraClustersClientStatusOptions struct {
}

CassandraClustersClientStatusOptions contains the optional parameters for the CassandraClustersClient.Status method.

type CassandraClustersClientStatusResponse

type CassandraClustersClientStatusResponse struct {
	// Properties of a managed Cassandra cluster public status.
	CassandraClusterPublicStatus
}

CassandraClustersClientStatusResponse contains the response from method CassandraClustersClient.Status.

type CassandraClustersClientUpdateResponse

type CassandraClustersClientUpdateResponse struct {
	// Representation of a managed Cassandra cluster.
	ClusterResource
}

CassandraClustersClientUpdateResponse contains the response from method CassandraClustersClient.BeginUpdate.

type CassandraDataCentersClient

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

CassandraDataCentersClient contains the methods for the CassandraDataCenters group. Don't use this type directly, use NewCassandraDataCentersClient() instead.

func NewCassandraDataCentersClient

func NewCassandraDataCentersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CassandraDataCentersClient, error)

NewCassandraDataCentersClient creates a new instance of CassandraDataCentersClient with the specified values.

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

func (*CassandraDataCentersClient) BeginCreateUpdate

BeginCreateUpdate - Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • dataCenterName - Data center name in a managed Cassandra cluster.
  • body - Parameters specifying the managed Cassandra data center.
  • options - CassandraDataCentersClientBeginCreateUpdateOptions contains the optional parameters for the CassandraDataCentersClient.BeginCreateUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraDataCentersClient().BeginCreateUpdate(ctx, "cassandra-prod-rg", "cassandra-prod", "dc1", armcosmos.DataCenterResource{
	Properties: &armcosmos.DataCenterResourceProperties{
		Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="),
		DataCenterLocation:                 to.Ptr("West US 2"),
		DelegatedSubnetID:                  to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1-subnet"),
		NodeCount:                          to.Ptr[int32](9),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.DataCenterResource = armcosmos.DataCenterResource{
// 	Name: to.Ptr("dc1"),
// 	Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters/dataCenters"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/dataCenters/dc1"),
// 	Properties: &armcosmos.DataCenterResourceProperties{
// 		DataCenterLocation: to.Ptr("West US 2"),
// 		DelegatedSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1"),
// 		NodeCount: to.Ptr[int32](9),
// 		ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded),
// 		SeedNodes: []*armcosmos.SeedNode{
// 			{
// 				IPAddress: to.Ptr("192.168.12.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.4"),
// 		}},
// 	},
// }
Output:

func (*CassandraDataCentersClient) BeginDelete

func (client *CassandraDataCentersClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, options *CassandraDataCentersClientBeginDeleteOptions) (*runtime.Poller[CassandraDataCentersClientDeleteResponse], error)

BeginDelete - Delete a managed Cassandra data center. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • dataCenterName - Data center name in a managed Cassandra cluster.
  • options - CassandraDataCentersClientBeginDeleteOptions contains the optional parameters for the CassandraDataCentersClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraDataCentersClient().BeginDelete(ctx, "cassandra-prod-rg", "cassandra-prod", "dc1", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*CassandraDataCentersClient) BeginUpdate

BeginUpdate - Update some of the properties of a managed Cassandra data center. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • dataCenterName - Data center name in a managed Cassandra cluster.
  • body - Parameters to provide for specifying the managed Cassandra data center.
  • options - CassandraDataCentersClientBeginUpdateOptions contains the optional parameters for the CassandraDataCentersClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraDataCentersClient().BeginUpdate(ctx, "cassandra-prod-rg", "cassandra-prod", "dc1", armcosmos.DataCenterResource{
	Properties: &armcosmos.DataCenterResourceProperties{
		Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="),
		DataCenterLocation:                 to.Ptr("West US 2"),
		DelegatedSubnetID:                  to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1-subnet"),
		NodeCount:                          to.Ptr[int32](9),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.DataCenterResource = armcosmos.DataCenterResource{
// 	Name: to.Ptr("dc1"),
// 	Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters/dataCenters"),
// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/dataCenters/dc1"),
// 	Properties: &armcosmos.DataCenterResourceProperties{
// 		Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="),
// 		DataCenterLocation: to.Ptr("West US 2"),
// 		DelegatedSubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1"),
// 		NodeCount: to.Ptr[int32](9),
// 		ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded),
// 		SeedNodes: []*armcosmos.SeedNode{
// 			{
// 				IPAddress: to.Ptr("192.168.12.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.4"),
// 		}},
// 	},
// }
Output:

func (*CassandraDataCentersClient) Get

func (client *CassandraDataCentersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, options *CassandraDataCentersClientGetOptions) (CassandraDataCentersClientGetResponse, error)

Get - Get the properties of a managed Cassandra data center. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • dataCenterName - Data center name in a managed Cassandra cluster.
  • options - CassandraDataCentersClientGetOptions contains the optional parameters for the CassandraDataCentersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCassandraDataCentersClient().Get(ctx, "cassandra-prod-rg", "cassandra-prod", "dc1", 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.DataCenterResource = armcosmos.DataCenterResource{
// 	Name: to.Ptr("dc1"),
// 	Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters/dataCenters"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/dataCenters/dc1"),
// 	Properties: &armcosmos.DataCenterResourceProperties{
// 		Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="),
// 		DataCenterLocation: to.Ptr("West US 2"),
// 		DelegatedSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1"),
// 		NodeCount: to.Ptr[int32](9),
// 		ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded),
// 		SeedNodes: []*armcosmos.SeedNode{
// 			{
// 				IPAddress: to.Ptr("192.168.12.2"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.3"),
// 			},
// 			{
// 				IPAddress: to.Ptr("192.168.12.4"),
// 		}},
// 	},
// }
Output:

func (*CassandraDataCentersClient) NewListPager

NewListPager - List all data centers in a particular managed Cassandra cluster.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - Managed Cassandra cluster name.
  • options - CassandraDataCentersClientListOptions contains the optional parameters for the CassandraDataCentersClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBManagedCassandraDataCenterList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCassandraDataCentersClient().NewListPager("cassandra-prod-rg", "cassandra-prod", 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.ListDataCenters = armcosmos.ListDataCenters{
	// 	Value: []*armcosmos.DataCenterResource{
	// 		{
	// 			Name: to.Ptr("dc1"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/cassandraClusters/dataCenters"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/dataCenters"),
	// 			Properties: &armcosmos.DataCenterResourceProperties{
	// 				Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="),
	// 				DataCenterLocation: to.Ptr("West US 2"),
	// 				DelegatedSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1"),
	// 				NodeCount: to.Ptr[int32](9),
	// 				ProvisioningState: to.Ptr(armcosmos.ManagedCassandraProvisioningStateSucceeded),
	// 				SeedNodes: []*armcosmos.SeedNode{
	// 					{
	// 						IPAddress: to.Ptr("192.168.12.2"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("192.168.12.3"),
	// 					},
	// 					{
	// 						IPAddress: to.Ptr("192.168.12.4"),
	// 				}},
	// 			},
	// 	}},
	// }
}
Output:

type CassandraDataCentersClientBeginCreateUpdateOptions

type CassandraDataCentersClientBeginCreateUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraDataCentersClientBeginCreateUpdateOptions contains the optional parameters for the CassandraDataCentersClient.BeginCreateUpdate method.

type CassandraDataCentersClientBeginDeleteOptions

type CassandraDataCentersClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraDataCentersClientBeginDeleteOptions contains the optional parameters for the CassandraDataCentersClient.BeginDelete method.

type CassandraDataCentersClientBeginUpdateOptions

type CassandraDataCentersClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraDataCentersClientBeginUpdateOptions contains the optional parameters for the CassandraDataCentersClient.BeginUpdate method.

type CassandraDataCentersClientCreateUpdateResponse

type CassandraDataCentersClientCreateUpdateResponse struct {
	// A managed Cassandra data center.
	DataCenterResource
}

CassandraDataCentersClientCreateUpdateResponse contains the response from method CassandraDataCentersClient.BeginCreateUpdate.

type CassandraDataCentersClientDeleteResponse

type CassandraDataCentersClientDeleteResponse struct {
}

CassandraDataCentersClientDeleteResponse contains the response from method CassandraDataCentersClient.BeginDelete.

type CassandraDataCentersClientGetOptions

type CassandraDataCentersClientGetOptions struct {
}

CassandraDataCentersClientGetOptions contains the optional parameters for the CassandraDataCentersClient.Get method.

type CassandraDataCentersClientGetResponse

type CassandraDataCentersClientGetResponse struct {
	// A managed Cassandra data center.
	DataCenterResource
}

CassandraDataCentersClientGetResponse contains the response from method CassandraDataCentersClient.Get.

type CassandraDataCentersClientListOptions

type CassandraDataCentersClientListOptions struct {
}

CassandraDataCentersClientListOptions contains the optional parameters for the CassandraDataCentersClient.NewListPager method.

type CassandraDataCentersClientListResponse

type CassandraDataCentersClientListResponse struct {
	// List of managed Cassandra data centers and their properties.
	ListDataCenters
}

CassandraDataCentersClientListResponse contains the response from method CassandraDataCentersClient.NewListPager.

type CassandraDataCentersClientUpdateResponse

type CassandraDataCentersClientUpdateResponse struct {
	// A managed Cassandra data center.
	DataCenterResource
}

CassandraDataCentersClientUpdateResponse contains the response from method CassandraDataCentersClient.BeginUpdate.

type CassandraDataTransferDataSourceSink

type CassandraDataTransferDataSourceSink struct {
	// REQUIRED
	Component *DataTransferComponent

	// REQUIRED
	KeyspaceName *string

	// REQUIRED
	TableName         *string
	RemoteAccountName *string
}

CassandraDataTransferDataSourceSink - A CosmosDB Cassandra API data source/sink

func (*CassandraDataTransferDataSourceSink) GetBaseCosmosDataTransferDataSourceSink

func (c *CassandraDataTransferDataSourceSink) GetBaseCosmosDataTransferDataSourceSink() *BaseCosmosDataTransferDataSourceSink

GetBaseCosmosDataTransferDataSourceSink implements the BaseCosmosDataTransferDataSourceSinkClassification interface for type CassandraDataTransferDataSourceSink.

func (*CassandraDataTransferDataSourceSink) GetDataTransferDataSourceSink

func (c *CassandraDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink

GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type CassandraDataTransferDataSourceSink.

func (CassandraDataTransferDataSourceSink) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraDataTransferDataSourceSink.

func (*CassandraDataTransferDataSourceSink) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraDataTransferDataSourceSink.

type CassandraError

type CassandraError struct {
	// Additional information about the error.
	AdditionalErrorInfo *string

	// The code of error that occurred.
	Code *string

	// The message of the error.
	Message *string

	// The target resource of the error.
	Target *string
}

func (CassandraError) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraError.

func (*CassandraError) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraError.

type CassandraKeyspaceCreateUpdateParameters

type CassandraKeyspaceCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB Cassandra keyspace.
	Properties *CassandraKeyspaceCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

CassandraKeyspaceCreateUpdateParameters - Parameters to create and update Cosmos DB Cassandra keyspace.

func (CassandraKeyspaceCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraKeyspaceCreateUpdateParameters.

func (*CassandraKeyspaceCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraKeyspaceCreateUpdateParameters.

type CassandraKeyspaceCreateUpdateProperties

type CassandraKeyspaceCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a Cassandra keyspace
	Resource *CassandraKeyspaceResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

CassandraKeyspaceCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra keyspace.

func (CassandraKeyspaceCreateUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraKeyspaceCreateUpdateProperties.

func (*CassandraKeyspaceCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraKeyspaceCreateUpdateProperties.

type CassandraKeyspaceGetProperties

type CassandraKeyspaceGetProperties struct {
	Options  *CassandraKeyspaceGetPropertiesOptions
	Resource *CassandraKeyspaceGetPropertiesResource
}

CassandraKeyspaceGetProperties - The properties of an Azure Cosmos DB Cassandra keyspace

func (CassandraKeyspaceGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraKeyspaceGetProperties.

func (*CassandraKeyspaceGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraKeyspaceGetProperties.

type CassandraKeyspaceGetPropertiesOptions

type CassandraKeyspaceGetPropertiesOptions struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

func (CassandraKeyspaceGetPropertiesOptions) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraKeyspaceGetPropertiesOptions.

func (*CassandraKeyspaceGetPropertiesOptions) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraKeyspaceGetPropertiesOptions.

type CassandraKeyspaceGetPropertiesResource

type CassandraKeyspaceGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB Cassandra keyspace
	ID *string

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (CassandraKeyspaceGetPropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraKeyspaceGetPropertiesResource.

func (*CassandraKeyspaceGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraKeyspaceGetPropertiesResource.

type CassandraKeyspaceGetResults

type CassandraKeyspaceGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB Cassandra keyspace
	Properties *CassandraKeyspaceGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

CassandraKeyspaceGetResults - An Azure Cosmos DB Cassandra keyspace.

func (CassandraKeyspaceGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraKeyspaceGetResults.

func (*CassandraKeyspaceGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraKeyspaceGetResults.

type CassandraKeyspaceListResult

type CassandraKeyspaceListResult struct {
	// READ-ONLY; List of Cassandra keyspaces and their properties.
	Value []*CassandraKeyspaceGetResults
}

CassandraKeyspaceListResult - The List operation response, that contains the Cassandra keyspaces and their properties.

func (CassandraKeyspaceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraKeyspaceListResult.

func (*CassandraKeyspaceListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraKeyspaceListResult.

type CassandraKeyspaceResource

type CassandraKeyspaceResource struct {
	// REQUIRED; Name of the Cosmos DB Cassandra keyspace
	ID *string
}

CassandraKeyspaceResource - Cosmos DB Cassandra keyspace resource object

func (CassandraKeyspaceResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraKeyspaceResource.

func (*CassandraKeyspaceResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraKeyspaceResource.

type CassandraPartitionKey

type CassandraPartitionKey struct {
	// Name of the Cosmos DB Cassandra table partition key
	Name *string
}

CassandraPartitionKey - Cosmos DB Cassandra table partition key

func (CassandraPartitionKey) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraPartitionKey.

func (*CassandraPartitionKey) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraPartitionKey.

type CassandraResourcesClient

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

CassandraResourcesClient contains the methods for the CassandraResources group. Don't use this type directly, use NewCassandraResourcesClient() instead.

func NewCassandraResourcesClient

func NewCassandraResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CassandraResourcesClient, error)

NewCassandraResourcesClient creates a new instance of CassandraResourcesClient with the specified values.

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

func (*CassandraResourcesClient) BeginCreateUpdateCassandraKeyspace

func (client *CassandraResourcesClient) BeginCreateUpdateCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters CassandraKeyspaceCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraKeyspaceOptions) (*runtime.Poller[CassandraResourcesClientCreateUpdateCassandraKeyspaceResponse], error)

BeginCreateUpdateCassandraKeyspace - Create or update an Azure Cosmos DB Cassandra keyspace If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • createUpdateCassandraKeyspaceParameters - The parameters to provide for the current Cassandra keyspace.
  • options - CassandraResourcesClientBeginCreateUpdateCassandraKeyspaceOptions contains the optional parameters for the CassandraResourcesClient.BeginCreateUpdateCassandraKeyspace method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginCreateUpdateCassandraKeyspace(ctx, "rg1", "ddb1", "keyspaceName", armcosmos.CassandraKeyspaceCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.CassandraKeyspaceCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.CassandraKeyspaceResource{
			ID: to.Ptr("keyspaceName"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.CassandraKeyspaceGetResults = armcosmos.CassandraKeyspaceGetResults{
// 	Name: to.Ptr("keyspaceName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.CassandraKeyspaceGetProperties{
// 		Resource: &armcosmos.CassandraKeyspaceGetPropertiesResource{
// 			ID: to.Ptr("keyspaceName"),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) BeginCreateUpdateCassandraTable

func (client *CassandraResourcesClient) BeginCreateUpdateCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters CassandraTableCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraTableOptions) (*runtime.Poller[CassandraResourcesClientCreateUpdateCassandraTableResponse], error)

BeginCreateUpdateCassandraTable - Create or update an Azure Cosmos DB Cassandra Table If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • tableName - Cosmos DB table name.
  • createUpdateCassandraTableParameters - The parameters to provide for the current Cassandra Table.
  • options - CassandraResourcesClientBeginCreateUpdateCassandraTableOptions contains the optional parameters for the CassandraResourcesClient.BeginCreateUpdateCassandraTable method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginCreateUpdateCassandraTable(ctx, "rg1", "ddb1", "keyspaceName", "tableName", armcosmos.CassandraTableCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.CassandraTableCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.CassandraTableResource{
			Schema: &armcosmos.CassandraSchema{
				ClusterKeys: []*armcosmos.ClusterKey{
					{
						Name:    to.Ptr("columnA"),
						OrderBy: to.Ptr("Asc"),
					}},
				Columns: []*armcosmos.Column{
					{
						Name: to.Ptr("columnA"),
						Type: to.Ptr("Ascii"),
					}},
				PartitionKeys: []*armcosmos.CassandraPartitionKey{
					{
						Name: to.Ptr("columnA"),
					}},
			},
			AnalyticalStorageTTL: to.Ptr[int32](500),
			DefaultTTL:           to.Ptr[int32](100),
			ID:                   to.Ptr("tableName"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.CassandraTableGetResults = armcosmos.CassandraTableGetResults{
// 	Name: to.Ptr("tableName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/cassandraTables"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/cassandraTables/tableName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.CassandraTableGetProperties{
// 		Resource: &armcosmos.CassandraTableGetPropertiesResource{
// 			Schema: &armcosmos.CassandraSchema{
// 				ClusterKeys: []*armcosmos.ClusterKey{
// 					{
// 						Name: to.Ptr("columnA"),
// 						OrderBy: to.Ptr("Asc"),
// 				}},
// 				Columns: []*armcosmos.Column{
// 					{
// 						Name: to.Ptr("columnA"),
// 						Type: to.Ptr("Ascii"),
// 				}},
// 				PartitionKeys: []*armcosmos.CassandraPartitionKey{
// 					{
// 						Name: to.Ptr("columnA"),
// 				}},
// 			},
// 			AnalyticalStorageTTL: to.Ptr[int32](500),
// 			DefaultTTL: to.Ptr[int32](100),
// 			ID: to.Ptr("tableName"),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) BeginCreateUpdateCassandraView

func (client *CassandraResourcesClient) BeginCreateUpdateCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters CassandraViewCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (*runtime.Poller[CassandraResourcesClientCreateUpdateCassandraViewResponse], error)

BeginCreateUpdateCassandraView - Create or update an Azure Cosmos DB Cassandra View If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • viewName - Cosmos DB view name.
  • createUpdateCassandraViewParameters - The parameters to provide for the current Cassandra View.
  • options - CassandraResourcesClientBeginCreateUpdateCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginCreateUpdateCassandraView method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraViewCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginCreateUpdateCassandraView(ctx, "rg1", "ddb1", "keyspacename", "viewname", armcosmos.CassandraViewCreateUpdateParameters{
	Tags: map[string]*string{},
	Properties: &armcosmos.CassandraViewCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.CassandraViewResource{
			ID:             to.Ptr("viewname"),
			ViewDefinition: to.Ptr("SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.CassandraViewGetResults = armcosmos.CassandraViewGetResults{
// 	Name: to.Ptr("viewname"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspacename/views/viewname"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.CassandraViewGetProperties{
// 		Resource: &armcosmos.CassandraViewGetPropertiesResource{
// 			ID: to.Ptr("viewname"),
// 			ViewDefinition: to.Ptr("SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY KEY (columnc, columna)"),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) BeginDeleteCassandraKeyspace

BeginDeleteCassandraKeyspace - Deletes an existing Azure Cosmos DB Cassandra keyspace. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • options - CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraKeyspace method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginDeleteCassandraKeyspace(ctx, "rg1", "ddb1", "keyspaceName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*CassandraResourcesClient) BeginDeleteCassandraTable

func (client *CassandraResourcesClient) BeginDeleteCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientBeginDeleteCassandraTableOptions) (*runtime.Poller[CassandraResourcesClientDeleteCassandraTableResponse], error)

BeginDeleteCassandraTable - Deletes an existing Azure Cosmos DB Cassandra table. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • tableName - Cosmos DB table name.
  • options - CassandraResourcesClientBeginDeleteCassandraTableOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraTable method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginDeleteCassandraTable(ctx, "rg1", "ddb1", "keyspaceName", "tableName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*CassandraResourcesClient) BeginDeleteCassandraView

func (client *CassandraResourcesClient) BeginDeleteCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginDeleteCassandraViewOptions) (*runtime.Poller[CassandraResourcesClientDeleteCassandraViewResponse], error)

BeginDeleteCassandraView - Deletes an existing Azure Cosmos DB Cassandra view. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • viewName - Cosmos DB view name.
  • options - CassandraResourcesClientBeginDeleteCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraView method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraViewDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginDeleteCassandraView(ctx, "rg1", "ddb1", "keyspacename", "viewname", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*CassandraResourcesClient) BeginMigrateCassandraKeyspaceToAutoscale

BeginMigrateCassandraKeyspaceToAutoscale - Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • options - CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraKeyspaceToAutoscale method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginMigrateCassandraKeyspaceToAutoscale(ctx, "rg1", "ddb1", "keyspaceName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			AutoscaleSettings: &armcosmos.AutoscaleSettingsResource{
// 				MaxThroughput: to.Ptr[int32](4000),
// 			},
// 			MinimumThroughput: to.Ptr("4000"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) BeginMigrateCassandraKeyspaceToManualThroughput

BeginMigrateCassandraKeyspaceToManualThroughput - Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • options - CassandraResourcesClientBeginMigrateCassandraKeyspaceToManualThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraKeyspaceToManualThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginMigrateCassandraKeyspaceToManualThroughput(ctx, "rg1", "ddb1", "keyspaceName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) BeginMigrateCassandraTableToAutoscale

func (client *CassandraResourcesClient) BeginMigrateCassandraTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientBeginMigrateCassandraTableToAutoscaleOptions) (*runtime.Poller[CassandraResourcesClientMigrateCassandraTableToAutoscaleResponse], error)

BeginMigrateCassandraTableToAutoscale - Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • tableName - Cosmos DB table name.
  • options - CassandraResourcesClientBeginMigrateCassandraTableToAutoscaleOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraTableToAutoscale method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginMigrateCassandraTableToAutoscale(ctx, "rg1", "ddb1", "keyspaceName", "tableName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			AutoscaleSettings: &armcosmos.AutoscaleSettingsResource{
// 				MaxThroughput: to.Ptr[int32](4000),
// 			},
// 			MinimumThroughput: to.Ptr("4000"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) BeginMigrateCassandraTableToManualThroughput

BeginMigrateCassandraTableToManualThroughput - Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • tableName - Cosmos DB table name.
  • options - CassandraResourcesClientBeginMigrateCassandraTableToManualThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraTableToManualThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginMigrateCassandraTableToManualThroughput(ctx, "rg1", "ddb1", "keyspaceName", "tableName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) BeginMigrateCassandraViewToAutoscale

func (client *CassandraResourcesClient) BeginMigrateCassandraViewToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions) (*runtime.Poller[CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse], error)

BeginMigrateCassandraViewToAutoscale - Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • viewName - Cosmos DB view name.
  • options - CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginMigrateCassandraViewToAutoscale(ctx, "rg1", "ddb1", "keyspacename", "viewname", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			AutoscaleSettings: &armcosmos.AutoscaleSettingsResource{
// 				MaxThroughput: to.Ptr[int32](4000),
// 			},
// 			MinimumThroughput: to.Ptr("4000"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) BeginMigrateCassandraViewToManualThroughput

BeginMigrateCassandraViewToManualThroughput - Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • viewName - Cosmos DB view name.
  • options - CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginMigrateCassandraViewToManualThroughput(ctx, "rg1", "ddb1", "keyspacename", "viewname", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) BeginUpdateCassandraKeyspaceThroughput

BeginUpdateCassandraKeyspaceThroughput - Update RUs per second of an Azure Cosmos DB Cassandra Keyspace If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • updateThroughputParameters - The RUs per second of the parameters to provide for the current Cassandra Keyspace.
  • options - CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraKeyspaceThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginUpdateCassandraKeyspaceThroughput(ctx, "rg1", "ddb1", "keyspaceName", armcosmos.ThroughputSettingsUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.ThroughputSettingsUpdateProperties{
		Resource: &armcosmos.ThroughputSettingsResource{
			Throughput: to.Ptr[int32](400),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) BeginUpdateCassandraTableThroughput

func (client *CassandraResourcesClient) BeginUpdateCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraTableThroughputOptions) (*runtime.Poller[CassandraResourcesClientUpdateCassandraTableThroughputResponse], error)

BeginUpdateCassandraTableThroughput - Update RUs per second of an Azure Cosmos DB Cassandra table If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • tableName - Cosmos DB table name.
  • updateThroughputParameters - The RUs per second of the parameters to provide for the current Cassandra table.
  • options - CassandraResourcesClientBeginUpdateCassandraTableThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraTableThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableThroughputUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginUpdateCassandraTableThroughput(ctx, "rg1", "ddb1", "keyspaceName", "tableName", armcosmos.ThroughputSettingsUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.ThroughputSettingsUpdateProperties{
		Resource: &armcosmos.ThroughputSettingsResource{
			Throughput: to.Ptr[int32](400),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/cassandraTables/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/cassandraTables/tableName/throughputSettings/default"),
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) BeginUpdateCassandraViewThroughput

func (client *CassandraResourcesClient) BeginUpdateCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (*runtime.Poller[CassandraResourcesClientUpdateCassandraViewThroughputResponse], error)

BeginUpdateCassandraViewThroughput - Update RUs per second of an Azure Cosmos DB Cassandra view If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • viewName - Cosmos DB view name.
  • updateThroughputParameters - The RUs per second of the parameters to provide for the current Cassandra view.
  • options - CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraViewThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraViewThroughputUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCassandraResourcesClient().BeginUpdateCassandraViewThroughput(ctx, "rg1", "ddb1", "keyspacename", "viewname", armcosmos.ThroughputSettingsUpdateParameters{
	Tags: map[string]*string{},
	Properties: &armcosmos.ThroughputSettingsUpdateProperties{
		Resource: &armcosmos.ThroughputSettingsResource{
			Throughput: to.Ptr[int32](400),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/views/viewName/throughputSettings/default"),
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) GetCassandraKeyspace

func (client *CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientGetCassandraKeyspaceOptions) (CassandraResourcesClientGetCassandraKeyspaceResponse, error)

GetCassandraKeyspace - Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • options - CassandraResourcesClientGetCassandraKeyspaceOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraKeyspace method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCassandraResourcesClient().GetCassandraKeyspace(ctx, "rg1", "ddb1", "keyspaceName", 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.CassandraKeyspaceGetResults = armcosmos.CassandraKeyspaceGetResults{
// 	Name: to.Ptr("keyspaceName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.CassandraKeyspaceGetProperties{
// 		Resource: &armcosmos.CassandraKeyspaceGetPropertiesResource{
// 			ID: to.Ptr("keyspaceName"),
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) GetCassandraKeyspaceThroughput

GetCassandraKeyspaceThroughput - Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • options - CassandraResourcesClientGetCassandraKeyspaceThroughputOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraKeyspaceThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCassandraResourcesClient().GetCassandraKeyspaceThroughput(ctx, "rg1", "ddb1", "keyspaceName", 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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			InstantMaximumThroughput: to.Ptr("10000"),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			SoftAllowedMaximumThroughput: to.Ptr("1000000"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) GetCassandraTable

func (client *CassandraResourcesClient) GetCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientGetCassandraTableOptions) (CassandraResourcesClientGetCassandraTableResponse, error)

GetCassandraTable - Gets the Cassandra table under an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • tableName - Cosmos DB table name.
  • options - CassandraResourcesClientGetCassandraTableOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraTable method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCassandraResourcesClient().GetCassandraTable(ctx, "rg1", "ddb1", "keyspaceName", "tableName", 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.CassandraTableGetResults = armcosmos.CassandraTableGetResults{
// 	Name: to.Ptr("tableName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/cassandraTables"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/cassandraTables/tableName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.CassandraTableGetProperties{
// 		Resource: &armcosmos.CassandraTableGetPropertiesResource{
// 			Schema: &armcosmos.CassandraSchema{
// 				ClusterKeys: []*armcosmos.ClusterKey{
// 					{
// 						Name: to.Ptr("columnA"),
// 						OrderBy: to.Ptr("Asc"),
// 				}},
// 				Columns: []*armcosmos.Column{
// 					{
// 						Name: to.Ptr("columnA"),
// 						Type: to.Ptr("Ascii"),
// 				}},
// 				PartitionKeys: []*armcosmos.CassandraPartitionKey{
// 					{
// 						Name: to.Ptr("columnA"),
// 				}},
// 			},
// 			AnalyticalStorageTTL: to.Ptr[int32](500),
// 			DefaultTTL: to.Ptr[int32](100),
// 			ID: to.Ptr("tableName"),
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) GetCassandraTableThroughput

func (client *CassandraResourcesClient) GetCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientGetCassandraTableThroughputOptions) (CassandraResourcesClientGetCassandraTableThroughputResponse, error)

GetCassandraTableThroughput - Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • tableName - Cosmos DB table name.
  • options - CassandraResourcesClientGetCassandraTableThroughputOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraTableThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableThroughputGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCassandraResourcesClient().GetCassandraTableThroughput(ctx, "rg1", "ddb1", "keyspaceName", "tableName", 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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/cassandraTables/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/cassandraTables/tableName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			InstantMaximumThroughput: to.Ptr("10000"),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			SoftAllowedMaximumThroughput: to.Ptr("1000000"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) GetCassandraView

func (client *CassandraResourcesClient) GetCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientGetCassandraViewOptions) (CassandraResourcesClientGetCassandraViewResponse, error)

GetCassandraView - Gets the Cassandra view under an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • viewName - Cosmos DB view name.
  • options - CassandraResourcesClientGetCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraView method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraViewGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCassandraResourcesClient().GetCassandraView(ctx, "rg1", "ddb1", "keyspacename", "viewname", 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.CassandraViewGetResults = armcosmos.CassandraViewGetResults{
// 	Name: to.Ptr("viewname"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspacename/views/viewname"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.CassandraViewGetProperties{
// 		Resource: &armcosmos.CassandraViewGetPropertiesResource{
// 			ID: to.Ptr("viewname"),
// 			ViewDefinition: to.Ptr("SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY KEY (columnc, columna)"),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) GetCassandraViewThroughput

func (client *CassandraResourcesClient) GetCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientGetCassandraViewThroughputOptions) (CassandraResourcesClientGetCassandraViewThroughputResponse, error)

GetCassandraViewThroughput - Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • viewName - Cosmos DB view name.
  • options - CassandraResourcesClientGetCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraViewThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraViewThroughputGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCassandraResourcesClient().GetCassandraViewThroughput(ctx, "rg1", "ddb1", "keyspacename", "viewname", 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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/views/viewName/throughputSettings/default"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*CassandraResourcesClient) NewListCassandraKeyspacesPager

NewListCassandraKeyspacesPager - Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - CassandraResourcesClientListCassandraKeyspacesOptions contains the optional parameters for the CassandraResourcesClient.NewListCassandraKeyspacesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraKeyspaceList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCassandraResourcesClient().NewListCassandraKeyspacesPager("rgName", "ddb1", 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.CassandraKeyspaceListResult = armcosmos.CassandraKeyspaceListResult{
	// 	Value: []*armcosmos.CassandraKeyspaceGetResults{
	// 		{
	// 			Name: to.Ptr("keyspaceName"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.CassandraKeyspaceGetProperties{
	// 				Resource: &armcosmos.CassandraKeyspaceGetPropertiesResource{
	// 					ID: to.Ptr("keyspaceName"),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

func (*CassandraResourcesClient) NewListCassandraTablesPager

func (client *CassandraResourcesClient) NewListCassandraTablesPager(resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientListCassandraTablesOptions) *runtime.Pager[CassandraResourcesClientListCassandraTablesResponse]

NewListCassandraTablesPager - Lists the Cassandra table under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • options - CassandraResourcesClientListCassandraTablesOptions contains the optional parameters for the CassandraResourcesClient.NewListCassandraTablesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraTableList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCassandraResourcesClient().NewListCassandraTablesPager("rgName", "ddb1", "keyspaceName", 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.CassandraTableListResult = armcosmos.CassandraTableListResult{
	// 	Value: []*armcosmos.CassandraTableGetResults{
	// 		{
	// 			Name: to.Ptr("tableName"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/cassandraTables"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspaceName/cassandraTables/tableName"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.CassandraTableGetProperties{
	// 				Resource: &armcosmos.CassandraTableGetPropertiesResource{
	// 					Schema: &armcosmos.CassandraSchema{
	// 						ClusterKeys: []*armcosmos.ClusterKey{
	// 							{
	// 								Name: to.Ptr("columnA"),
	// 								OrderBy: to.Ptr("Asc"),
	// 						}},
	// 						Columns: []*armcosmos.Column{
	// 							{
	// 								Name: to.Ptr("columnA"),
	// 								Type: to.Ptr("Ascii"),
	// 						}},
	// 						PartitionKeys: []*armcosmos.CassandraPartitionKey{
	// 							{
	// 								Name: to.Ptr("columnA"),
	// 						}},
	// 					},
	// 					AnalyticalStorageTTL: to.Ptr[int32](500),
	// 					DefaultTTL: to.Ptr[int32](100),
	// 					ID: to.Ptr("tableName"),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

func (*CassandraResourcesClient) NewListCassandraViewsPager

func (client *CassandraResourcesClient) NewListCassandraViewsPager(resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientListCassandraViewsOptions) *runtime.Pager[CassandraResourcesClientListCassandraViewsResponse]

NewListCassandraViewsPager - Lists the Cassandra materialized views under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyspaceName - Cosmos DB keyspace name.
  • options - CassandraResourcesClientListCassandraViewsOptions contains the optional parameters for the CassandraResourcesClient.NewListCassandraViewsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCassandraViewList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCassandraResourcesClient().NewListCassandraViewsPager("rgName", "ddb1", "keyspacename", 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.CassandraViewListResult = armcosmos.CassandraViewListResult{
	// 	Value: []*armcosmos.CassandraViewGetResults{
	// 		{
	// 			Name: to.Ptr("viewname"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/cassandraKeyspaces/keyspacename/views/viewname"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.CassandraViewGetProperties{
	// 				Resource: &armcosmos.CassandraViewGetPropertiesResource{
	// 					ID: to.Ptr("viewname"),
	// 					ViewDefinition: to.Ptr("SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY KEY (columnc, columna)"),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type CassandraResourcesClientBeginCreateUpdateCassandraKeyspaceOptions

type CassandraResourcesClientBeginCreateUpdateCassandraKeyspaceOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginCreateUpdateCassandraKeyspaceOptions contains the optional parameters for the CassandraResourcesClient.BeginCreateUpdateCassandraKeyspace method.

type CassandraResourcesClientBeginCreateUpdateCassandraTableOptions

type CassandraResourcesClientBeginCreateUpdateCassandraTableOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginCreateUpdateCassandraTableOptions contains the optional parameters for the CassandraResourcesClient.BeginCreateUpdateCassandraTable method.

type CassandraResourcesClientBeginCreateUpdateCassandraViewOptions

type CassandraResourcesClientBeginCreateUpdateCassandraViewOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginCreateUpdateCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginCreateUpdateCassandraView method.

type CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions

type CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraKeyspace method.

type CassandraResourcesClientBeginDeleteCassandraTableOptions

type CassandraResourcesClientBeginDeleteCassandraTableOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginDeleteCassandraTableOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraTable method.

type CassandraResourcesClientBeginDeleteCassandraViewOptions

type CassandraResourcesClientBeginDeleteCassandraViewOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginDeleteCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraView method.

type CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions

type CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraKeyspaceToAutoscale method.

type CassandraResourcesClientBeginMigrateCassandraKeyspaceToManualThroughputOptions

type CassandraResourcesClientBeginMigrateCassandraKeyspaceToManualThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginMigrateCassandraKeyspaceToManualThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraKeyspaceToManualThroughput method.

type CassandraResourcesClientBeginMigrateCassandraTableToAutoscaleOptions

type CassandraResourcesClientBeginMigrateCassandraTableToAutoscaleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginMigrateCassandraTableToAutoscaleOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraTableToAutoscale method.

type CassandraResourcesClientBeginMigrateCassandraTableToManualThroughputOptions

type CassandraResourcesClientBeginMigrateCassandraTableToManualThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginMigrateCassandraTableToManualThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraTableToManualThroughput method.

type CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions

type CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale method.

type CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions

type CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput method.

type CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions

type CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraKeyspaceThroughput method.

type CassandraResourcesClientBeginUpdateCassandraTableThroughputOptions

type CassandraResourcesClientBeginUpdateCassandraTableThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginUpdateCassandraTableThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraTableThroughput method.

type CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions

type CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraViewThroughput method.

type CassandraResourcesClientCreateUpdateCassandraKeyspaceResponse

type CassandraResourcesClientCreateUpdateCassandraKeyspaceResponse struct {
	// An Azure Cosmos DB Cassandra keyspace.
	CassandraKeyspaceGetResults
}

CassandraResourcesClientCreateUpdateCassandraKeyspaceResponse contains the response from method CassandraResourcesClient.BeginCreateUpdateCassandraKeyspace.

type CassandraResourcesClientCreateUpdateCassandraTableResponse

type CassandraResourcesClientCreateUpdateCassandraTableResponse struct {
	// An Azure Cosmos DB Cassandra table.
	CassandraTableGetResults
}

CassandraResourcesClientCreateUpdateCassandraTableResponse contains the response from method CassandraResourcesClient.BeginCreateUpdateCassandraTable.

type CassandraResourcesClientCreateUpdateCassandraViewResponse

type CassandraResourcesClientCreateUpdateCassandraViewResponse struct {
	// An Azure Cosmos DB Cassandra view.
	CassandraViewGetResults
}

CassandraResourcesClientCreateUpdateCassandraViewResponse contains the response from method CassandraResourcesClient.BeginCreateUpdateCassandraView.

type CassandraResourcesClientDeleteCassandraKeyspaceResponse

type CassandraResourcesClientDeleteCassandraKeyspaceResponse struct {
}

CassandraResourcesClientDeleteCassandraKeyspaceResponse contains the response from method CassandraResourcesClient.BeginDeleteCassandraKeyspace.

type CassandraResourcesClientDeleteCassandraTableResponse

type CassandraResourcesClientDeleteCassandraTableResponse struct {
}

CassandraResourcesClientDeleteCassandraTableResponse contains the response from method CassandraResourcesClient.BeginDeleteCassandraTable.

type CassandraResourcesClientDeleteCassandraViewResponse

type CassandraResourcesClientDeleteCassandraViewResponse struct {
}

CassandraResourcesClientDeleteCassandraViewResponse contains the response from method CassandraResourcesClient.BeginDeleteCassandraView.

type CassandraResourcesClientGetCassandraKeyspaceOptions

type CassandraResourcesClientGetCassandraKeyspaceOptions struct {
}

CassandraResourcesClientGetCassandraKeyspaceOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraKeyspace method.

type CassandraResourcesClientGetCassandraKeyspaceResponse

type CassandraResourcesClientGetCassandraKeyspaceResponse struct {
	// An Azure Cosmos DB Cassandra keyspace.
	CassandraKeyspaceGetResults
}

CassandraResourcesClientGetCassandraKeyspaceResponse contains the response from method CassandraResourcesClient.GetCassandraKeyspace.

type CassandraResourcesClientGetCassandraKeyspaceThroughputOptions

type CassandraResourcesClientGetCassandraKeyspaceThroughputOptions struct {
}

CassandraResourcesClientGetCassandraKeyspaceThroughputOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraKeyspaceThroughput method.

type CassandraResourcesClientGetCassandraKeyspaceThroughputResponse

type CassandraResourcesClientGetCassandraKeyspaceThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientGetCassandraKeyspaceThroughputResponse contains the response from method CassandraResourcesClient.GetCassandraKeyspaceThroughput.

type CassandraResourcesClientGetCassandraTableOptions

type CassandraResourcesClientGetCassandraTableOptions struct {
}

CassandraResourcesClientGetCassandraTableOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraTable method.

type CassandraResourcesClientGetCassandraTableResponse

type CassandraResourcesClientGetCassandraTableResponse struct {
	// An Azure Cosmos DB Cassandra table.
	CassandraTableGetResults
}

CassandraResourcesClientGetCassandraTableResponse contains the response from method CassandraResourcesClient.GetCassandraTable.

type CassandraResourcesClientGetCassandraTableThroughputOptions

type CassandraResourcesClientGetCassandraTableThroughputOptions struct {
}

CassandraResourcesClientGetCassandraTableThroughputOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraTableThroughput method.

type CassandraResourcesClientGetCassandraTableThroughputResponse

type CassandraResourcesClientGetCassandraTableThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientGetCassandraTableThroughputResponse contains the response from method CassandraResourcesClient.GetCassandraTableThroughput.

type CassandraResourcesClientGetCassandraViewOptions

type CassandraResourcesClientGetCassandraViewOptions struct {
}

CassandraResourcesClientGetCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraView method.

type CassandraResourcesClientGetCassandraViewResponse

type CassandraResourcesClientGetCassandraViewResponse struct {
	// An Azure Cosmos DB Cassandra view.
	CassandraViewGetResults
}

CassandraResourcesClientGetCassandraViewResponse contains the response from method CassandraResourcesClient.GetCassandraView.

type CassandraResourcesClientGetCassandraViewThroughputOptions

type CassandraResourcesClientGetCassandraViewThroughputOptions struct {
}

CassandraResourcesClientGetCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraViewThroughput method.

type CassandraResourcesClientGetCassandraViewThroughputResponse

type CassandraResourcesClientGetCassandraViewThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientGetCassandraViewThroughputResponse contains the response from method CassandraResourcesClient.GetCassandraViewThroughput.

type CassandraResourcesClientListCassandraKeyspacesOptions

type CassandraResourcesClientListCassandraKeyspacesOptions struct {
}

CassandraResourcesClientListCassandraKeyspacesOptions contains the optional parameters for the CassandraResourcesClient.NewListCassandraKeyspacesPager method.

type CassandraResourcesClientListCassandraKeyspacesResponse

type CassandraResourcesClientListCassandraKeyspacesResponse struct {
	// The List operation response, that contains the Cassandra keyspaces and their properties.
	CassandraKeyspaceListResult
}

CassandraResourcesClientListCassandraKeyspacesResponse contains the response from method CassandraResourcesClient.NewListCassandraKeyspacesPager.

type CassandraResourcesClientListCassandraTablesOptions

type CassandraResourcesClientListCassandraTablesOptions struct {
}

CassandraResourcesClientListCassandraTablesOptions contains the optional parameters for the CassandraResourcesClient.NewListCassandraTablesPager method.

type CassandraResourcesClientListCassandraTablesResponse

type CassandraResourcesClientListCassandraTablesResponse struct {
	// The List operation response, that contains the Cassandra tables and their properties.
	CassandraTableListResult
}

CassandraResourcesClientListCassandraTablesResponse contains the response from method CassandraResourcesClient.NewListCassandraTablesPager.

type CassandraResourcesClientListCassandraViewsOptions

type CassandraResourcesClientListCassandraViewsOptions struct {
}

CassandraResourcesClientListCassandraViewsOptions contains the optional parameters for the CassandraResourcesClient.NewListCassandraViewsPager method.

type CassandraResourcesClientListCassandraViewsResponse

type CassandraResourcesClientListCassandraViewsResponse struct {
	// The List operation response, that contains the Cassandra views and their properties.
	CassandraViewListResult
}

CassandraResourcesClientListCassandraViewsResponse contains the response from method CassandraResourcesClient.NewListCassandraViewsPager.

type CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse

type CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse contains the response from method CassandraResourcesClient.BeginMigrateCassandraKeyspaceToAutoscale.

type CassandraResourcesClientMigrateCassandraKeyspaceToManualThroughputResponse

type CassandraResourcesClientMigrateCassandraKeyspaceToManualThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientMigrateCassandraKeyspaceToManualThroughputResponse contains the response from method CassandraResourcesClient.BeginMigrateCassandraKeyspaceToManualThroughput.

type CassandraResourcesClientMigrateCassandraTableToAutoscaleResponse

type CassandraResourcesClientMigrateCassandraTableToAutoscaleResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientMigrateCassandraTableToAutoscaleResponse contains the response from method CassandraResourcesClient.BeginMigrateCassandraTableToAutoscale.

type CassandraResourcesClientMigrateCassandraTableToManualThroughputResponse

type CassandraResourcesClientMigrateCassandraTableToManualThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientMigrateCassandraTableToManualThroughputResponse contains the response from method CassandraResourcesClient.BeginMigrateCassandraTableToManualThroughput.

type CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse

type CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse contains the response from method CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale.

type CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse

type CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse contains the response from method CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput.

type CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse

type CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse contains the response from method CassandraResourcesClient.BeginUpdateCassandraKeyspaceThroughput.

type CassandraResourcesClientUpdateCassandraTableThroughputResponse

type CassandraResourcesClientUpdateCassandraTableThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientUpdateCassandraTableThroughputResponse contains the response from method CassandraResourcesClient.BeginUpdateCassandraTableThroughput.

type CassandraResourcesClientUpdateCassandraViewThroughputResponse

type CassandraResourcesClientUpdateCassandraViewThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

CassandraResourcesClientUpdateCassandraViewThroughputResponse contains the response from method CassandraResourcesClient.BeginUpdateCassandraViewThroughput.

type CassandraSchema

type CassandraSchema struct {
	// List of cluster key.
	ClusterKeys []*ClusterKey

	// List of Cassandra table columns.
	Columns []*Column

	// List of partition key.
	PartitionKeys []*CassandraPartitionKey
}

CassandraSchema - Cosmos DB Cassandra table schema

func (CassandraSchema) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraSchema.

func (*CassandraSchema) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraSchema.

type CassandraTableCreateUpdateParameters

type CassandraTableCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB Cassandra table.
	Properties *CassandraTableCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

CassandraTableCreateUpdateParameters - Parameters to create and update Cosmos DB Cassandra table.

func (CassandraTableCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraTableCreateUpdateParameters.

func (*CassandraTableCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraTableCreateUpdateParameters.

type CassandraTableCreateUpdateProperties

type CassandraTableCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a Cassandra table
	Resource *CassandraTableResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

CassandraTableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra table.

func (CassandraTableCreateUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraTableCreateUpdateProperties.

func (*CassandraTableCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraTableCreateUpdateProperties.

type CassandraTableGetProperties

type CassandraTableGetProperties struct {
	Options  *CassandraTableGetPropertiesOptions
	Resource *CassandraTableGetPropertiesResource
}

CassandraTableGetProperties - The properties of an Azure Cosmos DB Cassandra table

func (CassandraTableGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraTableGetProperties.

func (*CassandraTableGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraTableGetProperties.

type CassandraTableGetPropertiesOptions

type CassandraTableGetPropertiesOptions struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

func (CassandraTableGetPropertiesOptions) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraTableGetPropertiesOptions.

func (*CassandraTableGetPropertiesOptions) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraTableGetPropertiesOptions.

type CassandraTableGetPropertiesResource

type CassandraTableGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB Cassandra table
	ID *string

	// Analytical TTL.
	AnalyticalStorageTTL *int32

	// Time to live of the Cosmos DB Cassandra table
	DefaultTTL *int32

	// Schema of the Cosmos DB Cassandra table
	Schema *CassandraSchema

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (CassandraTableGetPropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraTableGetPropertiesResource.

func (*CassandraTableGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraTableGetPropertiesResource.

type CassandraTableGetResults

type CassandraTableGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB Cassandra table
	Properties *CassandraTableGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

CassandraTableGetResults - An Azure Cosmos DB Cassandra table.

func (CassandraTableGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraTableGetResults.

func (*CassandraTableGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraTableGetResults.

type CassandraTableListResult

type CassandraTableListResult struct {
	// READ-ONLY; List of Cassandra tables and their properties.
	Value []*CassandraTableGetResults
}

CassandraTableListResult - The List operation response, that contains the Cassandra tables and their properties.

func (CassandraTableListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraTableListResult.

func (*CassandraTableListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraTableListResult.

type CassandraTableResource

type CassandraTableResource struct {
	// REQUIRED; Name of the Cosmos DB Cassandra table
	ID *string

	// Analytical TTL.
	AnalyticalStorageTTL *int32

	// Time to live of the Cosmos DB Cassandra table
	DefaultTTL *int32

	// Schema of the Cosmos DB Cassandra table
	Schema *CassandraSchema
}

CassandraTableResource - Cosmos DB Cassandra table resource object

func (CassandraTableResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraTableResource.

func (*CassandraTableResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraTableResource.

type CassandraViewCreateUpdateParameters

type CassandraViewCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB Cassandra view.
	Properties *CassandraViewCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

CassandraViewCreateUpdateParameters - Parameters to create and update Cosmos DB Cassandra view.

func (CassandraViewCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraViewCreateUpdateParameters.

func (*CassandraViewCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewCreateUpdateParameters.

type CassandraViewCreateUpdateProperties

type CassandraViewCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a Cassandra view
	Resource *CassandraViewResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

CassandraViewCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra view.

func (CassandraViewCreateUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraViewCreateUpdateProperties.

func (*CassandraViewCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewCreateUpdateProperties.

type CassandraViewGetProperties

type CassandraViewGetProperties struct {
	Options  *CassandraViewGetPropertiesOptions
	Resource *CassandraViewGetPropertiesResource
}

CassandraViewGetProperties - The properties of an Azure Cosmos DB Cassandra view

func (CassandraViewGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraViewGetProperties.

func (*CassandraViewGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewGetProperties.

type CassandraViewGetPropertiesOptions

type CassandraViewGetPropertiesOptions struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

func (CassandraViewGetPropertiesOptions) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraViewGetPropertiesOptions.

func (*CassandraViewGetPropertiesOptions) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewGetPropertiesOptions.

type CassandraViewGetPropertiesResource

type CassandraViewGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB Cassandra view
	ID *string

	// REQUIRED; View Definition of the Cosmos DB Cassandra view
	ViewDefinition *string

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (CassandraViewGetPropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraViewGetPropertiesResource.

func (*CassandraViewGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewGetPropertiesResource.

type CassandraViewGetResults

type CassandraViewGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB Cassandra view
	Properties *CassandraViewGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

CassandraViewGetResults - An Azure Cosmos DB Cassandra view.

func (CassandraViewGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraViewGetResults.

func (*CassandraViewGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewGetResults.

type CassandraViewListResult

type CassandraViewListResult struct {
	// READ-ONLY; List of Cassandra views and their properties.
	Value []*CassandraViewGetResults
}

CassandraViewListResult - The List operation response, that contains the Cassandra views and their properties.

func (CassandraViewListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraViewListResult.

func (*CassandraViewListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewListResult.

type CassandraViewResource

type CassandraViewResource struct {
	// REQUIRED; Name of the Cosmos DB Cassandra view
	ID *string

	// REQUIRED; View Definition of the Cosmos DB Cassandra view
	ViewDefinition *string
}

CassandraViewResource - Cosmos DB Cassandra view resource object

func (CassandraViewResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CassandraViewResource.

func (*CassandraViewResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewResource.

type Certificate

type Certificate struct {
	// PEM formatted public key.
	Pem *string
}

func (Certificate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Certificate.

func (*Certificate) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Certificate.

type CheckNameAvailabilityReason

type CheckNameAvailabilityReason string

CheckNameAvailabilityReason - The reason why the given name is not available.

const (
	CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists"
	CheckNameAvailabilityReasonInvalid       CheckNameAvailabilityReason = "Invalid"
)

func PossibleCheckNameAvailabilityReasonValues

func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason

PossibleCheckNameAvailabilityReasonValues returns the possible values for the CheckNameAvailabilityReason const type.

type CheckNameAvailabilityRequest

type CheckNameAvailabilityRequest struct {
	// The name of the resource for which availability needs to be checked.
	Name *string

	// The resource type.
	Type *string
}

CheckNameAvailabilityRequest - The check availability request body.

func (CheckNameAvailabilityRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest.

func (*CheckNameAvailabilityRequest) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest.

type CheckNameAvailabilityResponse

type CheckNameAvailabilityResponse struct {
	// Detailed reason why the given name is available.
	Message *string

	// Indicates if the resource name is available.
	NameAvailable *bool

	// The reason why the given name is not available.
	Reason *CheckNameAvailabilityReason
}

CheckNameAvailabilityResponse - The check availability result.

func (CheckNameAvailabilityResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse.

func (*CheckNameAvailabilityResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse.

type ClientEncryptionIncludedPath

type ClientEncryptionIncludedPath struct {
	// REQUIRED; The identifier of the Client Encryption Key to be used to encrypt the path.
	ClientEncryptionKeyID *string

	// REQUIRED; The encryption algorithm which will be used. Eg - AEADAES256CBCHMAC_SHA256.
	EncryptionAlgorithm *string

	// REQUIRED; The type of encryption to be performed. Eg - Deterministic, Randomized.
	EncryptionType *string

	// REQUIRED; Path that needs to be encrypted.
	Path *string
}

ClientEncryptionIncludedPath - .

func (ClientEncryptionIncludedPath) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ClientEncryptionIncludedPath.

func (*ClientEncryptionIncludedPath) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionIncludedPath.

type ClientEncryptionKeyCreateUpdateParameters

type ClientEncryptionKeyCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update ClientEncryptionKey.
	Properties *ClientEncryptionKeyCreateUpdateProperties
}

ClientEncryptionKeyCreateUpdateParameters - Parameters to create and update ClientEncryptionKey.

func (ClientEncryptionKeyCreateUpdateParameters) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyCreateUpdateParameters.

func (*ClientEncryptionKeyCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyCreateUpdateParameters.

type ClientEncryptionKeyCreateUpdateProperties

type ClientEncryptionKeyCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a ClientEncryptionKey
	Resource *ClientEncryptionKeyResource
}

ClientEncryptionKeyCreateUpdateProperties - Properties to create and update ClientEncryptionKey.

func (ClientEncryptionKeyCreateUpdateProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyCreateUpdateProperties.

func (*ClientEncryptionKeyCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyCreateUpdateProperties.

type ClientEncryptionKeyGetProperties

type ClientEncryptionKeyGetProperties struct {
	Resource *ClientEncryptionKeyGetPropertiesResource
}

ClientEncryptionKeyGetProperties - The properties of a ClientEncryptionKey resource

func (ClientEncryptionKeyGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyGetProperties.

func (*ClientEncryptionKeyGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyGetProperties.

type ClientEncryptionKeyGetPropertiesResource

type ClientEncryptionKeyGetPropertiesResource struct {
	// Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data.
	EncryptionAlgorithm *string

	// Name of the ClientEncryptionKey
	ID *string

	// Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key.
	KeyWrapMetadata *KeyWrapMetadata

	// Wrapped (encrypted) form of the key represented as a byte array.
	WrappedDataEncryptionKey []byte

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (ClientEncryptionKeyGetPropertiesResource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyGetPropertiesResource.

func (*ClientEncryptionKeyGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyGetPropertiesResource.

type ClientEncryptionKeyGetResults

type ClientEncryptionKeyGetResults struct {
	// The properties of a ClientEncryptionKey
	Properties *ClientEncryptionKeyGetProperties

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

ClientEncryptionKeyGetResults - Client Encryption Key.

func (ClientEncryptionKeyGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyGetResults.

func (*ClientEncryptionKeyGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyGetResults.

type ClientEncryptionKeyResource

type ClientEncryptionKeyResource struct {
	// Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data.
	EncryptionAlgorithm *string

	// Name of the ClientEncryptionKey
	ID *string

	// Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key.
	KeyWrapMetadata *KeyWrapMetadata

	// Wrapped (encrypted) form of the key represented as a byte array.
	WrappedDataEncryptionKey []byte
}

ClientEncryptionKeyResource - Cosmos DB client encryption key resource object.

func (ClientEncryptionKeyResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyResource.

func (*ClientEncryptionKeyResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyResource.

type ClientEncryptionKeysListResult

type ClientEncryptionKeysListResult struct {
	// READ-ONLY; List of client encryption keys and their properties.
	Value []*ClientEncryptionKeyGetResults
}

ClientEncryptionKeysListResult - The List operation response, that contains the client encryption keys and their properties.

func (ClientEncryptionKeysListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeysListResult.

func (*ClientEncryptionKeysListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeysListResult.

type ClientEncryptionPolicy

type ClientEncryptionPolicy struct {
	// REQUIRED; Paths of the item that need encryption along with path-specific settings.
	IncludedPaths []*ClientEncryptionIncludedPath

	// REQUIRED; Version of the client encryption policy definition. Supported versions are 1 and 2. Version 2 supports id and
	// partition key path encryption.
	PolicyFormatVersion *int32
}

ClientEncryptionPolicy - Cosmos DB client encryption policy.

func (ClientEncryptionPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ClientEncryptionPolicy.

func (*ClientEncryptionPolicy) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionPolicy.

type ClientFactory

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

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

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

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

func (*ClientFactory) NewCassandraClustersClient

func (c *ClientFactory) NewCassandraClustersClient() *CassandraClustersClient

NewCassandraClustersClient creates a new instance of CassandraClustersClient.

func (*ClientFactory) NewCassandraDataCentersClient

func (c *ClientFactory) NewCassandraDataCentersClient() *CassandraDataCentersClient

NewCassandraDataCentersClient creates a new instance of CassandraDataCentersClient.

func (*ClientFactory) NewCassandraResourcesClient

func (c *ClientFactory) NewCassandraResourcesClient() *CassandraResourcesClient

NewCassandraResourcesClient creates a new instance of CassandraResourcesClient.

func (*ClientFactory) NewCollectionClient

func (c *ClientFactory) NewCollectionClient() *CollectionClient

NewCollectionClient creates a new instance of CollectionClient.

func (*ClientFactory) NewCollectionPartitionClient

func (c *ClientFactory) NewCollectionPartitionClient() *CollectionPartitionClient

NewCollectionPartitionClient creates a new instance of CollectionPartitionClient.

func (*ClientFactory) NewCollectionPartitionRegionClient

func (c *ClientFactory) NewCollectionPartitionRegionClient() *CollectionPartitionRegionClient

NewCollectionPartitionRegionClient creates a new instance of CollectionPartitionRegionClient.

func (*ClientFactory) NewCollectionRegionClient

func (c *ClientFactory) NewCollectionRegionClient() *CollectionRegionClient

NewCollectionRegionClient creates a new instance of CollectionRegionClient.

func (*ClientFactory) NewDataTransferJobsClient

func (c *ClientFactory) NewDataTransferJobsClient() *DataTransferJobsClient

NewDataTransferJobsClient creates a new instance of DataTransferJobsClient.

func (*ClientFactory) NewDatabaseAccountRegionClient

func (c *ClientFactory) NewDatabaseAccountRegionClient() *DatabaseAccountRegionClient

NewDatabaseAccountRegionClient creates a new instance of DatabaseAccountRegionClient.

func (*ClientFactory) NewDatabaseAccountsClient

func (c *ClientFactory) NewDatabaseAccountsClient() *DatabaseAccountsClient

NewDatabaseAccountsClient creates a new instance of DatabaseAccountsClient.

func (*ClientFactory) NewDatabaseClient

func (c *ClientFactory) NewDatabaseClient() *DatabaseClient

NewDatabaseClient creates a new instance of DatabaseClient.

func (*ClientFactory) NewGraphResourcesClient

func (c *ClientFactory) NewGraphResourcesClient() *GraphResourcesClient

NewGraphResourcesClient creates a new instance of GraphResourcesClient.

func (*ClientFactory) NewGremlinResourcesClient

func (c *ClientFactory) NewGremlinResourcesClient() *GremlinResourcesClient

NewGremlinResourcesClient creates a new instance of GremlinResourcesClient.

func (*ClientFactory) NewLocationsClient

func (c *ClientFactory) NewLocationsClient() *LocationsClient

NewLocationsClient creates a new instance of LocationsClient.

func (*ClientFactory) NewMongoClustersClient

func (c *ClientFactory) NewMongoClustersClient() *MongoClustersClient

NewMongoClustersClient creates a new instance of MongoClustersClient.

func (*ClientFactory) NewMongoDBResourcesClient

func (c *ClientFactory) NewMongoDBResourcesClient() *MongoDBResourcesClient

NewMongoDBResourcesClient creates a new instance of MongoDBResourcesClient.

func (*ClientFactory) NewNotebookWorkspacesClient

func (c *ClientFactory) NewNotebookWorkspacesClient() *NotebookWorkspacesClient

NewNotebookWorkspacesClient creates a new instance of NotebookWorkspacesClient.

func (*ClientFactory) NewOperationsClient

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPartitionKeyRangeIDClient

func (c *ClientFactory) NewPartitionKeyRangeIDClient() *PartitionKeyRangeIDClient

NewPartitionKeyRangeIDClient creates a new instance of PartitionKeyRangeIDClient.

func (*ClientFactory) NewPartitionKeyRangeIDRegionClient

func (c *ClientFactory) NewPartitionKeyRangeIDRegionClient() *PartitionKeyRangeIDRegionClient

NewPartitionKeyRangeIDRegionClient creates a new instance of PartitionKeyRangeIDRegionClient.

func (*ClientFactory) NewPercentileClient

func (c *ClientFactory) NewPercentileClient() *PercentileClient

NewPercentileClient creates a new instance of PercentileClient.

func (*ClientFactory) NewPercentileSourceTargetClient

func (c *ClientFactory) NewPercentileSourceTargetClient() *PercentileSourceTargetClient

NewPercentileSourceTargetClient creates a new instance of PercentileSourceTargetClient.

func (*ClientFactory) NewPercentileTargetClient

func (c *ClientFactory) NewPercentileTargetClient() *PercentileTargetClient

NewPercentileTargetClient creates a new instance of PercentileTargetClient.

func (*ClientFactory) NewPrivateEndpointConnectionsClient

func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient.

func (*ClientFactory) NewPrivateLinkResourcesClient

func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient

NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient.

func (*ClientFactory) NewRestorableDatabaseAccountsClient

func (c *ClientFactory) NewRestorableDatabaseAccountsClient() *RestorableDatabaseAccountsClient

NewRestorableDatabaseAccountsClient creates a new instance of RestorableDatabaseAccountsClient.

func (*ClientFactory) NewRestorableGremlinDatabasesClient

func (c *ClientFactory) NewRestorableGremlinDatabasesClient() *RestorableGremlinDatabasesClient

NewRestorableGremlinDatabasesClient creates a new instance of RestorableGremlinDatabasesClient.

func (*ClientFactory) NewRestorableGremlinGraphsClient

func (c *ClientFactory) NewRestorableGremlinGraphsClient() *RestorableGremlinGraphsClient

NewRestorableGremlinGraphsClient creates a new instance of RestorableGremlinGraphsClient.

func (*ClientFactory) NewRestorableGremlinResourcesClient

func (c *ClientFactory) NewRestorableGremlinResourcesClient() *RestorableGremlinResourcesClient

NewRestorableGremlinResourcesClient creates a new instance of RestorableGremlinResourcesClient.

func (*ClientFactory) NewRestorableMongodbCollectionsClient

func (c *ClientFactory) NewRestorableMongodbCollectionsClient() *RestorableMongodbCollectionsClient

NewRestorableMongodbCollectionsClient creates a new instance of RestorableMongodbCollectionsClient.

func (*ClientFactory) NewRestorableMongodbDatabasesClient

func (c *ClientFactory) NewRestorableMongodbDatabasesClient() *RestorableMongodbDatabasesClient

NewRestorableMongodbDatabasesClient creates a new instance of RestorableMongodbDatabasesClient.

func (*ClientFactory) NewRestorableMongodbResourcesClient

func (c *ClientFactory) NewRestorableMongodbResourcesClient() *RestorableMongodbResourcesClient

NewRestorableMongodbResourcesClient creates a new instance of RestorableMongodbResourcesClient.

func (*ClientFactory) NewRestorableSQLContainersClient

func (c *ClientFactory) NewRestorableSQLContainersClient() *RestorableSQLContainersClient

NewRestorableSQLContainersClient creates a new instance of RestorableSQLContainersClient.

func (*ClientFactory) NewRestorableSQLDatabasesClient

func (c *ClientFactory) NewRestorableSQLDatabasesClient() *RestorableSQLDatabasesClient

NewRestorableSQLDatabasesClient creates a new instance of RestorableSQLDatabasesClient.

func (*ClientFactory) NewRestorableSQLResourcesClient

func (c *ClientFactory) NewRestorableSQLResourcesClient() *RestorableSQLResourcesClient

NewRestorableSQLResourcesClient creates a new instance of RestorableSQLResourcesClient.

func (*ClientFactory) NewRestorableTableResourcesClient

func (c *ClientFactory) NewRestorableTableResourcesClient() *RestorableTableResourcesClient

NewRestorableTableResourcesClient creates a new instance of RestorableTableResourcesClient.

func (*ClientFactory) NewRestorableTablesClient

func (c *ClientFactory) NewRestorableTablesClient() *RestorableTablesClient

NewRestorableTablesClient creates a new instance of RestorableTablesClient.

func (*ClientFactory) NewSQLResourcesClient

func (c *ClientFactory) NewSQLResourcesClient() *SQLResourcesClient

NewSQLResourcesClient creates a new instance of SQLResourcesClient.

func (*ClientFactory) NewServiceClient

func (c *ClientFactory) NewServiceClient() *ServiceClient

NewServiceClient creates a new instance of ServiceClient.

func (*ClientFactory) NewTableResourcesClient

func (c *ClientFactory) NewTableResourcesClient() *TableResourcesClient

NewTableResourcesClient creates a new instance of TableResourcesClient.

func (*ClientFactory) NewThroughputPoolAccountClient

func (c *ClientFactory) NewThroughputPoolAccountClient() *ThroughputPoolAccountClient

NewThroughputPoolAccountClient creates a new instance of ThroughputPoolAccountClient.

func (*ClientFactory) NewThroughputPoolAccountsClient

func (c *ClientFactory) NewThroughputPoolAccountsClient() *ThroughputPoolAccountsClient

NewThroughputPoolAccountsClient creates a new instance of ThroughputPoolAccountsClient.

func (*ClientFactory) NewThroughputPoolClient

func (c *ClientFactory) NewThroughputPoolClient() *ThroughputPoolClient

NewThroughputPoolClient creates a new instance of ThroughputPoolClient.

func (*ClientFactory) NewThroughputPoolsClient

func (c *ClientFactory) NewThroughputPoolsClient() *ThroughputPoolsClient

NewThroughputPoolsClient creates a new instance of ThroughputPoolsClient.

type ClusterKey

type ClusterKey struct {
	// Name of the Cosmos DB Cassandra table cluster key
	Name *string

	// Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc"
	OrderBy *string
}

ClusterKey - Cosmos DB Cassandra table cluster key

func (ClusterKey) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ClusterKey.

func (*ClusterKey) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClusterKey.

type ClusterResource

type ClusterResource struct {
	// Identity for the resource.
	Identity *ManagedCassandraManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Properties of a managed Cassandra cluster.
	Properties *ClusterResourceProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

ClusterResource - Representation of a managed Cassandra cluster.

func (ClusterResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ClusterResource.

func (*ClusterResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResource.

type ClusterResourceProperties

type ClusterResourceProperties struct {
	// Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not
	// be used except in emergencies. 'Cassandra' is the default password based
	// authentication. The default is 'Cassandra'.
	AuthenticationMethod *AuthenticationMethod

	// The form of AutoReplicate that is being used by this cluster.
	AutoReplicate *AutoReplicate

	// How to connect to the azure services needed for running the cluster
	AzureConnectionMethod *AzureConnectionType

	// List of backup schedules that define when you want to back up your data.
	BackupSchedules []*BackupSchedule

	// Whether Cassandra audit logging is enabled
	CassandraAuditLoggingEnabled *bool

	// Which version of Cassandra should this cluster converge to running (e.g., 3.11). When updated, the cluster may take some
	// time to migrate to the new version.
	CassandraVersion *string

	// List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether
	// clientCertificates is set or not, but if clientCertificates is set, the managed
	// Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more
	// of the public certificates in this property.
	ClientCertificates []*Certificate

	// If you need to set the clusterName property in cassandra.yaml to something besides the resource name of the cluster, set
	// the value to use on this property.
	ClusterNameOverride *string

	// Type of the cluster. If set to Production, some operations might not be permitted on cluster.
	ClusterType *ClusterType

	// Whether the cluster and associated data centers has been deallocated.
	Deallocated *bool

	// Resource id of a subnet that this cluster's management service should have its network interface attached to. The subnet
	// must be routable to all subnets that will be delegated to data centers. The
	// resource id must be of the form '/subscriptions//resourceGroups//providers/Microsoft.Network/virtualNetworks//subnets/'
	DelegatedManagementSubnetID *string

	// Extensions to be added or updated on cluster.
	Extensions []*string

	// List of the data center names for unmanaged data centers in this cluster to be included in auto-replication.
	ExternalDataCenters []*string

	// List of TLS certificates used to authorize gossip from unmanaged data centers. The TLS certificates of all nodes in unmanaged
	// data centers must be verifiable using one of the certificates provided in
	// this property.
	ExternalGossipCertificates []*Certificate

	// List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed
	// nodes.
	ExternalSeedNodes []*SeedNode

	// (Deprecated) Number of hours to wait between taking a backup of the cluster.
	HoursBetweenBackups *int32

	// Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null
	// on GET. This field only applies when the authenticationMethod field is
	// 'Cassandra'.
	InitialCassandraAdminPassword *string

	// Hostname or IP address where the Prometheus endpoint containing data about the managed Cassandra nodes can be reached.
	PrometheusEndpoint *SeedNode

	// Error related to resource provisioning.
	ProvisionError *CassandraError

	// The status of the resource at the time the operation was called.
	ProvisioningState *ManagedCassandraProvisioningState

	// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid
	// cluster where you are already doing your own repairs.
	RepairEnabled *bool

	// To create an empty cluster, omit this field or set it to null. To restore a backup into a new cluster, set this field to
	// the resource id of the backup.
	RestoreFromBackupID *string

	// How the nodes in the cluster react to scheduled events
	ScheduledEventStrategy *ScheduledEventStrategy

	// READ-ONLY; List of TLS certificates that unmanaged nodes must trust for gossip with managed nodes. All managed nodes will
	// present TLS client certificates that are verifiable using one of the certificates
	// provided in this property.
	GossipCertificates []*Certificate

	// READ-ONLY; If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect
	// to.
	PrivateLinkResourceID *string

	// READ-ONLY; List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists
	// of all unmanaged nodes.
	SeedNodes []*SeedNode
}

ClusterResourceProperties - Properties of a managed Cassandra cluster.

func (ClusterResourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ClusterResourceProperties.

func (*ClusterResourceProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResourceProperties.

type ClusterType

type ClusterType string

ClusterType - Type of the cluster. If set to Production, some operations might not be permitted on cluster.

const (
	ClusterTypeNonProduction ClusterType = "NonProduction"
	ClusterTypeProduction    ClusterType = "Production"
)

func PossibleClusterTypeValues

func PossibleClusterTypeValues() []ClusterType

PossibleClusterTypeValues returns the possible values for the ClusterType const type.

type CollectionClient

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

CollectionClient contains the methods for the Collection group. Don't use this type directly, use NewCollectionClient() instead.

func NewCollectionClient

func NewCollectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CollectionClient, error)

NewCollectionClient creates a new instance of CollectionClient with the specified values.

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

func (*CollectionClient) NewListMetricDefinitionsPager

func (client *CollectionClient) NewListMetricDefinitionsPager(resourceGroupName string, accountName string, databaseRid string, collectionRid string, options *CollectionClientListMetricDefinitionsOptions) *runtime.Pager[CollectionClientListMetricDefinitionsResponse]

NewListMetricDefinitionsPager - Retrieves metric definitions for the given collection.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseRid - Cosmos DB database rid.
  • collectionRid - Cosmos DB collection rid.
  • options - CollectionClientListMetricDefinitionsOptions contains the optional parameters for the CollectionClient.NewListMetricDefinitionsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionGetMetricDefinitions.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCollectionClient().NewListMetricDefinitionsPager("rg1", "ddb1", "databaseRid", "collectionRid", 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.MetricDefinitionsListResult = armcosmos.MetricDefinitionsListResult{
	// 	Value: []*armcosmos.MetricDefinition{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Total Requests"),
	// 				Value: to.Ptr("Total Requests"),
	// 			},
	// 			MetricAvailabilities: []*armcosmos.MetricAvailability{
	// 				{
	// 					Retention: to.Ptr("P2D"),
	// 					TimeGrain: to.Ptr("PT5M"),
	// 				},
	// 				{
	// 					Retention: to.Ptr("P14D"),
	// 					TimeGrain: to.Ptr("PT1H"),
	// 				},
	// 				{
	// 					Retention: to.Ptr("P60D"),
	// 					TimeGrain: to.Ptr("P1D"),
	// 			}},
	// 			PrimaryAggregationType: to.Ptr(armcosmos.PrimaryAggregationTypeTotal),
	// 			ResourceURI: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 	}},
	// }
}
Output:

func (*CollectionClient) NewListMetricsPager

func (client *CollectionClient) NewListMetricsPager(resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string, options *CollectionClientListMetricsOptions) *runtime.Pager[CollectionClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and collection.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseRid - Cosmos DB database rid.
  • collectionRid - Cosmos DB collection rid.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - CollectionClientListMetricsOptions contains the optional parameters for the CollectionClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCollectionClient().NewListMetricsPager("rg1", "ddb1", "databaseRid", "collectionRid", "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", 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.MetricListResult = armcosmos.MetricListResult{
	// 	Value: []*armcosmos.Metric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Total Requests"),
	// 				Value: to.Ptr("Total Requests"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.MetricValue{
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:03:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:08:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT5M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 	}},
	// }
}
Output:

func (*CollectionClient) NewListUsagesPager

func (client *CollectionClient) NewListUsagesPager(resourceGroupName string, accountName string, databaseRid string, collectionRid string, options *CollectionClientListUsagesOptions) *runtime.Pager[CollectionClientListUsagesResponse]

NewListUsagesPager - Retrieves the usages (most recent storage data) for the given collection.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseRid - Cosmos DB database rid.
  • collectionRid - Cosmos DB collection rid.
  • options - CollectionClientListUsagesOptions contains the optional parameters for the CollectionClient.NewListUsagesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionGetUsages.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCollectionClient().NewListUsagesPager("rg1", "ddb1", "databaseRid", "collectionRid", &armcosmos.CollectionClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Storage'")})
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.UsagesResult = armcosmos.UsagesResult{
	// 	Value: []*armcosmos.Usage{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Storage"),
	// 				Value: to.Ptr("Storage"),
	// 			},
	// 			CurrentValue: to.Ptr[int64](0),
	// 			Limit: to.Ptr[int64](10737418240),
	// 			QuotaPeriod: to.Ptr("P1D"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeBytes),
	// 	}},
	// }
}
Output:

type CollectionClientListMetricDefinitionsOptions

type CollectionClientListMetricDefinitionsOptions struct {
}

CollectionClientListMetricDefinitionsOptions contains the optional parameters for the CollectionClient.NewListMetricDefinitionsPager method.

type CollectionClientListMetricDefinitionsResponse

type CollectionClientListMetricDefinitionsResponse struct {
	// The response to a list metric definitions request.
	MetricDefinitionsListResult
}

CollectionClientListMetricDefinitionsResponse contains the response from method CollectionClient.NewListMetricDefinitionsPager.

type CollectionClientListMetricsOptions

type CollectionClientListMetricsOptions struct {
}

CollectionClientListMetricsOptions contains the optional parameters for the CollectionClient.NewListMetricsPager method.

type CollectionClientListMetricsResponse

type CollectionClientListMetricsResponse struct {
	// The response to a list metrics request.
	MetricListResult
}

CollectionClientListMetricsResponse contains the response from method CollectionClient.NewListMetricsPager.

type CollectionClientListUsagesOptions

type CollectionClientListUsagesOptions struct {
	// An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of
	// the metric, can have an or of multiple names).
	Filter *string
}

CollectionClientListUsagesOptions contains the optional parameters for the CollectionClient.NewListUsagesPager method.

type CollectionClientListUsagesResponse

type CollectionClientListUsagesResponse struct {
	// The response to a list usage request.
	UsagesResult
}

CollectionClientListUsagesResponse contains the response from method CollectionClient.NewListUsagesPager.

type CollectionPartitionClient

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

CollectionPartitionClient contains the methods for the CollectionPartition group. Don't use this type directly, use NewCollectionPartitionClient() instead.

func NewCollectionPartitionClient

func NewCollectionPartitionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CollectionPartitionClient, error)

NewCollectionPartitionClient creates a new instance of CollectionPartitionClient with the specified values.

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

func (*CollectionPartitionClient) NewListMetricsPager

func (client *CollectionPartitionClient) NewListMetricsPager(resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string, options *CollectionPartitionClientListMetricsOptions) *runtime.Pager[CollectionPartitionClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given collection, split by partition.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseRid - Cosmos DB database rid.
  • collectionRid - Cosmos DB collection rid.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - CollectionPartitionClientListMetricsOptions contains the optional parameters for the CollectionPartitionClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionPartitionGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCollectionPartitionClient().NewListMetricsPager("rg1", "ddb1", "databaseRid", "collectionRid", "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", 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.PartitionMetricListResult = armcosmos.PartitionMetricListResult{
	// 	Value: []*armcosmos.PartitionMetric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Max RUs Per Second"),
	// 				Value: to.Ptr("Max RUs Per Second"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T23:58:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.MetricValue{
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:54:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:55:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:56:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:57:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT1M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 			PartitionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			PartitionKeyRangeID: to.Ptr("0"),
	// 	}},
	// }
}
Output:

func (*CollectionPartitionClient) NewListUsagesPager

func (client *CollectionPartitionClient) NewListUsagesPager(resourceGroupName string, accountName string, databaseRid string, collectionRid string, options *CollectionPartitionClientListUsagesOptions) *runtime.Pager[CollectionPartitionClientListUsagesResponse]

NewListUsagesPager - Retrieves the usages (most recent storage data) for the given collection, split by partition.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseRid - Cosmos DB database rid.
  • collectionRid - Cosmos DB collection rid.
  • options - CollectionPartitionClientListUsagesOptions contains the optional parameters for the CollectionPartitionClient.NewListUsagesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionPartitionGetUsages.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCollectionPartitionClient().NewListUsagesPager("rg1", "ddb1", "databaseRid", "collectionRid", &armcosmos.CollectionPartitionClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Partition Storage'")})
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.PartitionUsagesResult = armcosmos.PartitionUsagesResult{
	// 	Value: []*armcosmos.PartitionUsage{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Storage"),
	// 				Value: to.Ptr("Storage"),
	// 			},
	// 			CurrentValue: to.Ptr[int64](0),
	// 			Limit: to.Ptr[int64](10737418240),
	// 			QuotaPeriod: to.Ptr("P1D"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeBytes),
	// 			PartitionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			PartitionKeyRangeID: to.Ptr("0"),
	// 	}},
	// }
}
Output:

type CollectionPartitionClientListMetricsOptions

type CollectionPartitionClientListMetricsOptions struct {
}

CollectionPartitionClientListMetricsOptions contains the optional parameters for the CollectionPartitionClient.NewListMetricsPager method.

type CollectionPartitionClientListMetricsResponse

type CollectionPartitionClientListMetricsResponse struct {
	// The response to a list partition metrics request.
	PartitionMetricListResult
}

CollectionPartitionClientListMetricsResponse contains the response from method CollectionPartitionClient.NewListMetricsPager.

type CollectionPartitionClientListUsagesOptions

type CollectionPartitionClientListUsagesOptions struct {
	// An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of
	// the metric, can have an or of multiple names).
	Filter *string
}

CollectionPartitionClientListUsagesOptions contains the optional parameters for the CollectionPartitionClient.NewListUsagesPager method.

type CollectionPartitionClientListUsagesResponse

type CollectionPartitionClientListUsagesResponse struct {
	// The response to a list partition level usage request.
	PartitionUsagesResult
}

CollectionPartitionClientListUsagesResponse contains the response from method CollectionPartitionClient.NewListUsagesPager.

type CollectionPartitionRegionClient

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

CollectionPartitionRegionClient contains the methods for the CollectionPartitionRegion group. Don't use this type directly, use NewCollectionPartitionRegionClient() instead.

func NewCollectionPartitionRegionClient

func NewCollectionPartitionRegionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CollectionPartitionRegionClient, error)

NewCollectionPartitionRegionClient creates a new instance of CollectionPartitionRegionClient with the specified values.

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

func (*CollectionPartitionRegionClient) NewListMetricsPager

func (client *CollectionPartitionRegionClient) NewListMetricsPager(resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string, options *CollectionPartitionRegionClientListMetricsOptions) *runtime.Pager[CollectionPartitionRegionClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given collection and region, split by partition.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • region - Cosmos DB region, with spaces between words and each word capitalized.
  • databaseRid - Cosmos DB database rid.
  • collectionRid - Cosmos DB collection rid.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - CollectionPartitionRegionClientListMetricsOptions contains the optional parameters for the CollectionPartitionRegionClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCollectionPartitionRegionClient().NewListMetricsPager("rg1", "ddb1", "North Europe", "databaseRid", "collectionRid", "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", 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.PartitionMetricListResult = armcosmos.PartitionMetricListResult{
	// 	Value: []*armcosmos.PartitionMetric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Max RUs Per Second"),
	// 				Value: to.Ptr("Max RUs Per Second"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T23:58:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.MetricValue{
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:54:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:55:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:56:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:57:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT1M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 			PartitionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			PartitionKeyRangeID: to.Ptr("0"),
	// 	}},
	// }
}
Output:

type CollectionPartitionRegionClientListMetricsOptions

type CollectionPartitionRegionClientListMetricsOptions struct {
}

CollectionPartitionRegionClientListMetricsOptions contains the optional parameters for the CollectionPartitionRegionClient.NewListMetricsPager method.

type CollectionPartitionRegionClientListMetricsResponse

type CollectionPartitionRegionClientListMetricsResponse struct {
	// The response to a list partition metrics request.
	PartitionMetricListResult
}

CollectionPartitionRegionClientListMetricsResponse contains the response from method CollectionPartitionRegionClient.NewListMetricsPager.

type CollectionRegionClient

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

CollectionRegionClient contains the methods for the CollectionRegion group. Don't use this type directly, use NewCollectionRegionClient() instead.

func NewCollectionRegionClient

func NewCollectionRegionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CollectionRegionClient, error)

NewCollectionRegionClient creates a new instance of CollectionRegionClient with the specified values.

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

func (*CollectionRegionClient) NewListMetricsPager

func (client *CollectionRegionClient) NewListMetricsPager(resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string, options *CollectionRegionClientListMetricsOptions) *runtime.Pager[CollectionRegionClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account, collection and region.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • region - Cosmos DB region, with spaces between words and each word capitalized.
  • databaseRid - Cosmos DB database rid.
  • collectionRid - Cosmos DB collection rid.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - CollectionRegionClientListMetricsOptions contains the optional parameters for the CollectionRegionClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRegionCollectionGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCollectionRegionClient().NewListMetricsPager("rg1", "ddb1", "North Europe", "databaseRid", "collectionRid", "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", 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.MetricListResult = armcosmos.MetricListResult{
	// 	Value: []*armcosmos.Metric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Total Requests"),
	// 				Value: to.Ptr("Total Requests"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.MetricValue{
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:03:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:08:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT5M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 	}},
	// }
}
Output:

type CollectionRegionClientListMetricsOptions

type CollectionRegionClientListMetricsOptions struct {
}

CollectionRegionClientListMetricsOptions contains the optional parameters for the CollectionRegionClient.NewListMetricsPager method.

type CollectionRegionClientListMetricsResponse

type CollectionRegionClientListMetricsResponse struct {
	// The response to a list metrics request.
	MetricListResult
}

CollectionRegionClientListMetricsResponse contains the response from method CollectionRegionClient.NewListMetricsPager.

type Column

type Column struct {
	// Name of the Cosmos DB Cassandra table column
	Name *string

	// Type of the Cosmos DB Cassandra table column
	Type *string
}

Column - Cosmos DB Cassandra table column

func (Column) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Column.

func (*Column) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Column.

type CommandOutput

type CommandOutput struct {
	// Output of the command.
	CommandOutput *string
}

CommandOutput - Response of /command api

func (CommandOutput) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CommandOutput.

func (*CommandOutput) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CommandOutput.

type CommandPostBody

type CommandPostBody struct {
	// REQUIRED; The command which should be run
	Command *string

	// REQUIRED; IP address of the cassandra host to run the command on
	Host *string

	// The arguments for the command to be run
	Arguments any

	// If true, stops cassandra before executing the command and then start it again
	CassandraStopStart *bool

	// If true, allows the command to write to the cassandra directory, otherwise read-only.
	ReadWrite *bool
}

CommandPostBody - Specification of which command to run where

func (CommandPostBody) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CommandPostBody.

func (*CommandPostBody) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CommandPostBody.

type CommandPublicResource

type CommandPublicResource struct {
	// The arguments for the command to be run
	Arguments any

	// If true, stops cassandra before executing the command and then start it again
	CassandraStopStart *bool

	// The command which should be run
	Command *string

	// The unique id of command
	CommandID *string

	// IP address of the cassandra host to run the command on
	Host *string

	// Whether command has admin privileges
	IsAdmin *bool

	// The name of the file where the result is written.
	OutputFile *string

	// If true, allows the command to write to the cassandra directory, otherwise read-only.
	ReadWrite *bool

	// Result output of the command.
	Result *string

	// Status of the command.
	Status *CommandStatus
}

CommandPublicResource - resource representing a command

func (CommandPublicResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CommandPublicResource.

func (*CommandPublicResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CommandPublicResource.

type CommandStatus

type CommandStatus string

CommandStatus - Status of the command.

const (
	CommandStatusDone       CommandStatus = "Done"
	CommandStatusEnqueue    CommandStatus = "Enqueue"
	CommandStatusFailed     CommandStatus = "Failed"
	CommandStatusFinished   CommandStatus = "Finished"
	CommandStatusProcessing CommandStatus = "Processing"
	CommandStatusRunning    CommandStatus = "Running"
)

func PossibleCommandStatusValues

func PossibleCommandStatusValues() []CommandStatus

PossibleCommandStatusValues returns the possible values for the CommandStatus const type.

type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties

type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties struct {
	// READ-ONLY; The client id of user assigned identity.
	ClientID *string

	// READ-ONLY; The principal id of user assigned identity.
	PrincipalID *string
}

func (Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.

func (*Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.

type ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems

type ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems struct {
	// The node's IP address.
	Address *string

	// A float representing the current system-wide CPU utilization as a percentage.
	CPUUsage *float64

	// Cassandra service status on this node
	CassandraProcessStatus *string

	// The amount of disk free, in kB, of the directory /var/lib/cassandra.
	DiskFreeKB *int64

	// The amount of disk used, in kB, of the directory /var/lib/cassandra.
	DiskUsedKB *int64

	// The network ID of the node.
	HostID *string

	// If node has been updated to latest model
	IsLatestModel *bool

	// The amount of file system data in the data directory (e.g., 47.66 kB), excluding all content in the snapshots subdirectories.
	// Because all SSTable data files are included, any data that is not cleaned
	// up (such as TTL-expired cells or tombstones) is counted.
	Load *string

	// Memory used by kernel buffers (Buffers in /proc/meminfo) and page cache and slabs (Cached and SReclaimable in /proc/meminfo),
	// in kB.
	MemoryBuffersAndCachedKB *int64

	// Unused memory (MemFree and SwapFree in /proc/meminfo), in kB.
	MemoryFreeKB *int64

	// Total installed memory (MemTotal and SwapTotal in /proc/meminfo), in kB.
	MemoryTotalKB *int64

	// Used memory (calculated as total - free - buffers - cache), in kB.
	MemoryUsedKB *int64

	// The rack this node is part of.
	Rack *string
	Size *int32

	// The state of the node in Cassandra ring.
	State  *NodeState
	Status *string

	// The timestamp when these statistics were captured.
	Timestamp *string

	// List of tokens this node covers.
	Tokens []*string
}

func (ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems.

func (*ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems.

type CompositePath

type CompositePath struct {
	// Sort order for composite paths.
	Order *CompositePathSortOrder

	// The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
	Path *string
}

func (CompositePath) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CompositePath.

func (*CompositePath) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CompositePath.

type CompositePathSortOrder

type CompositePathSortOrder string

CompositePathSortOrder - Sort order for composite paths.

const (
	CompositePathSortOrderAscending  CompositePathSortOrder = "ascending"
	CompositePathSortOrderDescending CompositePathSortOrder = "descending"
)

func PossibleCompositePathSortOrderValues

func PossibleCompositePathSortOrderValues() []CompositePathSortOrder

PossibleCompositePathSortOrderValues returns the possible values for the CompositePathSortOrder const type.

type ComputedProperty

type ComputedProperty struct {
	// The name of a computed property, for example - "cp_lowerName"
	Name *string

	// The query that evaluates the value for computed property, for example - "SELECT VALUE LOWER(c.name) FROM c"
	Query *string
}

ComputedProperty - The definition of a computed property

func (ComputedProperty) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ComputedProperty.

func (*ComputedProperty) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComputedProperty.

type ConflictResolutionMode

type ConflictResolutionMode string

ConflictResolutionMode - Indicates the conflict resolution mode.

const (
	ConflictResolutionModeCustom         ConflictResolutionMode = "Custom"
	ConflictResolutionModeLastWriterWins ConflictResolutionMode = "LastWriterWins"
)

func PossibleConflictResolutionModeValues

func PossibleConflictResolutionModeValues() []ConflictResolutionMode

PossibleConflictResolutionModeValues returns the possible values for the ConflictResolutionMode const type.

type ConflictResolutionPolicy

type ConflictResolutionPolicy struct {
	// The conflict resolution path in the case of LastWriterWins mode.
	ConflictResolutionPath *string

	// The procedure to resolve conflicts in the case of custom mode.
	ConflictResolutionProcedure *string

	// Indicates the conflict resolution mode.
	Mode *ConflictResolutionMode
}

ConflictResolutionPolicy - The conflict resolution policy for the container.

func (ConflictResolutionPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConflictResolutionPolicy.

func (*ConflictResolutionPolicy) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConflictResolutionPolicy.

type ConnectionError

type ConnectionError struct {
	// The kind of connection error that occurred.
	ConnectionState *ConnectionState

	// Detailed error message about the failed connection.
	Exception *string

	// The IP of host that originated the failed connection.
	IPFrom *string

	// The IP that the connection attempted to reach.
	IPTo *string

	// The TCP port the connection was attempted on.
	Port *int32
}

func (ConnectionError) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConnectionError.

func (*ConnectionError) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionError.

type ConnectionState

type ConnectionState string

ConnectionState - The kind of connection error that occurred.

const (
	ConnectionStateDatacenterToDatacenterNetworkError           ConnectionState = "DatacenterToDatacenterNetworkError"
	ConnectionStateInternalError                                ConnectionState = "InternalError"
	ConnectionStateInternalOperatorToDataCenterCertificateError ConnectionState = "InternalOperatorToDataCenterCertificateError"
	ConnectionStateOK                                           ConnectionState = "OK"
	ConnectionStateOperatorToDataCenterNetworkError             ConnectionState = "OperatorToDataCenterNetworkError"
	ConnectionStateUnknown                                      ConnectionState = "Unknown"
)

func PossibleConnectionStateValues

func PossibleConnectionStateValues() []ConnectionState

PossibleConnectionStateValues returns the possible values for the ConnectionState const type.

type ConnectionString

type ConnectionString struct {
	// READ-ONLY; Value of the connection string
	ConnectionString *string

	// READ-ONLY; Description of the connection string
	Description *string
}

ConnectionString - Connection string for the mongo cluster

func (ConnectionString) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConnectionString.

func (*ConnectionString) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionString.

type ConnectorOffer

type ConnectorOffer string

ConnectorOffer - The cassandra connector offer type for the Cosmos DB C* database account.

const (
	ConnectorOfferSmall ConnectorOffer = "Small"
)

func PossibleConnectorOfferValues

func PossibleConnectorOfferValues() []ConnectorOffer

PossibleConnectorOfferValues returns the possible values for the ConnectorOffer const type.

type ConsistencyPolicy

type ConsistencyPolicy struct {
	// REQUIRED; The default consistency level and configuration settings of the Cosmos DB account.
	DefaultConsistencyLevel *DefaultConsistencyLevel

	// When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds)
	// tolerated. Accepted range for this value is 5 - 86400. Required when
	// defaultConsistencyPolicy is set to 'BoundedStaleness'.
	MaxIntervalInSeconds *int32

	// When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted
	// range for this value is 1 – 2,147,483,647. Required when
	// defaultConsistencyPolicy is set to 'BoundedStaleness'.
	MaxStalenessPrefix *int64
}

ConsistencyPolicy - The consistency policy for the Cosmos DB database account.

func (ConsistencyPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConsistencyPolicy.

func (*ConsistencyPolicy) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConsistencyPolicy.

type ContainerPartitionKey

type ContainerPartitionKey struct {
	// Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are
	// supported for container create
	Kind *PartitionKind

	// List of paths using which data within the container can be partitioned
	Paths []*string

	// Indicates the version of the partition key definition
	Version *int32

	// READ-ONLY; Indicates if the container is using a system generated partition key
	SystemKey *bool
}

ContainerPartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions

func (ContainerPartitionKey) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ContainerPartitionKey.

func (*ContainerPartitionKey) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ContainerPartitionKey.

type ContinuousBackupInformation

type ContinuousBackupInformation struct {
	// The latest restorable timestamp for a resource.
	LatestRestorableTimestamp *string
}

ContinuousBackupInformation - Information about the status of continuous backups.

func (ContinuousBackupInformation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ContinuousBackupInformation.

func (*ContinuousBackupInformation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousBackupInformation.

type ContinuousBackupRestoreLocation

type ContinuousBackupRestoreLocation struct {
	// The name of the continuous backup restore location.
	Location *string
}

ContinuousBackupRestoreLocation - Properties of the regional restorable account.

func (ContinuousBackupRestoreLocation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ContinuousBackupRestoreLocation.

func (*ContinuousBackupRestoreLocation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousBackupRestoreLocation.

type ContinuousModeBackupPolicy

type ContinuousModeBackupPolicy struct {
	// REQUIRED; Describes the mode of backups.
	Type *BackupPolicyType

	// Configuration values for continuous mode backup
	ContinuousModeProperties *ContinuousModeProperties

	// The object representing the state of the migration between the backup policies.
	MigrationState *BackupPolicyMigrationState
}

ContinuousModeBackupPolicy - The object representing continuous mode backup policy.

func (*ContinuousModeBackupPolicy) GetBackupPolicy

func (c *ContinuousModeBackupPolicy) GetBackupPolicy() *BackupPolicy

GetBackupPolicy implements the BackupPolicyClassification interface for type ContinuousModeBackupPolicy.

func (ContinuousModeBackupPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ContinuousModeBackupPolicy.

func (*ContinuousModeBackupPolicy) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousModeBackupPolicy.

type ContinuousModeProperties

type ContinuousModeProperties struct {
	// Enum to indicate type of Continuos backup mode
	Tier *ContinuousTier
}

ContinuousModeProperties - Configuration values for periodic mode backup

func (ContinuousModeProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ContinuousModeProperties.

func (*ContinuousModeProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousModeProperties.

type ContinuousTier

type ContinuousTier string

ContinuousTier - Enum to indicate type of Continuous backup tier.

const (
	ContinuousTierContinuous30Days ContinuousTier = "Continuous30Days"
	ContinuousTierContinuous7Days  ContinuousTier = "Continuous7Days"
)

func PossibleContinuousTierValues

func PossibleContinuousTierValues() []ContinuousTier

PossibleContinuousTierValues returns the possible values for the ContinuousTier const type.

type CorsPolicy

type CorsPolicy struct {
	// REQUIRED; The origin domains that are permitted to make a request against the service via CORS.
	AllowedOrigins *string

	// The request headers that the origin domain may specify on the CORS request.
	AllowedHeaders *string

	// The methods (HTTP request verbs) that the origin domain may use for a CORS request.
	AllowedMethods *string

	// The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
	ExposedHeaders *string

	// The maximum amount time that a browser should cache the preflight OPTIONS request.
	MaxAgeInSeconds *int64
}

CorsPolicy - The CORS policy for the Cosmos DB database account.

func (CorsPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CorsPolicy.

func (*CorsPolicy) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CorsPolicy.

type CreateJobRequest

type CreateJobRequest struct {
	// REQUIRED; Data Transfer Create Job Properties
	Properties *DataTransferJobProperties

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

CreateJobRequest - Parameters to create Data Transfer Job

func (CreateJobRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CreateJobRequest.

func (*CreateJobRequest) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CreateJobRequest.

type CreateMode

type CreateMode string

CreateMode - Enum to indicate the mode of account creation.

const (
	CreateModeDefault            CreateMode = "Default"
	CreateModePointInTimeRestore CreateMode = "PointInTimeRestore"
	CreateModeRestore            CreateMode = "Restore"
)

func PossibleCreateModeValues

func PossibleCreateModeValues() []CreateMode

PossibleCreateModeValues returns the possible values for the CreateMode const type.

type CreateUpdateOptions

type CreateUpdateOptions struct {
	// Specifies the Autoscale settings. Note: Either throughput or autoscaleSettings is required, but not both.
	AutoscaleSettings *AutoscaleSettings

	// Request Units per second. For example, "throughput": 10000.
	Throughput *int32
}

CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput"

func (CreateUpdateOptions) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CreateUpdateOptions.

func (*CreateUpdateOptions) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CreateUpdateOptions.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type DataCenterResource

type DataCenterResource struct {
	// Properties of a managed Cassandra data center.
	Properties *DataCenterResourceProperties

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

DataCenterResource - A managed Cassandra data center.

func (DataCenterResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataCenterResource.

func (*DataCenterResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataCenterResource.

type DataCenterResourceProperties

type DataCenterResourceProperties struct {
	// Ldap authentication method properties. This feature is in preview.
	AuthenticationMethodLdapProperties *AuthenticationMethodLdapProperties

	// If the data center has Availability Zone support, apply it to the Virtual Machine ScaleSet that host the cassandra data
	// center virtual machines.
	AvailabilityZone *bool

	// Indicates the Key Uri of the customer key to use for encryption of the backup storage account.
	BackupStorageCustomerKeyURI *string

	// A fragment of a cassandra.yaml configuration file to be included in the cassandra.yaml for all nodes in this data center.
	// The fragment should be Base64 encoded, and only a subset of keys are allowed.
	Base64EncodedCassandraYamlFragment *string

	// The region this data center should be created in.
	DataCenterLocation *string

	// Whether the data center has been deallocated.
	Deallocated *bool

	// Resource id of a subnet the nodes in this data center should have their network interfaces connected to. The subnet must
	// be in the same region specified in 'dataCenterLocation' and must be able to
	// route to the subnet specified in the cluster's 'delegatedManagementSubnetId' property. This resource id will be of the
	// form '/subscriptions//resourceGroups/
	// /providers/Microsoft.Network/virtualNetworks//subnets/'.
	DelegatedSubnetID *string

	// Number of disks attached to each node. Default is 4.
	DiskCapacity *int32

	// Disk SKU used for data centers. Default value is P30.
	DiskSKU *string

	// Key uri to use for encryption of managed disks. Ensure the system assigned identity of the cluster has been assigned appropriate
	// permissions(key get/wrap/unwrap permissions) on the key.
	ManagedDiskCustomerKeyURI *string

	// The number of nodes the data center should have. This is the desired number. After it is set, it may take some time for
	// the data center to be scaled to match. To monitor the number of nodes and their
	// status, use the fetchNodeStatus method on the cluster.
	NodeCount *int32

	// Ip of the VPN Endpoint for this data center.
	PrivateEndpointIPAddress *string

	// Error related to resource provisioning.
	ProvisionError *CassandraError

	// The status of the resource at the time the operation was called.
	ProvisioningState *ManagedCassandraProvisioningState

	// Virtual Machine SKU used for data centers. Default value is StandardDS14v2
	SKU *string

	// READ-ONLY; IP addresses for seed nodes in this data center. This is for reference. Generally you will want to use the seedNodes
	// property on the cluster, which aggregates the seed nodes from all data centers in
	// the cluster.
	SeedNodes []*SeedNode
}

DataCenterResourceProperties - Properties of a managed Cassandra data center.

func (DataCenterResourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataCenterResourceProperties.

func (*DataCenterResourceProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataCenterResourceProperties.

type DataTransferComponent

type DataTransferComponent string
const (
	DataTransferComponentAzureBlobStorage  DataTransferComponent = "AzureBlobStorage"
	DataTransferComponentCosmosDBCassandra DataTransferComponent = "CosmosDBCassandra"
	DataTransferComponentCosmosDBMongo     DataTransferComponent = "CosmosDBMongo"
	DataTransferComponentCosmosDBSQL       DataTransferComponent = "CosmosDBSql"
)

func PossibleDataTransferComponentValues

func PossibleDataTransferComponentValues() []DataTransferComponent

PossibleDataTransferComponentValues returns the possible values for the DataTransferComponent const type.

type DataTransferDataSourceSink

type DataTransferDataSourceSink struct {
	// REQUIRED
	Component *DataTransferComponent
}

DataTransferDataSourceSink - Base class for all DataTransfer source/sink

func (*DataTransferDataSourceSink) GetDataTransferDataSourceSink

func (d *DataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink

GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type DataTransferDataSourceSink.

func (DataTransferDataSourceSink) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataTransferDataSourceSink.

func (*DataTransferDataSourceSink) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferDataSourceSink.

type DataTransferDataSourceSinkClassification

type DataTransferDataSourceSinkClassification interface {
	// GetDataTransferDataSourceSink returns the DataTransferDataSourceSink content of the underlying type.
	GetDataTransferDataSourceSink() *DataTransferDataSourceSink
}

DataTransferDataSourceSinkClassification provides polymorphic access to related types. Call the interface's GetDataTransferDataSourceSink() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *AzureBlobDataTransferDataSourceSink, *BaseCosmosDataTransferDataSourceSink, *CassandraDataTransferDataSourceSink, *DataTransferDataSourceSink, - *MongoDataTransferDataSourceSink, *SQLDataTransferDataSourceSink

type DataTransferJobFeedResults

type DataTransferJobFeedResults struct {
	// READ-ONLY; URL to get the next set of Data Transfer job list results if there are any.
	NextLink *string

	// READ-ONLY; List of Data Transfer jobs and their properties.
	Value []*DataTransferJobGetResults
}

DataTransferJobFeedResults - The List operation response, that contains the Data Transfer jobs and their properties.

func (DataTransferJobFeedResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataTransferJobFeedResults.

func (*DataTransferJobFeedResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferJobFeedResults.

type DataTransferJobGetResults

type DataTransferJobGetResults struct {
	// The properties of a DataTransfer Job
	Properties *DataTransferJobProperties

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

DataTransferJobGetResults - A Cosmos DB Data Transfer Job

func (DataTransferJobGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataTransferJobGetResults.

func (*DataTransferJobGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferJobGetResults.

type DataTransferJobMode

type DataTransferJobMode string

DataTransferJobMode - Mode of job execution

const (
	DataTransferJobModeOffline DataTransferJobMode = "Offline"
	DataTransferJobModeOnline  DataTransferJobMode = "Online"
)

func PossibleDataTransferJobModeValues

func PossibleDataTransferJobModeValues() []DataTransferJobMode

PossibleDataTransferJobModeValues returns the possible values for the DataTransferJobMode const type.

type DataTransferJobProperties

type DataTransferJobProperties struct {
	// REQUIRED; Destination DataStore details
	Destination DataTransferDataSourceSinkClassification

	// REQUIRED; Source DataStore details
	Source DataTransferDataSourceSinkClassification

	// Mode of job execution
	Mode *DataTransferJobMode

	// Worker count
	WorkerCount *int32

	// READ-ONLY; Total Duration of Job
	Duration *string

	// READ-ONLY; Error response for Faulted job
	Error *ErrorResponse

	// READ-ONLY; Job Name
	JobName *string

	// READ-ONLY; Last Updated Time (ISO-8601 format).
	LastUpdatedUTCTime *time.Time

	// READ-ONLY; Processed Count.
	ProcessedCount *int64

	// READ-ONLY; Job Status
	Status *string

	// READ-ONLY; Total Count.
	TotalCount *int64
}

DataTransferJobProperties - The properties of a DataTransfer Job

func (DataTransferJobProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataTransferJobProperties.

func (*DataTransferJobProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferJobProperties.

type DataTransferJobsClient

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

DataTransferJobsClient contains the methods for the DataTransferJobs group. Don't use this type directly, use NewDataTransferJobsClient() instead.

func NewDataTransferJobsClient

func NewDataTransferJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataTransferJobsClient, error)

NewDataTransferJobsClient creates a new instance of DataTransferJobsClient with the specified values.

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

func (*DataTransferJobsClient) Cancel

func (client *DataTransferJobsClient) Cancel(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientCancelOptions) (DataTransferJobsClientCancelResponse, error)

Cancel - Cancels a Data Transfer Job. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • jobName - Name of the Data Transfer Job
  • options - DataTransferJobsClientCancelOptions contains the optional parameters for the DataTransferJobsClient.Cancel method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataTransferJobsClient().Cancel(ctx, "rg1", "ddb1", "j1", 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.DataTransferJobGetResults = armcosmos.DataTransferJobGetResults{
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"),
// 	ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"),
// 	Properties: &armcosmos.DataTransferJobProperties{
// 		Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage),
// 			ContainerName: to.Ptr("blob_container"),
// 			EndpointURL: to.Ptr("https://blob.windows.net"),
// 		},
// 		Duration: to.Ptr("00:34:10"),
// 		JobName: to.Ptr("j1"),
// 		LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T11:10:55.278Z"); return t}()),
// 		ProcessedCount: to.Ptr[int64](20),
// 		Source: &armcosmos.CassandraDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra),
// 			KeyspaceName: to.Ptr("keyspace"),
// 			TableName: to.Ptr("table"),
// 		},
// 		Status: to.Ptr("Cancelled"),
// 		TotalCount: to.Ptr[int64](100),
// 	},
// }
Output:

func (*DataTransferJobsClient) Complete

func (client *DataTransferJobsClient) Complete(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientCompleteOptions) (DataTransferJobsClientCompleteResponse, error)

Complete - Completes a Data Transfer Online Job. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • jobName - Name of the Data Transfer Job
  • options - DataTransferJobsClientCompleteOptions contains the optional parameters for the DataTransferJobsClient.Complete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataTransferJobsClient().Complete(ctx, "rg1", "ddb1", "j1", 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.DataTransferJobGetResults = armcosmos.DataTransferJobGetResults{
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"),
// 	ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"),
// 	Properties: &armcosmos.DataTransferJobProperties{
// 		Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage),
// 			ContainerName: to.Ptr("blob_container"),
// 			EndpointURL: to.Ptr("https://blob.windows.net"),
// 		},
// 		Duration: to.Ptr("00:34:10"),
// 		JobName: to.Ptr("j1"),
// 		LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T11:10:55.278Z"); return t}()),
// 		ProcessedCount: to.Ptr[int64](20),
// 		Source: &armcosmos.CassandraDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra),
// 			KeyspaceName: to.Ptr("keyspace"),
// 			TableName: to.Ptr("table"),
// 		},
// 		Status: to.Ptr("Completed"),
// 		TotalCount: to.Ptr[int64](100),
// 	},
// }
Output:

func (*DataTransferJobsClient) Create

func (client *DataTransferJobsClient) Create(ctx context.Context, resourceGroupName string, accountName string, jobName string, jobCreateParameters CreateJobRequest, options *DataTransferJobsClientCreateOptions) (DataTransferJobsClientCreateResponse, error)

Create - Creates a Data Transfer Job. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • jobName - Name of the Data Transfer Job
  • options - DataTransferJobsClientCreateOptions contains the optional parameters for the DataTransferJobsClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataTransferJobsClient().Create(ctx, "rg1", "ddb1", "j1", armcosmos.CreateJobRequest{
	Properties: &armcosmos.DataTransferJobProperties{
		Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{
			Component:     to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage),
			ContainerName: to.Ptr("blob_container"),
			EndpointURL:   to.Ptr("https://blob.windows.net"),
		},
		Source: &armcosmos.CassandraDataTransferDataSourceSink{
			Component:    to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra),
			KeyspaceName: to.Ptr("keyspace"),
			TableName:    to.Ptr("table"),
		},
	},
}, 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.DataTransferJobGetResults = armcosmos.DataTransferJobGetResults{
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"),
// 	ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"),
// 	Properties: &armcosmos.DataTransferJobProperties{
// 		Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage),
// 			ContainerName: to.Ptr("blob_container"),
// 			EndpointURL: to.Ptr("https://blob.windows.net"),
// 		},
// 		Duration: to.Ptr("00:00:00"),
// 		JobName: to.Ptr("j1"),
// 		LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T11:10:55.278Z"); return t}()),
// 		ProcessedCount: to.Ptr[int64](0),
// 		Source: &armcosmos.CassandraDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra),
// 			KeyspaceName: to.Ptr("keyspace"),
// 			TableName: to.Ptr("table"),
// 		},
// 		Status: to.Ptr("Running"),
// 		TotalCount: to.Ptr[int64](0),
// 	},
// }
Output:

func (*DataTransferJobsClient) Get

func (client *DataTransferJobsClient) Get(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientGetOptions) (DataTransferJobsClientGetResponse, error)

Get - Get a Data Transfer Job. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • jobName - Name of the Data Transfer Job
  • options - DataTransferJobsClientGetOptions contains the optional parameters for the DataTransferJobsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataTransferJobsClient().Get(ctx, "rg1", "ddb1", "j1", 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.DataTransferJobGetResults = armcosmos.DataTransferJobGetResults{
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"),
// 	ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"),
// 	Properties: &armcosmos.DataTransferJobProperties{
// 		Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage),
// 			ContainerName: to.Ptr("blob_container"),
// 			EndpointURL: to.Ptr("https://blob.windows.net"),
// 		},
// 		Duration: to.Ptr("01:23:56"),
// 		JobName: to.Ptr("j1"),
// 		LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T12:04:23.153Z"); return t}()),
// 		ProcessedCount: to.Ptr[int64](50),
// 		Source: &armcosmos.CassandraDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra),
// 			KeyspaceName: to.Ptr("keyspace"),
// 			TableName: to.Ptr("table"),
// 		},
// 		Status: to.Ptr("Completed"),
// 		TotalCount: to.Ptr[int64](50),
// 	},
// }
Output:

func (*DataTransferJobsClient) NewListByDatabaseAccountPager

NewListByDatabaseAccountPager - Get a list of Data Transfer jobs.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - DataTransferJobsClientListByDatabaseAccountOptions contains the optional parameters for the DataTransferJobsClient.NewListByDatabaseAccountPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDataTransferJobsClient().NewListByDatabaseAccountPager("rg1", "ddb1", 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.DataTransferJobFeedResults = armcosmos.DataTransferJobFeedResults{
	// 	Value: []*armcosmos.DataTransferJobGetResults{
	// 		{
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"),
	// 			ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"),
	// 			Properties: &armcosmos.DataTransferJobProperties{
	// 				Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{
	// 					Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage),
	// 					ContainerName: to.Ptr("blob_container"),
	// 					EndpointURL: to.Ptr("https://blob.windows.net"),
	// 				},
	// 				Duration: to.Ptr("00:00:00"),
	// 				JobName: to.Ptr("j1"),
	// 				LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T12:04:23.153Z"); return t}()),
	// 				ProcessedCount: to.Ptr[int64](100),
	// 				Source: &armcosmos.CassandraDataTransferDataSourceSink{
	// 					Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra),
	// 					KeyspaceName: to.Ptr("keyspace"),
	// 					TableName: to.Ptr("table"),
	// 				},
	// 				Status: to.Ptr("Completed"),
	// 				TotalCount: to.Ptr[int64](100),
	// 			},
	// 	}},
	// }
}
Output:

func (*DataTransferJobsClient) Pause

func (client *DataTransferJobsClient) Pause(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientPauseOptions) (DataTransferJobsClientPauseResponse, error)

Pause - Pause a Data Transfer Job. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • jobName - Name of the Data Transfer Job
  • options - DataTransferJobsClientPauseOptions contains the optional parameters for the DataTransferJobsClient.Pause method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataTransferJobsClient().Pause(ctx, "rg1", "ddb1", "j1", 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.DataTransferJobGetResults = armcosmos.DataTransferJobGetResults{
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"),
// 	ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"),
// 	Properties: &armcosmos.DataTransferJobProperties{
// 		Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage),
// 			ContainerName: to.Ptr("blob_container"),
// 			EndpointURL: to.Ptr("https://blob.windows.net"),
// 		},
// 		Duration: to.Ptr("00:11:25"),
// 		JobName: to.Ptr("j1"),
// 		LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T11:10:55.278Z"); return t}()),
// 		ProcessedCount: to.Ptr[int64](20),
// 		Source: &armcosmos.CassandraDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra),
// 			KeyspaceName: to.Ptr("keyspace"),
// 			TableName: to.Ptr("table"),
// 		},
// 		Status: to.Ptr("Paused"),
// 		TotalCount: to.Ptr[int64](100),
// 	},
// }
Output:

func (*DataTransferJobsClient) Resume

func (client *DataTransferJobsClient) Resume(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientResumeOptions) (DataTransferJobsClientResumeResponse, error)

Resume - Resumes a Data Transfer Job. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • jobName - Name of the Data Transfer Job
  • options - DataTransferJobsClientResumeOptions contains the optional parameters for the DataTransferJobsClient.Resume method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataTransferJobsClient().Resume(ctx, "rg1", "ddb1", "j1", 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.DataTransferJobGetResults = armcosmos.DataTransferJobGetResults{
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"),
// 	ID: to.Ptr("ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16"),
// 	Properties: &armcosmos.DataTransferJobProperties{
// 		Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage),
// 			ContainerName: to.Ptr("blob_container"),
// 			EndpointURL: to.Ptr("https://blob.windows.net"),
// 		},
// 		Duration: to.Ptr("00:21:50"),
// 		JobName: to.Ptr("j1"),
// 		LastUpdatedUTCTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-12T11:10:55.278Z"); return t}()),
// 		ProcessedCount: to.Ptr[int64](20),
// 		Source: &armcosmos.CassandraDataTransferDataSourceSink{
// 			Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra),
// 			KeyspaceName: to.Ptr("keyspace"),
// 			TableName: to.Ptr("table"),
// 		},
// 		Status: to.Ptr("Pending"),
// 		TotalCount: to.Ptr[int64](100),
// 	},
// }
Output:

type DataTransferJobsClientCancelOptions

type DataTransferJobsClientCancelOptions struct {
}

DataTransferJobsClientCancelOptions contains the optional parameters for the DataTransferJobsClient.Cancel method.

type DataTransferJobsClientCancelResponse

type DataTransferJobsClientCancelResponse struct {
	// A Cosmos DB Data Transfer Job
	DataTransferJobGetResults
}

DataTransferJobsClientCancelResponse contains the response from method DataTransferJobsClient.Cancel.

type DataTransferJobsClientCompleteOptions

type DataTransferJobsClientCompleteOptions struct {
}

DataTransferJobsClientCompleteOptions contains the optional parameters for the DataTransferJobsClient.Complete method.

type DataTransferJobsClientCompleteResponse

type DataTransferJobsClientCompleteResponse struct {
	// A Cosmos DB Data Transfer Job
	DataTransferJobGetResults
}

DataTransferJobsClientCompleteResponse contains the response from method DataTransferJobsClient.Complete.

type DataTransferJobsClientCreateOptions

type DataTransferJobsClientCreateOptions struct {
}

DataTransferJobsClientCreateOptions contains the optional parameters for the DataTransferJobsClient.Create method.

type DataTransferJobsClientCreateResponse

type DataTransferJobsClientCreateResponse struct {
	// A Cosmos DB Data Transfer Job
	DataTransferJobGetResults
}

DataTransferJobsClientCreateResponse contains the response from method DataTransferJobsClient.Create.

type DataTransferJobsClientGetOptions

type DataTransferJobsClientGetOptions struct {
}

DataTransferJobsClientGetOptions contains the optional parameters for the DataTransferJobsClient.Get method.

type DataTransferJobsClientGetResponse

type DataTransferJobsClientGetResponse struct {
	// A Cosmos DB Data Transfer Job
	DataTransferJobGetResults
}

DataTransferJobsClientGetResponse contains the response from method DataTransferJobsClient.Get.

type DataTransferJobsClientListByDatabaseAccountOptions

type DataTransferJobsClientListByDatabaseAccountOptions struct {
}

DataTransferJobsClientListByDatabaseAccountOptions contains the optional parameters for the DataTransferJobsClient.NewListByDatabaseAccountPager method.

type DataTransferJobsClientListByDatabaseAccountResponse

type DataTransferJobsClientListByDatabaseAccountResponse struct {
	// The List operation response, that contains the Data Transfer jobs and their properties.
	DataTransferJobFeedResults
}

DataTransferJobsClientListByDatabaseAccountResponse contains the response from method DataTransferJobsClient.NewListByDatabaseAccountPager.

type DataTransferJobsClientPauseOptions

type DataTransferJobsClientPauseOptions struct {
}

DataTransferJobsClientPauseOptions contains the optional parameters for the DataTransferJobsClient.Pause method.

type DataTransferJobsClientPauseResponse

type DataTransferJobsClientPauseResponse struct {
	// A Cosmos DB Data Transfer Job
	DataTransferJobGetResults
}

DataTransferJobsClientPauseResponse contains the response from method DataTransferJobsClient.Pause.

type DataTransferJobsClientResumeOptions

type DataTransferJobsClientResumeOptions struct {
}

DataTransferJobsClientResumeOptions contains the optional parameters for the DataTransferJobsClient.Resume method.

type DataTransferJobsClientResumeResponse

type DataTransferJobsClientResumeResponse struct {
	// A Cosmos DB Data Transfer Job
	DataTransferJobGetResults
}

DataTransferJobsClientResumeResponse contains the response from method DataTransferJobsClient.Resume.

type DataTransferRegionalServiceResource

type DataTransferRegionalServiceResource struct {
	// READ-ONLY; The location name.
	Location *string

	// READ-ONLY; The regional service name.
	Name *string

	// READ-ONLY; Describes the status of a service.
	Status *ServiceStatus
}

DataTransferRegionalServiceResource - Resource for a regional service location.

func (DataTransferRegionalServiceResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataTransferRegionalServiceResource.

func (*DataTransferRegionalServiceResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferRegionalServiceResource.

type DataTransferServiceResource

type DataTransferServiceResource struct {
	// Properties for DataTransferServiceResource.
	Properties *DataTransferServiceResourceProperties
}

DataTransferServiceResource - Describes the service response property.

func (DataTransferServiceResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataTransferServiceResource.

func (*DataTransferServiceResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferServiceResource.

type DataTransferServiceResourceProperties

type DataTransferServiceResourceProperties struct {
	// REQUIRED; ServiceType for the service.
	ServiceType *ServiceType

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

	// Instance count for the service.
	InstanceCount *int32

	// Instance type for the service.
	InstanceSize *ServiceSize

	// READ-ONLY; Time of the last state change (ISO-8601 format).
	CreationTime *time.Time

	// READ-ONLY; An array that contains all of the locations for the service.
	Locations []*DataTransferRegionalServiceResource

	// READ-ONLY; Describes the status of a service.
	Status *ServiceStatus
}

DataTransferServiceResourceProperties - Properties for DataTransferServiceResource.

func (*DataTransferServiceResourceProperties) GetServiceResourceProperties

func (d *DataTransferServiceResourceProperties) GetServiceResourceProperties() *ServiceResourceProperties

GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type DataTransferServiceResourceProperties.

func (DataTransferServiceResourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataTransferServiceResourceProperties.

func (*DataTransferServiceResourceProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferServiceResourceProperties.

type DataType

type DataType string

DataType - The datatype for which the indexing behavior is applied to.

const (
	DataTypeLineString   DataType = "LineString"
	DataTypeMultiPolygon DataType = "MultiPolygon"
	DataTypeNumber       DataType = "Number"
	DataTypePoint        DataType = "Point"
	DataTypePolygon      DataType = "Polygon"
	DataTypeString       DataType = "String"
)

func PossibleDataTypeValues

func PossibleDataTypeValues() []DataType

PossibleDataTypeValues returns the possible values for the DataType const type.

type DatabaseAccountConnectionString

type DatabaseAccountConnectionString struct {
	// READ-ONLY; Value of the connection string
	ConnectionString *string

	// READ-ONLY; Description of the connection string
	Description *string

	// READ-ONLY; Kind of the connection string key
	KeyKind *Kind

	// READ-ONLY; Type of the connection string
	Type *Type
}

DatabaseAccountConnectionString - Connection string for the Cosmos DB account

func (DatabaseAccountConnectionString) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountConnectionString.

func (*DatabaseAccountConnectionString) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountConnectionString.

type DatabaseAccountCreateUpdateParameters

type DatabaseAccountCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB database accounts.
	Properties *DatabaseAccountCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// Indicates the type of database account. This can only be set at database account creation.
	Kind *DatabaseAccountKind

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

DatabaseAccountCreateUpdateParameters - Parameters to create and update Cosmos DB database accounts.

func (DatabaseAccountCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountCreateUpdateParameters.

func (*DatabaseAccountCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountCreateUpdateParameters.

type DatabaseAccountCreateUpdateProperties

type DatabaseAccountCreateUpdateProperties struct {
	// CONSTANT; The offer type for the database
	// Field has constant value "Standard", any specified value is ignored.
	DatabaseAccountOfferType *string

	// REQUIRED; An array that contains the georeplication locations enabled for the Cosmos DB account.
	Locations []*Location

	// API specific properties. Currently, supported only for MongoDB API.
	APIProperties *APIProperties

	// Analytical storage specific properties.
	AnalyticalStorageConfiguration *AnalyticalStorageConfiguration

	// The object representing the policy for taking backups on an account.
	BackupPolicy BackupPolicyClassification

	// List of Cosmos DB capabilities for the account
	Capabilities []*Capability

	// The object that represents all properties related to capacity enforcement on an account.
	Capacity *Capacity

	// The cassandra connector offer type for the Cosmos DB database C* account.
	ConnectorOffer *ConnectorOffer

	// The consistency policy for the Cosmos DB account.
	ConsistencyPolicy *ConsistencyPolicy

	// The CORS policy for the Cosmos DB database account.
	Cors []*CorsPolicy

	// Enum to indicate the mode of account creation.
	CreateMode *CreateMode

	// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides
	// troubleshooting guidance.
	CustomerManagedKeyStatus *string

	// The default identity for accessing key vault used in features like customer managed keys. The default identity needs to
	// be explicitly set by the users. It can be "FirstPartyIdentity",
	// "SystemAssignedIdentity" and more.
	DefaultIdentity *string

	// Enum to indicate default Priority Level of request for Priority Based Execution.
	DefaultPriorityLevel *DefaultPriorityLevel

	// The Object representing the different Diagnostic log settings for the Cosmos DB Account.
	DiagnosticLogSettings *DiagnosticLogSettings

	// Disable write operations on metadata resources (databases, containers, throughput) via account keys
	DisableKeyBasedMetadataWriteAccess *bool

	// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.
	DisableLocalAuth *bool

	// Flag to indicate whether to enable storage analytics.
	EnableAnalyticalStorage *bool

	// Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic
	// failover will result in a new write region for the account and is chosen
	// based on the failover priorities configured for the account.
	EnableAutomaticFailover *bool

	// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account
	EnableBurstCapacity *bool

	// Enables the cassandra connector on the Cosmos DB C* account
	EnableCassandraConnector *bool

	// Flag to indicate whether Free Tier is enabled.
	EnableFreeTier *bool

	// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account
	EnableMaterializedViews *bool

	// Enables the account to write in multiple locations
	EnableMultipleWriteLocations *bool

	// Flag to indicate enabling/disabling of Partition Merge feature on the account
	EnablePartitionMerge *bool

	// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account
	EnablePerRegionPerPartitionAutoscale *bool

	// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account
	EnablePriorityBasedExecution *bool

	// List of IpRules.
	IPRules []*IPAddressOrRange

	// Flag to indicate whether to enable/disable Virtual Network ACL rules.
	IsVirtualNetworkFilterEnabled *bool

	// The URI of the key vault
	KeyVaultKeyURI *string

	// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work
	// with Tls 1.2.
	MinimalTLSVersion *MinimalTLSVersion

	// Indicates what services are allowed to bypass firewall checks.
	NetworkACLBypass *NetworkACLBypass

	// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account.
	NetworkACLBypassResourceIDs []*string

	// Whether requests from Public Network are allowed
	PublicNetworkAccess *PublicNetworkAccess

	// Parameters to indicate the information about the restore.
	RestoreParameters *RestoreParameters

	// List of Virtual Network ACL rules configured for the Cosmos DB account.
	VirtualNetworkRules []*VirtualNetworkRule

	// READ-ONLY; This property is ignored during the update/create operation, as the metadata is read-only. The object represents
	// the metadata for the Account Keys of the Cosmos DB account.
	KeysMetadata *DatabaseAccountKeysMetadata
}

DatabaseAccountCreateUpdateProperties - Properties to create and update Azure Cosmos DB database accounts.

func (DatabaseAccountCreateUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountCreateUpdateProperties.

func (*DatabaseAccountCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountCreateUpdateProperties.

type DatabaseAccountGetProperties

type DatabaseAccountGetProperties struct {
	// API specific properties.
	APIProperties *APIProperties

	// Analytical storage specific properties.
	AnalyticalStorageConfiguration *AnalyticalStorageConfiguration

	// The object representing the policy for taking backups on an account.
	BackupPolicy BackupPolicyClassification

	// List of Cosmos DB capabilities for the account
	Capabilities []*Capability

	// The object that represents all properties related to capacity enforcement on an account.
	Capacity *Capacity

	// The cassandra connector offer type for the Cosmos DB database C* account.
	ConnectorOffer *ConnectorOffer

	// The consistency policy for the Cosmos DB database account.
	ConsistencyPolicy *ConsistencyPolicy

	// The CORS policy for the Cosmos DB database account.
	Cors []*CorsPolicy

	// Enum to indicate the mode of account creation.
	CreateMode *CreateMode

	// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides
	// troubleshooting guidance.
	CustomerManagedKeyStatus *string

	// The default identity for accessing key vault used in features like customer managed keys. The default identity needs to
	// be explicitly set by the users. It can be "FirstPartyIdentity",
	// "SystemAssignedIdentity" and more.
	DefaultIdentity *string

	// Enum to indicate default Priority Level of request for Priority Based Execution.
	DefaultPriorityLevel *DefaultPriorityLevel

	// The Object representing the different Diagnostic log settings for the Cosmos DB Account.
	DiagnosticLogSettings *DiagnosticLogSettings

	// Disable write operations on metadata resources (databases, containers, throughput) via account keys
	DisableKeyBasedMetadataWriteAccess *bool

	// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.
	DisableLocalAuth *bool

	// Flag to indicate whether to enable storage analytics.
	EnableAnalyticalStorage *bool

	// Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic
	// failover will result in a new write region for the account and is chosen
	// based on the failover priorities configured for the account.
	EnableAutomaticFailover *bool

	// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account
	EnableBurstCapacity *bool

	// Enables the cassandra connector on the Cosmos DB C* account
	EnableCassandraConnector *bool

	// Flag to indicate whether Free Tier is enabled.
	EnableFreeTier *bool

	// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account
	EnableMaterializedViews *bool

	// Enables the account to write in multiple locations
	EnableMultipleWriteLocations *bool

	// Flag to indicate enabling/disabling of Partition Merge feature on the account
	EnablePartitionMerge *bool

	// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account
	EnablePerRegionPerPartitionAutoscale *bool

	// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account
	EnablePriorityBasedExecution *bool

	// List of IpRules.
	IPRules []*IPAddressOrRange

	// Flag to indicate whether to enable/disable Virtual Network ACL rules.
	IsVirtualNetworkFilterEnabled *bool

	// The URI of the key vault
	KeyVaultKeyURI *string

	// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work
	// with Tls 1.2.
	MinimalTLSVersion *MinimalTLSVersion

	// Indicates what services are allowed to bypass firewall checks.
	NetworkACLBypass *NetworkACLBypass

	// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account.
	NetworkACLBypassResourceIDs []*string

	// Whether requests from Public Network are allowed
	PublicNetworkAccess *PublicNetworkAccess

	// Parameters to indicate the information about the restore.
	RestoreParameters *RestoreParameters

	// List of Virtual Network ACL rules configured for the Cosmos DB account.
	VirtualNetworkRules []*VirtualNetworkRule

	// READ-ONLY; The offer type for the Cosmos DB database account. Default value: Standard.
	DatabaseAccountOfferType *string

	// READ-ONLY; The connection endpoint for the Cosmos DB database account.
	DocumentEndpoint *string

	// READ-ONLY; An array that contains the regions ordered by their failover priorities.
	FailoverPolicies []*FailoverPolicy

	// READ-ONLY; A unique identifier assigned to the database account
	InstanceID *string

	// READ-ONLY; The object that represents the metadata for the Account Keys of the Cosmos DB account.
	KeysMetadata *DatabaseAccountKeysMetadata

	// READ-ONLY; An array that contains all of the locations enabled for the Cosmos DB account.
	Locations []*Location

	// READ-ONLY; List of Private Endpoint Connections configured for the Cosmos DB account.
	PrivateEndpointConnections []*PrivateEndpointConnection

	// READ-ONLY; The status of the Cosmos DB account at the time the operation was called. The status can be one of following.
	// 'Creating' – the Cosmos DB account is being created. When an account is in Creating state,
	// only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the
	// Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being
	// updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed'
	// – the Cosmos DB account deletion failed.
	ProvisioningState *string

	// READ-ONLY; An array that contains of the read locations enabled for the Cosmos DB account.
	ReadLocations []*Location

	// READ-ONLY; An array that contains the write location for the Cosmos DB account.
	WriteLocations []*Location
}

DatabaseAccountGetProperties - Properties for the database account.

func (DatabaseAccountGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountGetProperties.

func (*DatabaseAccountGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountGetProperties.

type DatabaseAccountGetResults

type DatabaseAccountGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// Indicates the type of database account. This can only be set at database account creation.
	Kind *DatabaseAccountKind

	// The location of the resource group to which the resource belongs.
	Location *string

	// Properties for the database account.
	Properties *DatabaseAccountGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The system meta data relating to this resource.
	SystemData *SystemData

	// READ-ONLY; The type of Azure resource.
	Type *string
}

DatabaseAccountGetResults - An Azure Cosmos DB database account.

func (DatabaseAccountGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountGetResults.

func (*DatabaseAccountGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountGetResults.

type DatabaseAccountKeysMetadata

type DatabaseAccountKeysMetadata struct {
	// READ-ONLY; The metadata related to the Primary Read-Write Key for the given Cosmos DB database account.
	PrimaryMasterKey *AccountKeyMetadata

	// READ-ONLY; The metadata related to the Primary Read-Only Key for the given Cosmos DB database account.
	PrimaryReadonlyMasterKey *AccountKeyMetadata

	// READ-ONLY; The metadata related to the Secondary Read-Write Key for the given Cosmos DB database account.
	SecondaryMasterKey *AccountKeyMetadata

	// READ-ONLY; The metadata related to the Secondary Read-Only Key for the given Cosmos DB database account.
	SecondaryReadonlyMasterKey *AccountKeyMetadata
}

DatabaseAccountKeysMetadata - The metadata related to each access key for the given Cosmos DB database account.

func (DatabaseAccountKeysMetadata) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountKeysMetadata.

func (*DatabaseAccountKeysMetadata) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountKeysMetadata.

type DatabaseAccountKind

type DatabaseAccountKind string

DatabaseAccountKind - Indicates the type of database account. This can only be set at database account creation.

const (
	DatabaseAccountKindGlobalDocumentDB DatabaseAccountKind = "GlobalDocumentDB"
	DatabaseAccountKindMongoDB          DatabaseAccountKind = "MongoDB"
	DatabaseAccountKindParse            DatabaseAccountKind = "Parse"
)

func PossibleDatabaseAccountKindValues

func PossibleDatabaseAccountKindValues() []DatabaseAccountKind

PossibleDatabaseAccountKindValues returns the possible values for the DatabaseAccountKind const type.

type DatabaseAccountListConnectionStringsResult

type DatabaseAccountListConnectionStringsResult struct {
	// An array that contains the connection strings for the Cosmos DB account.
	ConnectionStrings []*DatabaseAccountConnectionString
}

DatabaseAccountListConnectionStringsResult - The connection strings for the given database account.

func (DatabaseAccountListConnectionStringsResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListConnectionStringsResult.

func (*DatabaseAccountListConnectionStringsResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountListConnectionStringsResult.

type DatabaseAccountListKeysResult

type DatabaseAccountListKeysResult struct {
	// READ-ONLY; Base 64 encoded value of the primary read-write key.
	PrimaryMasterKey *string

	// READ-ONLY; Base 64 encoded value of the primary read-only key.
	PrimaryReadonlyMasterKey *string

	// READ-ONLY; Base 64 encoded value of the secondary read-write key.
	SecondaryMasterKey *string

	// READ-ONLY; Base 64 encoded value of the secondary read-only key.
	SecondaryReadonlyMasterKey *string
}

DatabaseAccountListKeysResult - The access keys for the given database account.

func (DatabaseAccountListKeysResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListKeysResult.

func (*DatabaseAccountListKeysResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountListKeysResult.

type DatabaseAccountListReadOnlyKeysResult

type DatabaseAccountListReadOnlyKeysResult struct {
	// READ-ONLY; Base 64 encoded value of the primary read-only key.
	PrimaryReadonlyMasterKey *string

	// READ-ONLY; Base 64 encoded value of the secondary read-only key.
	SecondaryReadonlyMasterKey *string
}

DatabaseAccountListReadOnlyKeysResult - The read-only access keys for the given database account.

func (DatabaseAccountListReadOnlyKeysResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListReadOnlyKeysResult.

func (*DatabaseAccountListReadOnlyKeysResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountListReadOnlyKeysResult.

type DatabaseAccountRegenerateKeyParameters

type DatabaseAccountRegenerateKeyParameters struct {
	// REQUIRED; The access key to regenerate.
	KeyKind *KeyKind
}

DatabaseAccountRegenerateKeyParameters - Parameters to regenerate the keys within the database account.

func (DatabaseAccountRegenerateKeyParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountRegenerateKeyParameters.

func (*DatabaseAccountRegenerateKeyParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountRegenerateKeyParameters.

type DatabaseAccountRegionClient

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

DatabaseAccountRegionClient contains the methods for the DatabaseAccountRegion group. Don't use this type directly, use NewDatabaseAccountRegionClient() instead.

func NewDatabaseAccountRegionClient

func NewDatabaseAccountRegionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseAccountRegionClient, error)

NewDatabaseAccountRegionClient creates a new instance of DatabaseAccountRegionClient with the specified values.

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

func (*DatabaseAccountRegionClient) NewListMetricsPager

func (client *DatabaseAccountRegionClient) NewListMetricsPager(resourceGroupName string, accountName string, region string, filter string, options *DatabaseAccountRegionClientListMetricsOptions) *runtime.Pager[DatabaseAccountRegionClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and region.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • region - Cosmos DB region, with spaces between words and each word capitalized.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - DatabaseAccountRegionClientListMetricsOptions contains the optional parameters for the DatabaseAccountRegionClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDatabaseAccountRegionClient().NewListMetricsPager("rg1", "ddb1", "North Europe", "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", 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.MetricListResult = armcosmos.MetricListResult{
	// 	Value: []*armcosmos.Metric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Total Requests"),
	// 				Value: to.Ptr("Total Requests"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.MetricValue{
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:03:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:08:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT5M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 	}},
	// }
}
Output:

type DatabaseAccountRegionClientListMetricsOptions

type DatabaseAccountRegionClientListMetricsOptions struct {
}

DatabaseAccountRegionClientListMetricsOptions contains the optional parameters for the DatabaseAccountRegionClient.NewListMetricsPager method.

type DatabaseAccountRegionClientListMetricsResponse

type DatabaseAccountRegionClientListMetricsResponse struct {
	// The response to a list metrics request.
	MetricListResult
}

DatabaseAccountRegionClientListMetricsResponse contains the response from method DatabaseAccountRegionClient.NewListMetricsPager.

type DatabaseAccountUpdateParameters

type DatabaseAccountUpdateParameters struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Properties to update Azure Cosmos DB database accounts.
	Properties *DatabaseAccountUpdateProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string
}

DatabaseAccountUpdateParameters - Parameters for patching Azure Cosmos DB database account properties.

func (DatabaseAccountUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountUpdateParameters.

func (*DatabaseAccountUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountUpdateParameters.

type DatabaseAccountUpdateProperties

type DatabaseAccountUpdateProperties struct {
	// API specific properties. Currently, supported only for MongoDB API.
	APIProperties *APIProperties

	// Analytical storage specific properties.
	AnalyticalStorageConfiguration *AnalyticalStorageConfiguration

	// The object representing the policy for taking backups on an account.
	BackupPolicy BackupPolicyClassification

	// List of Cosmos DB capabilities for the account
	Capabilities []*Capability

	// The object that represents all properties related to capacity enforcement on an account.
	Capacity *Capacity

	// The cassandra connector offer type for the Cosmos DB database C* account.
	ConnectorOffer *ConnectorOffer

	// The consistency policy for the Cosmos DB account.
	ConsistencyPolicy *ConsistencyPolicy

	// The CORS policy for the Cosmos DB database account.
	Cors []*CorsPolicy

	// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides
	// troubleshooting guidance.
	CustomerManagedKeyStatus *string

	// The default identity for accessing key vault used in features like customer managed keys. The default identity needs to
	// be explicitly set by the users. It can be "FirstPartyIdentity",
	// "SystemAssignedIdentity" and more.
	DefaultIdentity *string

	// Enum to indicate default Priority Level of request for Priority Based Execution.
	DefaultPriorityLevel *DefaultPriorityLevel

	// The Object representing the different Diagnostic log settings for the Cosmos DB Account.
	DiagnosticLogSettings *DiagnosticLogSettings

	// Disable write operations on metadata resources (databases, containers, throughput) via account keys
	DisableKeyBasedMetadataWriteAccess *bool

	// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.
	DisableLocalAuth *bool

	// Flag to indicate whether to enable storage analytics.
	EnableAnalyticalStorage *bool

	// Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic
	// failover will result in a new write region for the account and is chosen
	// based on the failover priorities configured for the account.
	EnableAutomaticFailover *bool

	// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account
	EnableBurstCapacity *bool

	// Enables the cassandra connector on the Cosmos DB C* account
	EnableCassandraConnector *bool

	// Flag to indicate whether Free Tier is enabled.
	EnableFreeTier *bool

	// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account
	EnableMaterializedViews *bool

	// Enables the account to write in multiple locations
	EnableMultipleWriteLocations *bool

	// Flag to indicate enabling/disabling of Partition Merge feature on the account
	EnablePartitionMerge *bool

	// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account
	EnablePerRegionPerPartitionAutoscale *bool

	// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account
	EnablePriorityBasedExecution *bool

	// List of IpRules.
	IPRules []*IPAddressOrRange

	// Flag to indicate whether to enable/disable Virtual Network ACL rules.
	IsVirtualNetworkFilterEnabled *bool

	// The URI of the key vault
	KeyVaultKeyURI *string

	// An array that contains the georeplication locations enabled for the Cosmos DB account.
	Locations []*Location

	// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work
	// with Tls 1.2.
	MinimalTLSVersion *MinimalTLSVersion

	// Indicates what services are allowed to bypass firewall checks.
	NetworkACLBypass *NetworkACLBypass

	// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account.
	NetworkACLBypassResourceIDs []*string

	// Whether requests from Public Network are allowed
	PublicNetworkAccess *PublicNetworkAccess

	// List of Virtual Network ACL rules configured for the Cosmos DB account.
	VirtualNetworkRules []*VirtualNetworkRule

	// READ-ONLY; This property is ignored during the update operation, as the metadata is read-only. The object represents the
	// metadata for the Account Keys of the Cosmos DB account.
	KeysMetadata *DatabaseAccountKeysMetadata
}

DatabaseAccountUpdateProperties - Properties to update Azure Cosmos DB database accounts.

func (DatabaseAccountUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountUpdateProperties.

func (*DatabaseAccountUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountUpdateProperties.

type DatabaseAccountsClient

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

DatabaseAccountsClient contains the methods for the DatabaseAccounts group. Don't use this type directly, use NewDatabaseAccountsClient() instead.

func NewDatabaseAccountsClient

func NewDatabaseAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseAccountsClient, error)

NewDatabaseAccountsClient creates a new instance of DatabaseAccountsClient with the specified values.

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

func (*DatabaseAccountsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • createUpdateParameters - The parameters to provide for the current database account.
  • options - DatabaseAccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseAccountsClient.BeginCreateOrUpdate method.
Example (CosmosDbDatabaseAccountCreateMax)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountCreateMax.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDatabaseAccountsClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", armcosmos.DatabaseAccountCreateUpdateParameters{
	Identity: &armcosmos.ManagedServiceIdentity{
		Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned),
		UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
			"/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
		},
	},
	Location: to.Ptr("westus"),
	Tags:     map[string]*string{},
	Kind:     to.Ptr(armcosmos.DatabaseAccountKindMongoDB),
	Properties: &armcosmos.DatabaseAccountCreateUpdateProperties{
		AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{
			SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined),
		},
		APIProperties: &armcosmos.APIProperties{
			ServerVersion: to.Ptr(armcosmos.ServerVersionThree2),
		},
		BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{
			Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic),
			PeriodicModeProperties: &armcosmos.PeriodicModeProperties{
				BackupIntervalInMinutes:        to.Ptr[int32](240),
				BackupRetentionIntervalInHours: to.Ptr[int32](8),
				BackupStorageRedundancy:        to.Ptr(armcosmos.BackupStorageRedundancyGeo),
			},
		},
		Capacity: &armcosmos.Capacity{
			TotalThroughputLimit: to.Ptr[int32](2000),
		},
		ConsistencyPolicy: &armcosmos.ConsistencyPolicy{
			DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness),
			MaxIntervalInSeconds:    to.Ptr[int32](10),
			MaxStalenessPrefix:      to.Ptr[int64](200),
		},
		Cors: []*armcosmos.CorsPolicy{
			{
				AllowedOrigins: to.Ptr("https://test"),
			}},
		CreateMode:                           to.Ptr(armcosmos.CreateModeDefault),
		DatabaseAccountOfferType:             to.Ptr("Standard"),
		DefaultIdentity:                      to.Ptr("FirstPartyIdentity"),
		DefaultPriorityLevel:                 to.Ptr(armcosmos.DefaultPriorityLevelLow),
		EnableAnalyticalStorage:              to.Ptr(true),
		EnableBurstCapacity:                  to.Ptr(true),
		EnableFreeTier:                       to.Ptr(false),
		EnableMaterializedViews:              to.Ptr(false),
		EnablePerRegionPerPartitionAutoscale: to.Ptr(true),
		EnablePriorityBasedExecution:         to.Ptr(true),
		IPRules: []*armcosmos.IPAddressOrRange{
			{
				IPAddressOrRange: to.Ptr("23.43.230.120"),
			},
			{
				IPAddressOrRange: to.Ptr("110.12.240.0/12"),
			}},
		IsVirtualNetworkFilterEnabled: to.Ptr(true),
		KeyVaultKeyURI:                to.Ptr("https://myKeyVault.vault.azure.net"),
		Locations: []*armcosmos.Location{
			{
				FailoverPriority: to.Ptr[int32](0),
				IsZoneRedundant:  to.Ptr(false),
				LocationName:     to.Ptr("southcentralus"),
			},
			{
				FailoverPriority: to.Ptr[int32](1),
				IsZoneRedundant:  to.Ptr(false),
				LocationName:     to.Ptr("eastus"),
			}},
		MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTls12),
		NetworkACLBypass:  to.Ptr(armcosmos.NetworkACLBypassAzureServices),
		NetworkACLBypassResourceIDs: []*string{
			to.Ptr("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")},
		PublicNetworkAccess: to.Ptr(armcosmos.PublicNetworkAccessEnabled),
		VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{
			{
				ID:                               to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
				IgnoreMissingVNetServiceEndpoint: to.Ptr(false),
			}},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.DatabaseAccountGetResults = armcosmos.DatabaseAccountGetResults{
// 	Name: to.Ptr("ddb1"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"),
// 	Identity: &armcosmos.ManagedServiceIdentity{
// 		Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned),
// 		PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"),
// 		TenantID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"),
// 		UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
// 			"/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
// 				ClientID: to.Ptr("fbe75b66-01c5-4f87-a220-233af3270436"),
// 				PrincipalID: to.Ptr("075a0ca6-43f6-4434-9abf-c9b1b79f9219"),
// 			},
// 		},
// 	},
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Kind: to.Ptr(armcosmos.DatabaseAccountKindMongoDB),
// 	Properties: &armcosmos.DatabaseAccountGetProperties{
// 		AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{
// 			SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined),
// 		},
// 		APIProperties: &armcosmos.APIProperties{
// 			ServerVersion: to.Ptr(armcosmos.ServerVersionThree2),
// 		},
// 		BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{
// 			Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic),
// 			PeriodicModeProperties: &armcosmos.PeriodicModeProperties{
// 				BackupIntervalInMinutes: to.Ptr[int32](240),
// 				BackupRetentionIntervalInHours: to.Ptr[int32](8),
// 				BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo),
// 			},
// 		},
// 		Capacity: &armcosmos.Capacity{
// 			TotalThroughputLimit: to.Ptr[int32](2000),
// 		},
// 		ConsistencyPolicy: &armcosmos.ConsistencyPolicy{
// 			DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness),
// 			MaxIntervalInSeconds: to.Ptr[int32](10),
// 			MaxStalenessPrefix: to.Ptr[int64](200),
// 		},
// 		Cors: []*armcosmos.CorsPolicy{
// 			{
// 				AllowedOrigins: to.Ptr("https://test"),
// 		}},
// 		CreateMode: to.Ptr(armcosmos.CreateModeDefault),
// 		DatabaseAccountOfferType: to.Ptr("Standard"),
// 		DefaultIdentity: to.Ptr("FirstPartyIdentity"),
// 		DefaultPriorityLevel: to.Ptr(armcosmos.DefaultPriorityLevelLow),
// 		DisableKeyBasedMetadataWriteAccess: to.Ptr(false),
// 		EnableAnalyticalStorage: to.Ptr(true),
// 		EnableBurstCapacity: to.Ptr(true),
// 		EnableFreeTier: to.Ptr(false),
// 		EnableMaterializedViews: to.Ptr(false),
// 		EnablePerRegionPerPartitionAutoscale: to.Ptr(true),
// 		EnablePriorityBasedExecution: to.Ptr(true),
// 		FailoverPolicies: []*armcosmos.FailoverPolicy{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-southcentralus"),
// 				LocationName: to.Ptr("South Central US"),
// 			},
// 			{
// 				FailoverPriority: to.Ptr[int32](1),
// 				ID: to.Ptr("ddb1-eastus"),
// 				LocationName: to.Ptr("East US"),
// 		}},
// 		InstanceID: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"),
// 		IPRules: []*armcosmos.IPAddressOrRange{
// 			{
// 				IPAddressOrRange: to.Ptr("23.43.230.120"),
// 			},
// 			{
// 				IPAddressOrRange: to.Ptr("110.12.240.0/12"),
// 		}},
// 		IsVirtualNetworkFilterEnabled: to.Ptr(true),
// 		KeyVaultKeyURI: to.Ptr("https://myKeyVault.vault.azure.net"),
// 		KeysMetadata: &armcosmos.DatabaseAccountKeysMetadata{
// 			PrimaryMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			SecondaryMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 		},
// 		Locations: []*armcosmos.Location{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-southcentralus"),
// 				IsZoneRedundant: to.Ptr(false),
// 				LocationName: to.Ptr("South Central US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 			},
// 			{
// 				FailoverPriority: to.Ptr[int32](1),
// 				ID: to.Ptr("ddb1-eastus"),
// 				IsZoneRedundant: to.Ptr(false),
// 				LocationName: to.Ptr("East US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 		}},
// 		MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTls12),
// 		NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassAzureServices),
// 		NetworkACLBypassResourceIDs: []*string{
// 			to.Ptr("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")},
// 			ProvisioningState: to.Ptr("Succeeded"),
// 			PublicNetworkAccess: to.Ptr(armcosmos.PublicNetworkAccessEnabled),
// 			ReadLocations: []*armcosmos.Location{
// 				{
// 					FailoverPriority: to.Ptr[int32](0),
// 					ID: to.Ptr("ddb1-southcentralus"),
// 					IsZoneRedundant: to.Ptr(false),
// 					LocationName: to.Ptr("South Central US"),
// 					ProvisioningState: to.Ptr("Succeeded"),
// 				},
// 				{
// 					FailoverPriority: to.Ptr[int32](1),
// 					ID: to.Ptr("ddb1-eastus"),
// 					IsZoneRedundant: to.Ptr(false),
// 					LocationName: to.Ptr("East US"),
// 					ProvisioningState: to.Ptr("Succeeded"),
// 			}},
// 			VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{
// 				{
// 					ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
// 			}},
// 			WriteLocations: []*armcosmos.Location{
// 				{
// 					FailoverPriority: to.Ptr[int32](0),
// 					ID: to.Ptr("ddb1-southcentralus"),
// 					IsZoneRedundant: to.Ptr(false),
// 					LocationName: to.Ptr("South Central US"),
// 					ProvisioningState: to.Ptr("Succeeded"),
// 			}},
// 		},
// 		SystemData: &armcosmos.SystemData{
// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()),
// 		},
// 	}
Output:

Example (CosmosDbDatabaseAccountCreateMin)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountCreateMin.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDatabaseAccountsClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", armcosmos.DatabaseAccountCreateUpdateParameters{
	Location: to.Ptr("westus"),
	Properties: &armcosmos.DatabaseAccountCreateUpdateProperties{
		CreateMode:               to.Ptr(armcosmos.CreateModeDefault),
		DatabaseAccountOfferType: to.Ptr("Standard"),
		Locations: []*armcosmos.Location{
			{
				FailoverPriority: to.Ptr[int32](0),
				IsZoneRedundant:  to.Ptr(false),
				LocationName:     to.Ptr("southcentralus"),
			}},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.DatabaseAccountGetResults = armcosmos.DatabaseAccountGetResults{
// 	Name: to.Ptr("ddb1"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB),
// 	Properties: &armcosmos.DatabaseAccountGetProperties{
// 		APIProperties: &armcosmos.APIProperties{
// 		},
// 		BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{
// 			Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic),
// 			PeriodicModeProperties: &armcosmos.PeriodicModeProperties{
// 				BackupIntervalInMinutes: to.Ptr[int32](240),
// 				BackupRetentionIntervalInHours: to.Ptr[int32](720),
// 				BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo),
// 			},
// 		},
// 		ConsistencyPolicy: &armcosmos.ConsistencyPolicy{
// 			DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelSession),
// 			MaxIntervalInSeconds: to.Ptr[int32](5),
// 			MaxStalenessPrefix: to.Ptr[int64](100),
// 		},
// 		Cors: []*armcosmos.CorsPolicy{
// 		},
// 		CreateMode: to.Ptr(armcosmos.CreateModeDefault),
// 		DatabaseAccountOfferType: to.Ptr("Standard"),
// 		DisableKeyBasedMetadataWriteAccess: to.Ptr(false),
// 		EnableAnalyticalStorage: to.Ptr(false),
// 		EnableFreeTier: to.Ptr(false),
// 		EnableMaterializedViews: to.Ptr(false),
// 		FailoverPolicies: []*armcosmos.FailoverPolicy{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-southcentralus"),
// 				LocationName: to.Ptr("South Central US"),
// 		}},
// 		InstanceID: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"),
// 		IPRules: []*armcosmos.IPAddressOrRange{
// 		},
// 		KeysMetadata: &armcosmos.DatabaseAccountKeysMetadata{
// 			PrimaryMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			SecondaryMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 		},
// 		Locations: []*armcosmos.Location{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-southcentralus"),
// 				IsZoneRedundant: to.Ptr(false),
// 				LocationName: to.Ptr("South Central US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 		}},
// 		MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS),
// 		NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassNone),
// 		NetworkACLBypassResourceIDs: []*string{
// 		},
// 		ProvisioningState: to.Ptr("Succeeded"),
// 		ReadLocations: []*armcosmos.Location{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-southcentralus"),
// 				IsZoneRedundant: to.Ptr(false),
// 				LocationName: to.Ptr("South Central US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 		}},
// 		WriteLocations: []*armcosmos.Location{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-southcentralus"),
// 				IsZoneRedundant: to.Ptr(false),
// 				LocationName: to.Ptr("South Central US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 		}},
// 	},
// 	SystemData: &armcosmos.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()),
// 	},
// }
Output:

Example (CosmosDbRestoreDatabaseAccountCreateUpdateJson)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDatabaseAccountsClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", armcosmos.DatabaseAccountCreateUpdateParameters{
	Location: to.Ptr("westus"),
	Tags:     map[string]*string{},
	Kind:     to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB),
	Properties: &armcosmos.DatabaseAccountCreateUpdateProperties{
		APIProperties: &armcosmos.APIProperties{
			ServerVersion: to.Ptr(armcosmos.ServerVersionThree2),
		},
		BackupPolicy: &armcosmos.ContinuousModeBackupPolicy{
			Type: to.Ptr(armcosmos.BackupPolicyTypeContinuous),
			ContinuousModeProperties: &armcosmos.ContinuousModeProperties{
				Tier: to.Ptr(armcosmos.ContinuousTierContinuous30Days),
			},
		},
		ConsistencyPolicy: &armcosmos.ConsistencyPolicy{
			DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness),
			MaxIntervalInSeconds:    to.Ptr[int32](10),
			MaxStalenessPrefix:      to.Ptr[int64](200),
		},
		CreateMode:               to.Ptr(armcosmos.CreateModeRestore),
		DatabaseAccountOfferType: to.Ptr("Standard"),
		EnableAnalyticalStorage:  to.Ptr(true),
		EnableFreeTier:           to.Ptr(false),
		EnableMaterializedViews:  to.Ptr(false),
		KeyVaultKeyURI:           to.Ptr("https://myKeyVault.vault.azure.net"),
		Locations: []*armcosmos.Location{
			{
				FailoverPriority: to.Ptr[int32](0),
				IsZoneRedundant:  to.Ptr(false),
				LocationName:     to.Ptr("southcentralus"),
			}},
		MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS),
		RestoreParameters: &armcosmos.RestoreParameters{
			RestoreSource:          to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc"),
			RestoreTimestampInUTC:  to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-11T22:05:09.000Z"); return t }()),
			RestoreWithTTLDisabled: to.Ptr(false),
			DatabasesToRestore: []*armcosmos.DatabaseRestoreResource{
				{
					CollectionNames: []*string{
						to.Ptr("collection1"),
						to.Ptr("collection2")},
					DatabaseName: to.Ptr("db1"),
				},
				{
					CollectionNames: []*string{
						to.Ptr("collection3"),
						to.Ptr("collection4")},
					DatabaseName: to.Ptr("db2"),
				}},
			RestoreMode:          to.Ptr(armcosmos.RestoreModePointInTime),
			SourceBackupLocation: to.Ptr("westus"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.DatabaseAccountGetResults = armcosmos.DatabaseAccountGetResults{
// 	Name: to.Ptr("ddb1"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB),
// 	Properties: &armcosmos.DatabaseAccountGetProperties{
// 		APIProperties: &armcosmos.APIProperties{
// 		},
// 		BackupPolicy: &armcosmos.ContinuousModeBackupPolicy{
// 			Type: to.Ptr(armcosmos.BackupPolicyTypeContinuous),
// 			ContinuousModeProperties: &armcosmos.ContinuousModeProperties{
// 				Tier: to.Ptr(armcosmos.ContinuousTierContinuous30Days),
// 			},
// 		},
// 		ConsistencyPolicy: &armcosmos.ConsistencyPolicy{
// 			DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelSession),
// 			MaxIntervalInSeconds: to.Ptr[int32](5),
// 			MaxStalenessPrefix: to.Ptr[int64](100),
// 		},
// 		CreateMode: to.Ptr(armcosmos.CreateModeRestore),
// 		DatabaseAccountOfferType: to.Ptr("Standard"),
// 		DisableKeyBasedMetadataWriteAccess: to.Ptr(false),
// 		EnableAnalyticalStorage: to.Ptr(false),
// 		EnableFreeTier: to.Ptr(false),
// 		EnableMaterializedViews: to.Ptr(false),
// 		FailoverPolicies: []*armcosmos.FailoverPolicy{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-southcentralus"),
// 				LocationName: to.Ptr("South Central US"),
// 		}},
// 		InstanceID: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"),
// 		IPRules: []*armcosmos.IPAddressOrRange{
// 		},
// 		KeysMetadata: &armcosmos.DatabaseAccountKeysMetadata{
// 			PrimaryMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			SecondaryMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 		},
// 		Locations: []*armcosmos.Location{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-southcentralus"),
// 				IsZoneRedundant: to.Ptr(false),
// 				LocationName: to.Ptr("South Central US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 		}},
// 		MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS),
// 		NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassNone),
// 		NetworkACLBypassResourceIDs: []*string{
// 		},
// 		ProvisioningState: to.Ptr("Succeeded"),
// 		ReadLocations: []*armcosmos.Location{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-southcentralus"),
// 				IsZoneRedundant: to.Ptr(false),
// 				LocationName: to.Ptr("South Central US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 		}},
// 		WriteLocations: []*armcosmos.Location{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-southcentralus"),
// 				IsZoneRedundant: to.Ptr(false),
// 				LocationName: to.Ptr("South Central US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 		}},
// 	},
// 	SystemData: &armcosmos.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()),
// 	},
// }
Output:

func (*DatabaseAccountsClient) BeginDelete

BeginDelete - Deletes an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - DatabaseAccountsClientBeginDeleteOptions contains the optional parameters for the DatabaseAccountsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDatabaseAccountsClient().BeginDelete(ctx, "rg1", "ddb1", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*DatabaseAccountsClient) BeginFailoverPriorityChange

func (client *DatabaseAccountsClient) BeginFailoverPriorityChange(ctx context.Context, resourceGroupName string, accountName string, failoverParameters FailoverPolicies, options *DatabaseAccountsClientBeginFailoverPriorityChangeOptions) (*runtime.Poller[DatabaseAccountsClientFailoverPriorityChangeResponse], error)

BeginFailoverPriorityChange - Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • failoverParameters - The new failover policies for the database account.
  • options - DatabaseAccountsClientBeginFailoverPriorityChangeOptions contains the optional parameters for the DatabaseAccountsClient.BeginFailoverPriorityChange method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDatabaseAccountsClient().BeginFailoverPriorityChange(ctx, "rg1", "ddb1-failover", armcosmos.FailoverPolicies{
	FailoverPolicies: []*armcosmos.FailoverPolicy{
		{
			FailoverPriority: to.Ptr[int32](0),
			LocationName:     to.Ptr("eastus"),
		},
		{
			FailoverPriority: to.Ptr[int32](1),
			LocationName:     to.Ptr("westus"),
		}},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*DatabaseAccountsClient) BeginOfflineRegion

func (client *DatabaseAccountsClient) BeginOfflineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOffline RegionForOnlineOffline, options *DatabaseAccountsClientBeginOfflineRegionOptions) (*runtime.Poller[DatabaseAccountsClientOfflineRegionResponse], error)

BeginOfflineRegion - Offline the specified region for the specified Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • regionParameterForOffline - Cosmos DB region to offline for the database account.
  • options - DatabaseAccountsClientBeginOfflineRegionOptions contains the optional parameters for the DatabaseAccountsClient.BeginOfflineRegion method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDatabaseAccountsClient().BeginOfflineRegion(ctx, "rg1", "ddb1", armcosmos.RegionForOnlineOffline{
	Region: to.Ptr("North Europe"),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*DatabaseAccountsClient) BeginOnlineRegion

func (client *DatabaseAccountsClient) BeginOnlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOnline RegionForOnlineOffline, options *DatabaseAccountsClientBeginOnlineRegionOptions) (*runtime.Poller[DatabaseAccountsClientOnlineRegionResponse], error)

BeginOnlineRegion - Online the specified region for the specified Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • regionParameterForOnline - Cosmos DB region to online for the database account.
  • options - DatabaseAccountsClientBeginOnlineRegionOptions contains the optional parameters for the DatabaseAccountsClient.BeginOnlineRegion method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDatabaseAccountsClient().BeginOnlineRegion(ctx, "rg1", "ddb1", armcosmos.RegionForOnlineOffline{
	Region: to.Ptr("North Europe"),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*DatabaseAccountsClient) BeginRegenerateKey

BeginRegenerateKey - Regenerates an access key for the specified Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • keyToRegenerate - The name of the key to regenerate.
  • options - DatabaseAccountsClientBeginRegenerateKeyOptions contains the optional parameters for the DatabaseAccountsClient.BeginRegenerateKey method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDatabaseAccountsClient().BeginRegenerateKey(ctx, "rg1", "ddb1", armcosmos.DatabaseAccountRegenerateKeyParameters{
	KeyKind: to.Ptr(armcosmos.KeyKindPrimary),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*DatabaseAccountsClient) BeginUpdate

BeginUpdate - Updates the properties of an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • updateParameters - The parameters to provide for the current database account.
  • options - DatabaseAccountsClientBeginUpdateOptions contains the optional parameters for the DatabaseAccountsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountPatch.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDatabaseAccountsClient().BeginUpdate(ctx, "rg1", "ddb1", armcosmos.DatabaseAccountUpdateParameters{
	Identity: &armcosmos.ManagedServiceIdentity{
		Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned),
		UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
			"/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
		},
	},
	Location: to.Ptr("westus"),
	Properties: &armcosmos.DatabaseAccountUpdateProperties{
		AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{
			SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined),
		},
		BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{
			Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic),
			PeriodicModeProperties: &armcosmos.PeriodicModeProperties{
				BackupIntervalInMinutes:        to.Ptr[int32](240),
				BackupRetentionIntervalInHours: to.Ptr[int32](720),
				BackupStorageRedundancy:        to.Ptr(armcosmos.BackupStorageRedundancyGeo),
			},
		},
		Capacity: &armcosmos.Capacity{
			TotalThroughputLimit: to.Ptr[int32](2000),
		},
		ConsistencyPolicy: &armcosmos.ConsistencyPolicy{
			DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness),
			MaxIntervalInSeconds:    to.Ptr[int32](10),
			MaxStalenessPrefix:      to.Ptr[int64](200),
		},
		DefaultIdentity:      to.Ptr("FirstPartyIdentity"),
		DefaultPriorityLevel: to.Ptr(armcosmos.DefaultPriorityLevelLow),
		DiagnosticLogSettings: &armcosmos.DiagnosticLogSettings{
			EnableFullTextQuery: to.Ptr(armcosmos.EnableFullTextQueryTrue),
		},
		EnableAnalyticalStorage:              to.Ptr(true),
		EnableBurstCapacity:                  to.Ptr(true),
		EnableFreeTier:                       to.Ptr(false),
		EnablePartitionMerge:                 to.Ptr(true),
		EnablePerRegionPerPartitionAutoscale: to.Ptr(true),
		EnablePriorityBasedExecution:         to.Ptr(true),
		IPRules: []*armcosmos.IPAddressOrRange{
			{
				IPAddressOrRange: to.Ptr("23.43.230.120"),
			},
			{
				IPAddressOrRange: to.Ptr("110.12.240.0/12"),
			}},
		IsVirtualNetworkFilterEnabled: to.Ptr(true),
		MinimalTLSVersion:             to.Ptr(armcosmos.MinimalTLSVersionTLS),
		NetworkACLBypass:              to.Ptr(armcosmos.NetworkACLBypassAzureServices),
		NetworkACLBypassResourceIDs: []*string{
			to.Ptr("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")},
		VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{
			{
				ID:                               to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
				IgnoreMissingVNetServiceEndpoint: to.Ptr(false),
			}},
	},
	Tags: map[string]*string{
		"dept": to.Ptr("finance"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.DatabaseAccountGetResults = armcosmos.DatabaseAccountGetResults{
// 	Name: to.Ptr("ddb1"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"),
// 	Identity: &armcosmos.ManagedServiceIdentity{
// 		Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned),
// 		PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"),
// 		TenantID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"),
// 		UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
// 			"/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
// 				ClientID: to.Ptr("fbe75b66-01c5-4f87-a220-233af3270436"),
// 				PrincipalID: to.Ptr("075a0ca6-43f6-4434-9abf-c9b1b79f9219"),
// 			},
// 		},
// 	},
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 		"dept": to.Ptr("finance"),
// 	},
// 	Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB),
// 	Properties: &armcosmos.DatabaseAccountGetProperties{
// 		AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{
// 			SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined),
// 		},
// 		APIProperties: &armcosmos.APIProperties{
// 		},
// 		BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{
// 			Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic),
// 			PeriodicModeProperties: &armcosmos.PeriodicModeProperties{
// 				BackupIntervalInMinutes: to.Ptr[int32](240),
// 				BackupRetentionIntervalInHours: to.Ptr[int32](720),
// 				BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo),
// 			},
// 		},
// 		Capacity: &armcosmos.Capacity{
// 			TotalThroughputLimit: to.Ptr[int32](2000),
// 		},
// 		ConsistencyPolicy: &armcosmos.ConsistencyPolicy{
// 			DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness),
// 			MaxIntervalInSeconds: to.Ptr[int32](10),
// 			MaxStalenessPrefix: to.Ptr[int64](200),
// 		},
// 		Cors: []*armcosmos.CorsPolicy{
// 		},
// 		CreateMode: to.Ptr(armcosmos.CreateModeDefault),
// 		DatabaseAccountOfferType: to.Ptr("Standard"),
// 		DefaultIdentity: to.Ptr("FirstPartyIdentity"),
// 		DefaultPriorityLevel: to.Ptr(armcosmos.DefaultPriorityLevelLow),
// 		DiagnosticLogSettings: &armcosmos.DiagnosticLogSettings{
// 			EnableFullTextQuery: to.Ptr(armcosmos.EnableFullTextQueryTrue),
// 		},
// 		DisableKeyBasedMetadataWriteAccess: to.Ptr(false),
// 		DocumentEndpoint: to.Ptr("https://ddb1.documents.azure.com:443/"),
// 		EnableAnalyticalStorage: to.Ptr(true),
// 		EnableBurstCapacity: to.Ptr(true),
// 		EnableFreeTier: to.Ptr(false),
// 		EnableMaterializedViews: to.Ptr(false),
// 		EnablePerRegionPerPartitionAutoscale: to.Ptr(true),
// 		EnablePriorityBasedExecution: to.Ptr(true),
// 		FailoverPolicies: []*armcosmos.FailoverPolicy{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-eastus"),
// 				LocationName: to.Ptr("East US"),
// 		}},
// 		InstanceID: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"),
// 		IPRules: []*armcosmos.IPAddressOrRange{
// 			{
// 				IPAddressOrRange: to.Ptr("23.43.230.120"),
// 			},
// 			{
// 				IPAddressOrRange: to.Ptr("110.12.240.0/12"),
// 		}},
// 		IsVirtualNetworkFilterEnabled: to.Ptr(true),
// 		KeysMetadata: &armcosmos.DatabaseAccountKeysMetadata{
// 			PrimaryMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			SecondaryMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 		},
// 		Locations: []*armcosmos.Location{
// 			{
// 				DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-eastus"),
// 				LocationName: to.Ptr("East US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 		}},
// 		MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS),
// 		NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassAzureServices),
// 		NetworkACLBypassResourceIDs: []*string{
// 			to.Ptr("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")},
// 			PrivateEndpointConnections: []*armcosmos.PrivateEndpointConnection{
// 				{
// 					ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.DocumentDB/databaseAccounts/account1/privateEndpointConnections/pe1"),
// 					Properties: &armcosmos.PrivateEndpointConnectionProperties{
// 						PrivateEndpoint: &armcosmos.PrivateEndpointProperty{
// 							ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/privateEndpoints/pe1"),
// 						},
// 						PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{
// 							ActionsRequired: to.Ptr("None"),
// 							Status: to.Ptr("Approved"),
// 						},
// 					},
// 			}},
// 			ProvisioningState: to.Ptr("Succeeded"),
// 			ReadLocations: []*armcosmos.Location{
// 				{
// 					DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
// 					FailoverPriority: to.Ptr[int32](0),
// 					ID: to.Ptr("ddb1-eastus"),
// 					LocationName: to.Ptr("East US"),
// 					ProvisioningState: to.Ptr("Succeeded"),
// 			}},
// 			VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{
// 				{
// 					ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
// 					IgnoreMissingVNetServiceEndpoint: to.Ptr(false),
// 			}},
// 			WriteLocations: []*armcosmos.Location{
// 				{
// 					DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
// 					FailoverPriority: to.Ptr[int32](0),
// 					ID: to.Ptr("ddb1-eastus"),
// 					LocationName: to.Ptr("East US"),
// 					ProvisioningState: to.Ptr("Succeeded"),
// 			}},
// 		},
// 		SystemData: &armcosmos.SystemData{
// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()),
// 		},
// 	}
Output:

func (*DatabaseAccountsClient) CheckNameExists

CheckNameExists - Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.

Generated from API version 2024-02-15-preview

  • accountName - Cosmos DB database account name.
  • options - DatabaseAccountsClientCheckNameExistsOptions contains the optional parameters for the DatabaseAccountsClient.CheckNameExists method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json

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

func (*DatabaseAccountsClient) Get

Get - Retrieves the properties of an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - DatabaseAccountsClientGetOptions contains the optional parameters for the DatabaseAccountsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDatabaseAccountsClient().Get(ctx, "rg1", "ddb1", 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.DatabaseAccountGetResults = armcosmos.DatabaseAccountGetResults{
// 	Name: to.Ptr("ddb1"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"),
// 	Identity: &armcosmos.ManagedServiceIdentity{
// 		Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned),
// 		PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"),
// 		TenantID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"),
// 		UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
// 			"/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
// 				ClientID: to.Ptr("fbe75b66-01c5-4f87-a220-233af3270436"),
// 				PrincipalID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"),
// 			},
// 		},
// 	},
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB),
// 	Properties: &armcosmos.DatabaseAccountGetProperties{
// 		AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{
// 			SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined),
// 		},
// 		APIProperties: &armcosmos.APIProperties{
// 		},
// 		BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{
// 			Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic),
// 			MigrationState: &armcosmos.BackupPolicyMigrationState{
// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T21:07:16.000Z"); return t}()),
// 				Status: to.Ptr(armcosmos.BackupPolicyMigrationStatusInProgress),
// 				TargetType: to.Ptr(armcosmos.BackupPolicyTypeContinuous),
// 			},
// 			PeriodicModeProperties: &armcosmos.PeriodicModeProperties{
// 				BackupIntervalInMinutes: to.Ptr[int32](240),
// 				BackupRetentionIntervalInHours: to.Ptr[int32](8),
// 				BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo),
// 			},
// 		},
// 		ConsistencyPolicy: &armcosmos.ConsistencyPolicy{
// 			DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelSession),
// 			MaxIntervalInSeconds: to.Ptr[int32](5),
// 			MaxStalenessPrefix: to.Ptr[int64](100),
// 		},
// 		Cors: []*armcosmos.CorsPolicy{
// 		},
// 		CreateMode: to.Ptr(armcosmos.CreateModeDefault),
// 		DatabaseAccountOfferType: to.Ptr("Standard"),
// 		DefaultIdentity: to.Ptr("FirstPartyIdentity"),
// 		DefaultPriorityLevel: to.Ptr(armcosmos.DefaultPriorityLevelLow),
// 		DiagnosticLogSettings: &armcosmos.DiagnosticLogSettings{
// 			EnableFullTextQuery: to.Ptr(armcosmos.EnableFullTextQueryFalse),
// 		},
// 		DisableKeyBasedMetadataWriteAccess: to.Ptr(false),
// 		DocumentEndpoint: to.Ptr("https://ddb1.documents.azure.com:443/"),
// 		EnableAnalyticalStorage: to.Ptr(true),
// 		EnableBurstCapacity: to.Ptr(true),
// 		EnableFreeTier: to.Ptr(false),
// 		EnableMaterializedViews: to.Ptr(false),
// 		EnablePartitionMerge: to.Ptr(true),
// 		EnablePerRegionPerPartitionAutoscale: to.Ptr(true),
// 		EnablePriorityBasedExecution: to.Ptr(true),
// 		FailoverPolicies: []*armcosmos.FailoverPolicy{
// 			{
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-eastus"),
// 				LocationName: to.Ptr("East US"),
// 		}},
// 		InstanceID: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"),
// 		IPRules: []*armcosmos.IPAddressOrRange{
// 		},
// 		IsVirtualNetworkFilterEnabled: to.Ptr(false),
// 		KeysMetadata: &armcosmos.DatabaseAccountKeysMetadata{
// 			PrimaryMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			SecondaryMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 			SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
// 				GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
// 			},
// 		},
// 		Locations: []*armcosmos.Location{
// 			{
// 				DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-eastus"),
// 				LocationName: to.Ptr("East US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 		}},
// 		MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS),
// 		NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassNone),
// 		NetworkACLBypassResourceIDs: []*string{
// 		},
// 		PrivateEndpointConnections: []*armcosmos.PrivateEndpointConnection{
// 			{
// 				ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.DocumentDB/databaseAccounts/account1/privateEndpointConnections/pe1"),
// 				Properties: &armcosmos.PrivateEndpointConnectionProperties{
// 					PrivateEndpoint: &armcosmos.PrivateEndpointProperty{
// 						ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/privateEndpoints/pe1"),
// 					},
// 					PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{
// 						ActionsRequired: to.Ptr("None"),
// 						Status: to.Ptr("Approved"),
// 					},
// 				},
// 		}},
// 		ProvisioningState: to.Ptr("Succeeded"),
// 		ReadLocations: []*armcosmos.Location{
// 			{
// 				DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-eastus"),
// 				LocationName: to.Ptr("East US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 		}},
// 		VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{
// 		},
// 		WriteLocations: []*armcosmos.Location{
// 			{
// 				DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
// 				FailoverPriority: to.Ptr[int32](0),
// 				ID: to.Ptr("ddb1-eastus"),
// 				LocationName: to.Ptr("East US"),
// 				ProvisioningState: to.Ptr("Succeeded"),
// 		}},
// 	},
// }
Output:

func (*DatabaseAccountsClient) GetReadOnlyKeys

GetReadOnlyKeys - Lists the read-only access keys for the specified Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - DatabaseAccountsClientGetReadOnlyKeysOptions contains the optional parameters for the DatabaseAccountsClient.GetReadOnlyKeys method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDatabaseAccountsClient().GetReadOnlyKeys(ctx, "rg1", "ddb1", 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.DatabaseAccountListReadOnlyKeysResult = armcosmos.DatabaseAccountListReadOnlyKeysResult{
// 	PrimaryReadonlyMasterKey: to.Ptr("primaryReadonlyMasterKey"),
// 	SecondaryReadonlyMasterKey: to.Ptr("secondaryReadonlyMasterKey"),
// }
Output:

func (*DatabaseAccountsClient) ListConnectionStrings

ListConnectionStrings - Lists the connection strings for the specified Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - DatabaseAccountsClientListConnectionStringsOptions contains the optional parameters for the DatabaseAccountsClient.ListConnectionStrings method.
Example (CosmosDbDatabaseAccountListConnectionStrings)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDatabaseAccountsClient().ListConnectionStrings(ctx, "rg1", "ddb1", 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.DatabaseAccountListConnectionStringsResult = armcosmos.DatabaseAccountListConnectionStringsResult{
// 	ConnectionStrings: []*armcosmos.DatabaseAccountConnectionString{
// 		{
// 			Type: to.Ptr(armcosmos.TypeSQL),
// 			Description: to.Ptr("Primary SQL Connection String"),
// 			ConnectionString: to.Ptr("connection-string"),
// 			KeyKind: to.Ptr(armcosmos.KindPrimary),
// 	}},
// }
Output:

Example (CosmosDbDatabaseAccountListConnectionStringsMongo)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDatabaseAccountsClient().ListConnectionStrings(ctx, "rg1", "mongo-ddb1", 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.DatabaseAccountListConnectionStringsResult = armcosmos.DatabaseAccountListConnectionStringsResult{
// 	ConnectionStrings: []*armcosmos.DatabaseAccountConnectionString{
// 		{
// 			Description: to.Ptr("Name of the connection string"),
// 			ConnectionString: to.Ptr("connection-string"),
// 	}},
// }
Output:

func (*DatabaseAccountsClient) ListKeys

ListKeys - Lists the access keys for the specified Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - DatabaseAccountsClientListKeysOptions contains the optional parameters for the DatabaseAccountsClient.ListKeys method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountListKeys.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDatabaseAccountsClient().ListKeys(ctx, "rg1", "ddb1", 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.DatabaseAccountListKeysResult = armcosmos.DatabaseAccountListKeysResult{
// 	PrimaryReadonlyMasterKey: to.Ptr("primaryReadonlyMasterKey"),
// 	SecondaryReadonlyMasterKey: to.Ptr("secondaryReadonlyMasterKey"),
// 	PrimaryMasterKey: to.Ptr("primaryMasterKey"),
// 	SecondaryMasterKey: to.Ptr("secondaryMasterKey"),
// }
Output:

func (*DatabaseAccountsClient) ListReadOnlyKeys

ListReadOnlyKeys - Lists the read-only access keys for the specified Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - DatabaseAccountsClientListReadOnlyKeysOptions contains the optional parameters for the DatabaseAccountsClient.ListReadOnlyKeys method.

func (*DatabaseAccountsClient) NewListByResourceGroupPager

NewListByResourceGroupPager - Lists all the Azure Cosmos DB database accounts available under the given resource group.

Generated from API version 2024-02-15-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDatabaseAccountsClient().NewListByResourceGroupPager("rg1", 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.DatabaseAccountsListResult = armcosmos.DatabaseAccountsListResult{
	// 	Value: []*armcosmos.DatabaseAccountGetResults{
	// 		{
	// 			Name: to.Ptr("ddb1"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"),
	// 			Identity: &armcosmos.ManagedServiceIdentity{
	// 				Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned),
	// 				PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"),
	// 				TenantID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"),
	// 				UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 					"/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 						ClientID: to.Ptr("fbe75b66-01c5-4f87-a220-233af3270436"),
	// 						PrincipalID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"),
	// 					},
	// 				},
	// 			},
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB),
	// 			Properties: &armcosmos.DatabaseAccountGetProperties{
	// 				BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{
	// 					Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic),
	// 					PeriodicModeProperties: &armcosmos.PeriodicModeProperties{
	// 						BackupIntervalInMinutes: to.Ptr[int32](240),
	// 						BackupRetentionIntervalInHours: to.Ptr[int32](720),
	// 						BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo),
	// 					},
	// 				},
	// 				ConsistencyPolicy: &armcosmos.ConsistencyPolicy{
	// 					DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelSession),
	// 					MaxIntervalInSeconds: to.Ptr[int32](5),
	// 					MaxStalenessPrefix: to.Ptr[int64](100),
	// 				},
	// 				Cors: []*armcosmos.CorsPolicy{
	// 				},
	// 				CreateMode: to.Ptr(armcosmos.CreateModeDefault),
	// 				DatabaseAccountOfferType: to.Ptr("Standard"),
	// 				DefaultIdentity: to.Ptr("FirstPartyIdentity"),
	// 				DisableKeyBasedMetadataWriteAccess: to.Ptr(false),
	// 				DocumentEndpoint: to.Ptr("https://ddb1.documents.azure.com:443/"),
	// 				EnableFreeTier: to.Ptr(false),
	// 				EnableMaterializedViews: to.Ptr(false),
	// 				FailoverPolicies: []*armcosmos.FailoverPolicy{
	// 					{
	// 						FailoverPriority: to.Ptr[int32](0),
	// 						ID: to.Ptr("ddb1-eastus"),
	// 						LocationName: to.Ptr("East US"),
	// 				}},
	// 				InstanceID: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"),
	// 				IPRules: []*armcosmos.IPAddressOrRange{
	// 				},
	// 				KeysMetadata: &armcosmos.DatabaseAccountKeysMetadata{
	// 					PrimaryMasterKey: &armcosmos.AccountKeyMetadata{
	// 						GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
	// 					},
	// 					PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
	// 						GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
	// 					},
	// 					SecondaryMasterKey: &armcosmos.AccountKeyMetadata{
	// 						GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
	// 					},
	// 					SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
	// 						GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
	// 					},
	// 				},
	// 				Locations: []*armcosmos.Location{
	// 					{
	// 						DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
	// 						FailoverPriority: to.Ptr[int32](0),
	// 						ID: to.Ptr("ddb1-eastus"),
	// 						LocationName: to.Ptr("East US"),
	// 						ProvisioningState: to.Ptr("Succeeded"),
	// 				}},
	// 				MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS),
	// 				NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassNone),
	// 				NetworkACLBypassResourceIDs: []*string{
	// 				},
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 				ReadLocations: []*armcosmos.Location{
	// 					{
	// 						DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
	// 						FailoverPriority: to.Ptr[int32](0),
	// 						ID: to.Ptr("ddb1-eastus"),
	// 						LocationName: to.Ptr("East US"),
	// 						ProvisioningState: to.Ptr("Succeeded"),
	// 				}},
	// 				WriteLocations: []*armcosmos.Location{
	// 					{
	// 						DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
	// 						FailoverPriority: to.Ptr[int32](0),
	// 						ID: to.Ptr("ddb1-eastus"),
	// 						LocationName: to.Ptr("East US"),
	// 						ProvisioningState: to.Ptr("Succeeded"),
	// 				}},
	// 			},
	// 			SystemData: &armcosmos.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()),
	// 			},
	// 	}},
	// }
}
Output:

func (*DatabaseAccountsClient) NewListMetricDefinitionsPager

NewListMetricDefinitionsPager - Retrieves metric definitions for the given database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - DatabaseAccountsClientListMetricDefinitionsOptions contains the optional parameters for the DatabaseAccountsClient.NewListMetricDefinitionsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDatabaseAccountsClient().NewListMetricDefinitionsPager("rg1", "ddb1", 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.MetricDefinitionsListResult = armcosmos.MetricDefinitionsListResult{
	// 	Value: []*armcosmos.MetricDefinition{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Total Requests"),
	// 				Value: to.Ptr("Total Requests"),
	// 			},
	// 			MetricAvailabilities: []*armcosmos.MetricAvailability{
	// 				{
	// 					Retention: to.Ptr("P2D"),
	// 					TimeGrain: to.Ptr("PT5M"),
	// 				},
	// 				{
	// 					Retention: to.Ptr("P14D"),
	// 					TimeGrain: to.Ptr("PT1H"),
	// 				},
	// 				{
	// 					Retention: to.Ptr("P60D"),
	// 					TimeGrain: to.Ptr("P1D"),
	// 			}},
	// 			PrimaryAggregationType: to.Ptr(armcosmos.PrimaryAggregationTypeTotal),
	// 			ResourceURI: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 	}},
	// }
}
Output:

func (*DatabaseAccountsClient) NewListMetricsPager

func (client *DatabaseAccountsClient) NewListMetricsPager(resourceGroupName string, accountName string, filter string, options *DatabaseAccountsClientListMetricsOptions) *runtime.Pager[DatabaseAccountsClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - DatabaseAccountsClientListMetricsOptions contains the optional parameters for the DatabaseAccountsClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDatabaseAccountsClient().NewListMetricsPager("rg1", "ddb1", "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", 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.MetricListResult = armcosmos.MetricListResult{
	// 	Value: []*armcosmos.Metric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Total Requests"),
	// 				Value: to.Ptr("Total Requests"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.MetricValue{
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:03:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:08:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT5M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 	}},
	// }
}
Output:

func (*DatabaseAccountsClient) NewListPager

NewListPager - Lists all the Azure Cosmos DB database accounts available under the subscription.

Generated from API version 2024-02-15-preview

  • options - DatabaseAccountsClientListOptions contains the optional parameters for the DatabaseAccountsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDatabaseAccountsClient().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.DatabaseAccountsListResult = armcosmos.DatabaseAccountsListResult{
	// 	Value: []*armcosmos.DatabaseAccountGetResults{
	// 		{
	// 			Name: to.Ptr("ddb1"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"),
	// 			Identity: &armcosmos.ManagedServiceIdentity{
	// 				Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned),
	// 				PrincipalID: to.Ptr("52f4fef3-3c3f-4ff3-b52e-b5c9eeb68656"),
	// 				TenantID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"),
	// 				UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 					"/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 						ClientID: to.Ptr("fbe75b66-01c5-4f87-a220-233af3270436"),
	// 						PrincipalID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"),
	// 					},
	// 				},
	// 			},
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Kind: to.Ptr(armcosmos.DatabaseAccountKindGlobalDocumentDB),
	// 			Properties: &armcosmos.DatabaseAccountGetProperties{
	// 				AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{
	// 					SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined),
	// 				},
	// 				APIProperties: &armcosmos.APIProperties{
	// 				},
	// 				BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{
	// 					Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic),
	// 					PeriodicModeProperties: &armcosmos.PeriodicModeProperties{
	// 						BackupIntervalInMinutes: to.Ptr[int32](240),
	// 						BackupRetentionIntervalInHours: to.Ptr[int32](720),
	// 						BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo),
	// 					},
	// 				},
	// 				ConsistencyPolicy: &armcosmos.ConsistencyPolicy{
	// 					DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelSession),
	// 					MaxIntervalInSeconds: to.Ptr[int32](5),
	// 					MaxStalenessPrefix: to.Ptr[int64](100),
	// 				},
	// 				Cors: []*armcosmos.CorsPolicy{
	// 				},
	// 				CreateMode: to.Ptr(armcosmos.CreateModeDefault),
	// 				DatabaseAccountOfferType: to.Ptr("Standard"),
	// 				DefaultIdentity: to.Ptr("FirstPartyIdentity"),
	// 				DefaultPriorityLevel: to.Ptr(armcosmos.DefaultPriorityLevelLow),
	// 				DisableKeyBasedMetadataWriteAccess: to.Ptr(false),
	// 				DocumentEndpoint: to.Ptr("https://ddb1.documents.azure.com:443/"),
	// 				EnableAnalyticalStorage: to.Ptr(true),
	// 				EnableBurstCapacity: to.Ptr(true),
	// 				EnableFreeTier: to.Ptr(false),
	// 				EnableMaterializedViews: to.Ptr(false),
	// 				EnablePartitionMerge: to.Ptr(true),
	// 				EnablePerRegionPerPartitionAutoscale: to.Ptr(true),
	// 				EnablePriorityBasedExecution: to.Ptr(true),
	// 				FailoverPolicies: []*armcosmos.FailoverPolicy{
	// 					{
	// 						FailoverPriority: to.Ptr[int32](0),
	// 						ID: to.Ptr("ddb1-eastus"),
	// 						LocationName: to.Ptr("East US"),
	// 				}},
	// 				InstanceID: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"),
	// 				IPRules: []*armcosmos.IPAddressOrRange{
	// 				},
	// 				KeysMetadata: &armcosmos.DatabaseAccountKeysMetadata{
	// 					PrimaryMasterKey: &armcosmos.AccountKeyMetadata{
	// 						GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
	// 					},
	// 					PrimaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
	// 						GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
	// 					},
	// 					SecondaryMasterKey: &armcosmos.AccountKeyMetadata{
	// 						GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
	// 					},
	// 					SecondaryReadonlyMasterKey: &armcosmos.AccountKeyMetadata{
	// 						GenerationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-25T20:30:11.000Z"); return t}()),
	// 					},
	// 				},
	// 				Locations: []*armcosmos.Location{
	// 					{
	// 						DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
	// 						FailoverPriority: to.Ptr[int32](0),
	// 						ID: to.Ptr("ddb1-eastus"),
	// 						LocationName: to.Ptr("East US"),
	// 						ProvisioningState: to.Ptr("Succeeded"),
	// 				}},
	// 				MinimalTLSVersion: to.Ptr(armcosmos.MinimalTLSVersionTLS),
	// 				NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassNone),
	// 				NetworkACLBypassResourceIDs: []*string{
	// 				},
	// 				PrivateEndpointConnections: []*armcosmos.PrivateEndpointConnection{
	// 					{
	// 						ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.DocumentDB/databaseAccounts/account1/privateEndpointConnections/pe1"),
	// 						Properties: &armcosmos.PrivateEndpointConnectionProperties{
	// 							PrivateEndpoint: &armcosmos.PrivateEndpointProperty{
	// 								ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/privateEndpoints/pe1"),
	// 							},
	// 							PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{
	// 								ActionsRequired: to.Ptr("None"),
	// 								Status: to.Ptr("Approved"),
	// 							},
	// 						},
	// 				}},
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 				ReadLocations: []*armcosmos.Location{
	// 					{
	// 						DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
	// 						FailoverPriority: to.Ptr[int32](0),
	// 						ID: to.Ptr("ddb1-eastus"),
	// 						LocationName: to.Ptr("East US"),
	// 						ProvisioningState: to.Ptr("Succeeded"),
	// 				}},
	// 				WriteLocations: []*armcosmos.Location{
	// 					{
	// 						DocumentEndpoint: to.Ptr("https://ddb1-eastus.documents.azure.com:443/"),
	// 						FailoverPriority: to.Ptr[int32](0),
	// 						ID: to.Ptr("ddb1-eastus"),
	// 						LocationName: to.Ptr("East US"),
	// 						ProvisioningState: to.Ptr("Succeeded"),
	// 				}},
	// 			},
	// 			SystemData: &armcosmos.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()),
	// 			},
	// 	}},
	// }
}
Output:

func (*DatabaseAccountsClient) NewListUsagesPager

func (client *DatabaseAccountsClient) NewListUsagesPager(resourceGroupName string, accountName string, options *DatabaseAccountsClientListUsagesOptions) *runtime.Pager[DatabaseAccountsClientListUsagesResponse]

NewListUsagesPager - Retrieves the usages (most recent data) for the given database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - DatabaseAccountsClientListUsagesOptions contains the optional parameters for the DatabaseAccountsClient.NewListUsagesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseAccountGetUsages.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDatabaseAccountsClient().NewListUsagesPager("rg1", "ddb1", &armcosmos.DatabaseAccountsClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Storage'")})
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.UsagesResult = armcosmos.UsagesResult{
	// 	Value: []*armcosmos.Usage{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Storage"),
	// 				Value: to.Ptr("Storage"),
	// 			},
	// 			CurrentValue: to.Ptr[int64](0),
	// 			Limit: to.Ptr[int64](10737418240),
	// 			QuotaPeriod: to.Ptr("P1D"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeBytes),
	// 	}},
	// }
}
Output:

type DatabaseAccountsClientBeginCreateOrUpdateOptions

type DatabaseAccountsClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

DatabaseAccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseAccountsClient.BeginCreateOrUpdate method.

type DatabaseAccountsClientBeginDeleteOptions

type DatabaseAccountsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

DatabaseAccountsClientBeginDeleteOptions contains the optional parameters for the DatabaseAccountsClient.BeginDelete method.

type DatabaseAccountsClientBeginFailoverPriorityChangeOptions

type DatabaseAccountsClientBeginFailoverPriorityChangeOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

DatabaseAccountsClientBeginFailoverPriorityChangeOptions contains the optional parameters for the DatabaseAccountsClient.BeginFailoverPriorityChange method.

type DatabaseAccountsClientBeginOfflineRegionOptions

type DatabaseAccountsClientBeginOfflineRegionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

DatabaseAccountsClientBeginOfflineRegionOptions contains the optional parameters for the DatabaseAccountsClient.BeginOfflineRegion method.

type DatabaseAccountsClientBeginOnlineRegionOptions

type DatabaseAccountsClientBeginOnlineRegionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

DatabaseAccountsClientBeginOnlineRegionOptions contains the optional parameters for the DatabaseAccountsClient.BeginOnlineRegion method.

type DatabaseAccountsClientBeginRegenerateKeyOptions

type DatabaseAccountsClientBeginRegenerateKeyOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

DatabaseAccountsClientBeginRegenerateKeyOptions contains the optional parameters for the DatabaseAccountsClient.BeginRegenerateKey method.

type DatabaseAccountsClientBeginUpdateOptions

type DatabaseAccountsClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

DatabaseAccountsClientBeginUpdateOptions contains the optional parameters for the DatabaseAccountsClient.BeginUpdate method.

type DatabaseAccountsClientCheckNameExistsOptions

type DatabaseAccountsClientCheckNameExistsOptions struct {
}

DatabaseAccountsClientCheckNameExistsOptions contains the optional parameters for the DatabaseAccountsClient.CheckNameExists method.

type DatabaseAccountsClientCheckNameExistsResponse

type DatabaseAccountsClientCheckNameExistsResponse struct {
	// Success indicates if the operation succeeded or failed.
	Success bool
}

DatabaseAccountsClientCheckNameExistsResponse contains the response from method DatabaseAccountsClient.CheckNameExists.

type DatabaseAccountsClientCreateOrUpdateResponse

type DatabaseAccountsClientCreateOrUpdateResponse struct {
	// An Azure Cosmos DB database account.
	DatabaseAccountGetResults
}

DatabaseAccountsClientCreateOrUpdateResponse contains the response from method DatabaseAccountsClient.BeginCreateOrUpdate.

type DatabaseAccountsClientDeleteResponse

type DatabaseAccountsClientDeleteResponse struct {
}

DatabaseAccountsClientDeleteResponse contains the response from method DatabaseAccountsClient.BeginDelete.

type DatabaseAccountsClientFailoverPriorityChangeResponse

type DatabaseAccountsClientFailoverPriorityChangeResponse struct {
}

DatabaseAccountsClientFailoverPriorityChangeResponse contains the response from method DatabaseAccountsClient.BeginFailoverPriorityChange.

type DatabaseAccountsClientGetOptions

type DatabaseAccountsClientGetOptions struct {
}

DatabaseAccountsClientGetOptions contains the optional parameters for the DatabaseAccountsClient.Get method.

type DatabaseAccountsClientGetReadOnlyKeysOptions

type DatabaseAccountsClientGetReadOnlyKeysOptions struct {
}

DatabaseAccountsClientGetReadOnlyKeysOptions contains the optional parameters for the DatabaseAccountsClient.GetReadOnlyKeys method.

type DatabaseAccountsClientGetReadOnlyKeysResponse

type DatabaseAccountsClientGetReadOnlyKeysResponse struct {
	// The read-only access keys for the given database account.
	DatabaseAccountListReadOnlyKeysResult
}

DatabaseAccountsClientGetReadOnlyKeysResponse contains the response from method DatabaseAccountsClient.GetReadOnlyKeys.

type DatabaseAccountsClientGetResponse

type DatabaseAccountsClientGetResponse struct {
	// An Azure Cosmos DB database account.
	DatabaseAccountGetResults
}

DatabaseAccountsClientGetResponse contains the response from method DatabaseAccountsClient.Get.

type DatabaseAccountsClientListByResourceGroupOptions

type DatabaseAccountsClientListByResourceGroupOptions struct {
}

DatabaseAccountsClientListByResourceGroupOptions contains the optional parameters for the DatabaseAccountsClient.NewListByResourceGroupPager method.

type DatabaseAccountsClientListByResourceGroupResponse

type DatabaseAccountsClientListByResourceGroupResponse struct {
	// The List operation response, that contains the database accounts and their properties.
	DatabaseAccountsListResult
}

DatabaseAccountsClientListByResourceGroupResponse contains the response from method DatabaseAccountsClient.NewListByResourceGroupPager.

type DatabaseAccountsClientListConnectionStringsOptions

type DatabaseAccountsClientListConnectionStringsOptions struct {
}

DatabaseAccountsClientListConnectionStringsOptions contains the optional parameters for the DatabaseAccountsClient.ListConnectionStrings method.

type DatabaseAccountsClientListConnectionStringsResponse

type DatabaseAccountsClientListConnectionStringsResponse struct {
	// The connection strings for the given database account.
	DatabaseAccountListConnectionStringsResult
}

DatabaseAccountsClientListConnectionStringsResponse contains the response from method DatabaseAccountsClient.ListConnectionStrings.

type DatabaseAccountsClientListKeysOptions

type DatabaseAccountsClientListKeysOptions struct {
}

DatabaseAccountsClientListKeysOptions contains the optional parameters for the DatabaseAccountsClient.ListKeys method.

type DatabaseAccountsClientListKeysResponse

type DatabaseAccountsClientListKeysResponse struct {
	// The access keys for the given database account.
	DatabaseAccountListKeysResult
}

DatabaseAccountsClientListKeysResponse contains the response from method DatabaseAccountsClient.ListKeys.

type DatabaseAccountsClientListMetricDefinitionsOptions

type DatabaseAccountsClientListMetricDefinitionsOptions struct {
}

DatabaseAccountsClientListMetricDefinitionsOptions contains the optional parameters for the DatabaseAccountsClient.NewListMetricDefinitionsPager method.

type DatabaseAccountsClientListMetricDefinitionsResponse

type DatabaseAccountsClientListMetricDefinitionsResponse struct {
	// The response to a list metric definitions request.
	MetricDefinitionsListResult
}

DatabaseAccountsClientListMetricDefinitionsResponse contains the response from method DatabaseAccountsClient.NewListMetricDefinitionsPager.

type DatabaseAccountsClientListMetricsOptions

type DatabaseAccountsClientListMetricsOptions struct {
}

DatabaseAccountsClientListMetricsOptions contains the optional parameters for the DatabaseAccountsClient.NewListMetricsPager method.

type DatabaseAccountsClientListMetricsResponse

type DatabaseAccountsClientListMetricsResponse struct {
	// The response to a list metrics request.
	MetricListResult
}

DatabaseAccountsClientListMetricsResponse contains the response from method DatabaseAccountsClient.NewListMetricsPager.

type DatabaseAccountsClientListOptions

type DatabaseAccountsClientListOptions struct {
}

DatabaseAccountsClientListOptions contains the optional parameters for the DatabaseAccountsClient.NewListPager method.

type DatabaseAccountsClientListReadOnlyKeysOptions

type DatabaseAccountsClientListReadOnlyKeysOptions struct {
}

DatabaseAccountsClientListReadOnlyKeysOptions contains the optional parameters for the DatabaseAccountsClient.ListReadOnlyKeys method.

type DatabaseAccountsClientListReadOnlyKeysResponse

type DatabaseAccountsClientListReadOnlyKeysResponse struct {
	// The read-only access keys for the given database account.
	DatabaseAccountListReadOnlyKeysResult
}

DatabaseAccountsClientListReadOnlyKeysResponse contains the response from method DatabaseAccountsClient.ListReadOnlyKeys.

type DatabaseAccountsClientListResponse

type DatabaseAccountsClientListResponse struct {
	// The List operation response, that contains the database accounts and their properties.
	DatabaseAccountsListResult
}

DatabaseAccountsClientListResponse contains the response from method DatabaseAccountsClient.NewListPager.

type DatabaseAccountsClientListUsagesOptions

type DatabaseAccountsClientListUsagesOptions struct {
	// An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of
	// the metric, can have an or of multiple names).
	Filter *string
}

DatabaseAccountsClientListUsagesOptions contains the optional parameters for the DatabaseAccountsClient.NewListUsagesPager method.

type DatabaseAccountsClientListUsagesResponse

type DatabaseAccountsClientListUsagesResponse struct {
	// The response to a list usage request.
	UsagesResult
}

DatabaseAccountsClientListUsagesResponse contains the response from method DatabaseAccountsClient.NewListUsagesPager.

type DatabaseAccountsClientOfflineRegionResponse

type DatabaseAccountsClientOfflineRegionResponse struct {
}

DatabaseAccountsClientOfflineRegionResponse contains the response from method DatabaseAccountsClient.BeginOfflineRegion.

type DatabaseAccountsClientOnlineRegionResponse

type DatabaseAccountsClientOnlineRegionResponse struct {
}

DatabaseAccountsClientOnlineRegionResponse contains the response from method DatabaseAccountsClient.BeginOnlineRegion.

type DatabaseAccountsClientRegenerateKeyResponse

type DatabaseAccountsClientRegenerateKeyResponse struct {
}

DatabaseAccountsClientRegenerateKeyResponse contains the response from method DatabaseAccountsClient.BeginRegenerateKey.

type DatabaseAccountsClientUpdateResponse

type DatabaseAccountsClientUpdateResponse struct {
	// An Azure Cosmos DB database account.
	DatabaseAccountGetResults
}

DatabaseAccountsClientUpdateResponse contains the response from method DatabaseAccountsClient.BeginUpdate.

type DatabaseAccountsListResult

type DatabaseAccountsListResult struct {
	// READ-ONLY; List of database account and their properties.
	Value []*DatabaseAccountGetResults
}

DatabaseAccountsListResult - The List operation response, that contains the database accounts and their properties.

func (DatabaseAccountsListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAccountsListResult.

func (*DatabaseAccountsListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountsListResult.

type DatabaseClient

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

DatabaseClient contains the methods for the Database group. Don't use this type directly, use NewDatabaseClient() instead.

func NewDatabaseClient

func NewDatabaseClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseClient, error)

NewDatabaseClient creates a new instance of DatabaseClient with the specified values.

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

func (*DatabaseClient) NewListMetricDefinitionsPager

func (client *DatabaseClient) NewListMetricDefinitionsPager(resourceGroupName string, accountName string, databaseRid string, options *DatabaseClientListMetricDefinitionsOptions) *runtime.Pager[DatabaseClientListMetricDefinitionsResponse]

NewListMetricDefinitionsPager - Retrieves metric definitions for the given database.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseRid - Cosmos DB database rid.
  • options - DatabaseClientListMetricDefinitionsOptions contains the optional parameters for the DatabaseClient.NewListMetricDefinitionsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDatabaseClient().NewListMetricDefinitionsPager("rg1", "ddb1", "databaseRid", 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.MetricDefinitionsListResult = armcosmos.MetricDefinitionsListResult{
	// 	Value: []*armcosmos.MetricDefinition{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Total Requests"),
	// 				Value: to.Ptr("Total Requests"),
	// 			},
	// 			MetricAvailabilities: []*armcosmos.MetricAvailability{
	// 				{
	// 					Retention: to.Ptr("P2D"),
	// 					TimeGrain: to.Ptr("PT5M"),
	// 				},
	// 				{
	// 					Retention: to.Ptr("P14D"),
	// 					TimeGrain: to.Ptr("PT1H"),
	// 				},
	// 				{
	// 					Retention: to.Ptr("P60D"),
	// 					TimeGrain: to.Ptr("P1D"),
	// 			}},
	// 			PrimaryAggregationType: to.Ptr(armcosmos.PrimaryAggregationTypeTotal),
	// 			ResourceURI: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 	}},
	// }
}
Output:

func (*DatabaseClient) NewListMetricsPager

func (client *DatabaseClient) NewListMetricsPager(resourceGroupName string, accountName string, databaseRid string, filter string, options *DatabaseClientListMetricsOptions) *runtime.Pager[DatabaseClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and database.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseRid - Cosmos DB database rid.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - DatabaseClientListMetricsOptions contains the optional parameters for the DatabaseClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDatabaseClient().NewListMetricsPager("rg1", "ddb1", "rid", "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", 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.MetricListResult = armcosmos.MetricListResult{
	// 	Value: []*armcosmos.Metric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Total Requests"),
	// 				Value: to.Ptr("Total Requests"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.MetricValue{
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:03:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 				},
	// 				{
	// 					Count: to.Ptr[int32](0),
	// 					Average: to.Ptr[float64](0),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:08:55.278Z"); return t}()),
	// 					Total: to.Ptr[float64](0),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT5M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 	}},
	// }
}
Output:

func (*DatabaseClient) NewListUsagesPager

func (client *DatabaseClient) NewListUsagesPager(resourceGroupName string, accountName string, databaseRid string, options *DatabaseClientListUsagesOptions) *runtime.Pager[DatabaseClientListUsagesResponse]

NewListUsagesPager - Retrieves the usages (most recent data) for the given database.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseRid - Cosmos DB database rid.
  • options - DatabaseClientListUsagesOptions contains the optional parameters for the DatabaseClient.NewListUsagesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDatabaseGetUsages.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDatabaseClient().NewListUsagesPager("rg1", "ddb1", "databaseRid", &armcosmos.DatabaseClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Storage'")})
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.UsagesResult = armcosmos.UsagesResult{
	// 	Value: []*armcosmos.Usage{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Storage"),
	// 				Value: to.Ptr("Storage"),
	// 			},
	// 			CurrentValue: to.Ptr[int64](0),
	// 			Limit: to.Ptr[int64](10737418240),
	// 			QuotaPeriod: to.Ptr("P1D"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeBytes),
	// 	}},
	// }
}
Output:

type DatabaseClientListMetricDefinitionsOptions

type DatabaseClientListMetricDefinitionsOptions struct {
}

DatabaseClientListMetricDefinitionsOptions contains the optional parameters for the DatabaseClient.NewListMetricDefinitionsPager method.

type DatabaseClientListMetricDefinitionsResponse

type DatabaseClientListMetricDefinitionsResponse struct {
	// The response to a list metric definitions request.
	MetricDefinitionsListResult
}

DatabaseClientListMetricDefinitionsResponse contains the response from method DatabaseClient.NewListMetricDefinitionsPager.

type DatabaseClientListMetricsOptions

type DatabaseClientListMetricsOptions struct {
}

DatabaseClientListMetricsOptions contains the optional parameters for the DatabaseClient.NewListMetricsPager method.

type DatabaseClientListMetricsResponse

type DatabaseClientListMetricsResponse struct {
	// The response to a list metrics request.
	MetricListResult
}

DatabaseClientListMetricsResponse contains the response from method DatabaseClient.NewListMetricsPager.

type DatabaseClientListUsagesOptions

type DatabaseClientListUsagesOptions struct {
	// An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of
	// the metric, can have an or of multiple names).
	Filter *string
}

DatabaseClientListUsagesOptions contains the optional parameters for the DatabaseClient.NewListUsagesPager method.

type DatabaseClientListUsagesResponse

type DatabaseClientListUsagesResponse struct {
	// The response to a list usage request.
	UsagesResult
}

DatabaseClientListUsagesResponse contains the response from method DatabaseClient.NewListUsagesPager.

type DatabaseRestoreResource

type DatabaseRestoreResource struct {
	// The names of the collections available for restore.
	CollectionNames []*string

	// The name of the database available for restore.
	DatabaseName *string
}

DatabaseRestoreResource - Specific Databases to restore.

func (DatabaseRestoreResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseRestoreResource.

func (*DatabaseRestoreResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseRestoreResource.

type DefaultConsistencyLevel

type DefaultConsistencyLevel string

DefaultConsistencyLevel - The default consistency level and configuration settings of the Cosmos DB account.

const (
	DefaultConsistencyLevelBoundedStaleness DefaultConsistencyLevel = "BoundedStaleness"
	DefaultConsistencyLevelConsistentPrefix DefaultConsistencyLevel = "ConsistentPrefix"
	DefaultConsistencyLevelEventual         DefaultConsistencyLevel = "Eventual"
	DefaultConsistencyLevelSession          DefaultConsistencyLevel = "Session"
	DefaultConsistencyLevelStrong           DefaultConsistencyLevel = "Strong"
)

func PossibleDefaultConsistencyLevelValues

func PossibleDefaultConsistencyLevelValues() []DefaultConsistencyLevel

PossibleDefaultConsistencyLevelValues returns the possible values for the DefaultConsistencyLevel const type.

type DefaultPriorityLevel

type DefaultPriorityLevel string

DefaultPriorityLevel - Enum to indicate default priorityLevel of requests

const (
	DefaultPriorityLevelHigh DefaultPriorityLevel = "High"
	DefaultPriorityLevelLow  DefaultPriorityLevel = "Low"
)

func PossibleDefaultPriorityLevelValues

func PossibleDefaultPriorityLevelValues() []DefaultPriorityLevel

PossibleDefaultPriorityLevelValues returns the possible values for the DefaultPriorityLevel const type.

type DiagnosticLogSettings

type DiagnosticLogSettings struct {
	// Describe the level of detail with which queries are to be logged.
	EnableFullTextQuery *EnableFullTextQuery
}

DiagnosticLogSettings - Indicates what diagnostic log settings are to be enabled.

func (DiagnosticLogSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DiagnosticLogSettings.

func (*DiagnosticLogSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticLogSettings.

type EnableFullTextQuery

type EnableFullTextQuery string

EnableFullTextQuery - Describe the level of detail with which queries are to be logged.

const (
	EnableFullTextQueryFalse EnableFullTextQuery = "False"
	EnableFullTextQueryNone  EnableFullTextQuery = "None"
	EnableFullTextQueryTrue  EnableFullTextQuery = "True"
)

func PossibleEnableFullTextQueryValues

func PossibleEnableFullTextQueryValues() []EnableFullTextQuery

PossibleEnableFullTextQueryValues returns the possible values for the EnableFullTextQuery const type.

type ErrorAdditionalInfo

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

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

ErrorAdditionalInfo - The resource management error additional info.

func (ErrorAdditionalInfo) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.

func (*ErrorAdditionalInfo) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.

type ErrorDetail

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

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

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

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

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

ErrorDetail - The error detail.

func (ErrorDetail) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorDetail.

func (*ErrorDetail) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.

type ErrorResponse

type ErrorResponse struct {
	// Error code.
	Code *string

	// Error message indicating why the operation failed.
	Message *string
}

ErrorResponse - Error Response.

func (ErrorResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ErrorResponseAutoGenerated

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

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

func (ErrorResponseAutoGenerated) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated.

func (*ErrorResponseAutoGenerated) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated.

type ExcludedPath

type ExcludedPath struct {
	// The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
	Path *string
}

func (ExcludedPath) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExcludedPath.

func (*ExcludedPath) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExcludedPath.

type ExtendedResourceProperties

type ExtendedResourceProperties struct {
	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

ExtendedResourceProperties - The system generated resource properties associated with SQL databases, SQL containers, Gremlin databases and Gremlin graphs.

func (ExtendedResourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExtendedResourceProperties.

func (*ExtendedResourceProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedResourceProperties.

type FailoverPolicies

type FailoverPolicies struct {
	// REQUIRED; List of failover policies.
	FailoverPolicies []*FailoverPolicy
}

FailoverPolicies - The list of new failover policies for the failover priority change.

func (FailoverPolicies) MarshalJSON

func (f FailoverPolicies) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FailoverPolicies.

func (*FailoverPolicies) UnmarshalJSON

func (f *FailoverPolicies) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FailoverPolicies.

type FailoverPolicy

type FailoverPolicy struct {
	// The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover
	// priority = (total number of regions - 1). Failover priority values must be
	// unique for each of the regions in which the database account exists.
	FailoverPriority *int32

	// The name of the region in which the database account exists.
	LocationName *string

	// READ-ONLY; The unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>.
	ID *string
}

FailoverPolicy - The failover policy for a given region of a database account.

func (FailoverPolicy) MarshalJSON

func (f FailoverPolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FailoverPolicy.

func (*FailoverPolicy) UnmarshalJSON

func (f *FailoverPolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FailoverPolicy.

type FirewallRule

type FirewallRule struct {
	// REQUIRED; The properties of a firewall rule.
	Properties *FirewallRuleProperties

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

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

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

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

FirewallRule - Represents a mongo cluster firewall rule.

func (FirewallRule) MarshalJSON

func (f FirewallRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FirewallRule.

func (*FirewallRule) UnmarshalJSON

func (f *FirewallRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRule.

type FirewallRuleListResult

type FirewallRuleListResult struct {
	// The list of firewall rules in a mongo cluster.
	Value []*FirewallRule

	// READ-ONLY; The link used to get the next page of results.
	NextLink *string
}

FirewallRuleListResult - A list of firewall rules.

func (FirewallRuleListResult) MarshalJSON

func (f FirewallRuleListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FirewallRuleListResult.

func (*FirewallRuleListResult) UnmarshalJSON

func (f *FirewallRuleListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleListResult.

type FirewallRuleProperties

type FirewallRuleProperties struct {
	// REQUIRED; The end IP address of the mongo cluster firewall rule. Must be IPv4 format.
	EndIPAddress *string

	// REQUIRED; The start IP address of the mongo cluster firewall rule. Must be IPv4 format.
	StartIPAddress *string

	// READ-ONLY; The provisioning state of the firewall rule.
	ProvisioningState *ProvisioningState
}

FirewallRuleProperties - The properties of a mongo cluster firewall rule.

func (FirewallRuleProperties) MarshalJSON

func (f FirewallRuleProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FirewallRuleProperties.

func (*FirewallRuleProperties) UnmarshalJSON

func (f *FirewallRuleProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleProperties.

type GraphAPIComputeRegionalServiceResource

type GraphAPIComputeRegionalServiceResource struct {
	// READ-ONLY; The regional endpoint for GraphAPICompute.
	GraphAPIComputeEndpoint *string

	// READ-ONLY; The location name.
	Location *string

	// READ-ONLY; The regional service name.
	Name *string

	// READ-ONLY; Describes the status of a service.
	Status *ServiceStatus
}

GraphAPIComputeRegionalServiceResource - Resource for a regional service location.

func (GraphAPIComputeRegionalServiceResource) MarshalJSON

func (g GraphAPIComputeRegionalServiceResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GraphAPIComputeRegionalServiceResource.

func (*GraphAPIComputeRegionalServiceResource) UnmarshalJSON

func (g *GraphAPIComputeRegionalServiceResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GraphAPIComputeRegionalServiceResource.

type GraphAPIComputeServiceResource

type GraphAPIComputeServiceResource struct {
	// Properties for GraphAPIComputeServiceResource.
	Properties *GraphAPIComputeServiceResourceProperties
}

GraphAPIComputeServiceResource - Describes the service response property for GraphAPICompute.

func (GraphAPIComputeServiceResource) MarshalJSON

func (g GraphAPIComputeServiceResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GraphAPIComputeServiceResource.

func (*GraphAPIComputeServiceResource) UnmarshalJSON

func (g *GraphAPIComputeServiceResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GraphAPIComputeServiceResource.

type GraphAPIComputeServiceResourceProperties

type GraphAPIComputeServiceResourceProperties struct {
	// REQUIRED; ServiceType for the service.
	ServiceType *ServiceType

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

	// GraphAPICompute endpoint for the service.
	GraphAPIComputeEndpoint *string

	// Instance count for the service.
	InstanceCount *int32

	// Instance type for the service.
	InstanceSize *ServiceSize

	// READ-ONLY; Time of the last state change (ISO-8601 format).
	CreationTime *time.Time

	// READ-ONLY; An array that contains all of the locations for the service.
	Locations []*GraphAPIComputeRegionalServiceResource

	// READ-ONLY; Describes the status of a service.
	Status *ServiceStatus
}

GraphAPIComputeServiceResourceProperties - Properties for GraphAPIComputeServiceResource.

func (*GraphAPIComputeServiceResourceProperties) GetServiceResourceProperties

func (g *GraphAPIComputeServiceResourceProperties) GetServiceResourceProperties() *ServiceResourceProperties

GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type GraphAPIComputeServiceResourceProperties.

func (GraphAPIComputeServiceResourceProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type GraphAPIComputeServiceResourceProperties.

func (*GraphAPIComputeServiceResourceProperties) UnmarshalJSON

func (g *GraphAPIComputeServiceResourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GraphAPIComputeServiceResourceProperties.

type GraphResource

type GraphResource struct {
	// REQUIRED; Name of the Cosmos DB Graph
	ID *string
}

GraphResource - Cosmos DB Graph resource object

func (GraphResource) MarshalJSON

func (g GraphResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GraphResource.

func (*GraphResource) UnmarshalJSON

func (g *GraphResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GraphResource.

type GraphResourceCreateUpdateParameters

type GraphResourceCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB Graph resource.
	Properties *GraphResourceCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

GraphResourceCreateUpdateParameters - Parameters to create and update Cosmos DB Graph resource.

func (GraphResourceCreateUpdateParameters) MarshalJSON

func (g GraphResourceCreateUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GraphResourceCreateUpdateParameters.

func (*GraphResourceCreateUpdateParameters) UnmarshalJSON

func (g *GraphResourceCreateUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceCreateUpdateParameters.

type GraphResourceCreateUpdateProperties

type GraphResourceCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a Graph resource
	Resource *GraphResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

GraphResourceCreateUpdateProperties - Properties to create and update Azure Cosmos DB Graph resource.

func (GraphResourceCreateUpdateProperties) MarshalJSON

func (g GraphResourceCreateUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GraphResourceCreateUpdateProperties.

func (*GraphResourceCreateUpdateProperties) UnmarshalJSON

func (g *GraphResourceCreateUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceCreateUpdateProperties.

type GraphResourceGetProperties

type GraphResourceGetProperties struct {
	Options  *GraphResourceGetPropertiesOptions
	Resource *GraphResourceGetPropertiesResource
}

GraphResourceGetProperties - The properties of an Azure Cosmos DB SQL database

func (GraphResourceGetProperties) MarshalJSON

func (g GraphResourceGetProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GraphResourceGetProperties.

func (*GraphResourceGetProperties) UnmarshalJSON

func (g *GraphResourceGetProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceGetProperties.

type GraphResourceGetPropertiesOptions

type GraphResourceGetPropertiesOptions struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

func (GraphResourceGetPropertiesOptions) MarshalJSON

func (g GraphResourceGetPropertiesOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GraphResourceGetPropertiesOptions.

func (*GraphResourceGetPropertiesOptions) UnmarshalJSON

func (g *GraphResourceGetPropertiesOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceGetPropertiesOptions.

type GraphResourceGetPropertiesResource

type GraphResourceGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB Graph
	ID *string
}

func (GraphResourceGetPropertiesResource) MarshalJSON

func (g GraphResourceGetPropertiesResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GraphResourceGetPropertiesResource.

func (*GraphResourceGetPropertiesResource) UnmarshalJSON

func (g *GraphResourceGetPropertiesResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceGetPropertiesResource.

type GraphResourceGetResults

type GraphResourceGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB Graph resource.
	Properties *GraphResourceGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

GraphResourceGetResults - An Azure Cosmos DB Graph resource.

func (GraphResourceGetResults) MarshalJSON

func (g GraphResourceGetResults) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GraphResourceGetResults.

func (*GraphResourceGetResults) UnmarshalJSON

func (g *GraphResourceGetResults) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceGetResults.

type GraphResourcesClient

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

GraphResourcesClient contains the methods for the GraphResources group. Don't use this type directly, use NewGraphResourcesClient() instead.

func NewGraphResourcesClient

func NewGraphResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GraphResourcesClient, error)

NewGraphResourcesClient creates a new instance of GraphResourcesClient with the specified values.

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

func (*GraphResourcesClient) BeginCreateUpdateGraph

func (client *GraphResourcesClient) BeginCreateUpdateGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters GraphResourceCreateUpdateParameters, options *GraphResourcesClientBeginCreateUpdateGraphOptions) (*runtime.Poller[GraphResourcesClientCreateUpdateGraphResponse], error)

BeginCreateUpdateGraph - Create or update an Azure Cosmos DB Graph. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • graphName - Cosmos DB graph resource name.
  • createUpdateGraphParameters - The parameters to provide for the current graph.
  • options - GraphResourcesClientBeginCreateUpdateGraphOptions contains the optional parameters for the GraphResourcesClient.BeginCreateUpdateGraph method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGraphResourceCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGraphResourcesClient().BeginCreateUpdateGraph(ctx, "rg1", "ddb1", "graphName", armcosmos.GraphResourceCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.GraphResourceCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.GraphResource{
			ID: to.Ptr("graphName"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.GraphResourceGetResults = armcosmos.GraphResourceGetResults{
// 	Name: to.Ptr("graphName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/graphs"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/graphs/graphName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.GraphResourceGetProperties{
// 		Resource: &armcosmos.GraphResourceGetPropertiesResource{
// 			ID: to.Ptr("graphName"),
// 		},
// 	},
// }
Output:

func (*GraphResourcesClient) BeginDeleteGraphResource

func (client *GraphResourcesClient) BeginDeleteGraphResource(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientBeginDeleteGraphResourceOptions) (*runtime.Poller[GraphResourcesClientDeleteGraphResourceResponse], error)

BeginDeleteGraphResource - Deletes an existing Azure Cosmos DB Graph Resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • graphName - Cosmos DB graph resource name.
  • options - GraphResourcesClientBeginDeleteGraphResourceOptions contains the optional parameters for the GraphResourcesClient.BeginDeleteGraphResource method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGraphResourceDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGraphResourcesClient().BeginDeleteGraphResource(ctx, "rg1", "ddb1", "graphName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*GraphResourcesClient) GetGraph

func (client *GraphResourcesClient) GetGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientGetGraphOptions) (GraphResourcesClientGetGraphResponse, error)

GetGraph - Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • graphName - Cosmos DB graph resource name.
  • options - GraphResourcesClientGetGraphOptions contains the optional parameters for the GraphResourcesClient.GetGraph method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGraphResourceGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGraphResourcesClient().GetGraph(ctx, "rg1", "ddb1", "graphName", 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.GraphResourceGetResults = armcosmos.GraphResourceGetResults{
// 	Name: to.Ptr("graphName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/graphs"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/graphs/graphName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.GraphResourceGetProperties{
// 		Resource: &armcosmos.GraphResourceGetPropertiesResource{
// 			ID: to.Ptr("graphName"),
// 		},
// 	},
// }
Output:

func (*GraphResourcesClient) NewListGraphsPager

func (client *GraphResourcesClient) NewListGraphsPager(resourceGroupName string, accountName string, options *GraphResourcesClientListGraphsOptions) *runtime.Pager[GraphResourcesClientListGraphsResponse]

NewListGraphsPager - Lists the graphs under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - GraphResourcesClientListGraphsOptions contains the optional parameters for the GraphResourcesClient.NewListGraphsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGraphResourceList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewGraphResourcesClient().NewListGraphsPager("rgName", "ddb1", 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.GraphResourcesListResult = armcosmos.GraphResourcesListResult{
	// 	Value: []*armcosmos.GraphResourceGetResults{
	// 		{
	// 			Name: to.Ptr("graphName"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/graphs"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/graphs/graphName"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.GraphResourceGetProperties{
	// 				Resource: &armcosmos.GraphResourceGetPropertiesResource{
	// 					ID: to.Ptr("graphName"),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type GraphResourcesClientBeginCreateUpdateGraphOptions

type GraphResourcesClientBeginCreateUpdateGraphOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GraphResourcesClientBeginCreateUpdateGraphOptions contains the optional parameters for the GraphResourcesClient.BeginCreateUpdateGraph method.

type GraphResourcesClientBeginDeleteGraphResourceOptions

type GraphResourcesClientBeginDeleteGraphResourceOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GraphResourcesClientBeginDeleteGraphResourceOptions contains the optional parameters for the GraphResourcesClient.BeginDeleteGraphResource method.

type GraphResourcesClientCreateUpdateGraphResponse

type GraphResourcesClientCreateUpdateGraphResponse struct {
	// An Azure Cosmos DB Graph resource.
	GraphResourceGetResults
}

GraphResourcesClientCreateUpdateGraphResponse contains the response from method GraphResourcesClient.BeginCreateUpdateGraph.

type GraphResourcesClientDeleteGraphResourceResponse

type GraphResourcesClientDeleteGraphResourceResponse struct {
}

GraphResourcesClientDeleteGraphResourceResponse contains the response from method GraphResourcesClient.BeginDeleteGraphResource.

type GraphResourcesClientGetGraphOptions

type GraphResourcesClientGetGraphOptions struct {
}

GraphResourcesClientGetGraphOptions contains the optional parameters for the GraphResourcesClient.GetGraph method.

type GraphResourcesClientGetGraphResponse

type GraphResourcesClientGetGraphResponse struct {
	// An Azure Cosmos DB Graph resource.
	GraphResourceGetResults
}

GraphResourcesClientGetGraphResponse contains the response from method GraphResourcesClient.GetGraph.

type GraphResourcesClientListGraphsOptions

type GraphResourcesClientListGraphsOptions struct {
}

GraphResourcesClientListGraphsOptions contains the optional parameters for the GraphResourcesClient.NewListGraphsPager method.

type GraphResourcesClientListGraphsResponse

type GraphResourcesClientListGraphsResponse struct {
	// The List operation response, that contains the Graph resource and their properties.
	GraphResourcesListResult
}

GraphResourcesClientListGraphsResponse contains the response from method GraphResourcesClient.NewListGraphsPager.

type GraphResourcesListResult

type GraphResourcesListResult struct {
	// READ-ONLY; List of Graph resource and their properties.
	Value []*GraphResourceGetResults
}

GraphResourcesListResult - The List operation response, that contains the Graph resource and their properties.

func (GraphResourcesListResult) MarshalJSON

func (g GraphResourcesListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GraphResourcesListResult.

func (*GraphResourcesListResult) UnmarshalJSON

func (g *GraphResourcesListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourcesListResult.

type GremlinDatabaseCreateUpdateParameters

type GremlinDatabaseCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB Gremlin database.
	Properties *GremlinDatabaseCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

GremlinDatabaseCreateUpdateParameters - Parameters to create and update Cosmos DB Gremlin database.

func (GremlinDatabaseCreateUpdateParameters) MarshalJSON

func (g GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseCreateUpdateParameters.

func (*GremlinDatabaseCreateUpdateParameters) UnmarshalJSON

func (g *GremlinDatabaseCreateUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseCreateUpdateParameters.

type GremlinDatabaseCreateUpdateProperties

type GremlinDatabaseCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a Gremlin database
	Resource *GremlinDatabaseResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

GremlinDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin database.

func (GremlinDatabaseCreateUpdateProperties) MarshalJSON

func (g GremlinDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseCreateUpdateProperties.

func (*GremlinDatabaseCreateUpdateProperties) UnmarshalJSON

func (g *GremlinDatabaseCreateUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseCreateUpdateProperties.

type GremlinDatabaseGetProperties

type GremlinDatabaseGetProperties struct {
	Options  *GremlinDatabaseGetPropertiesOptions
	Resource *GremlinDatabaseGetPropertiesResource
}

GremlinDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database

func (GremlinDatabaseGetProperties) MarshalJSON

func (g GremlinDatabaseGetProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetProperties.

func (*GremlinDatabaseGetProperties) UnmarshalJSON

func (g *GremlinDatabaseGetProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetProperties.

type GremlinDatabaseGetPropertiesOptions

type GremlinDatabaseGetPropertiesOptions struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

func (GremlinDatabaseGetPropertiesOptions) MarshalJSON

func (g GremlinDatabaseGetPropertiesOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetPropertiesOptions.

func (*GremlinDatabaseGetPropertiesOptions) UnmarshalJSON

func (g *GremlinDatabaseGetPropertiesOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetPropertiesOptions.

type GremlinDatabaseGetPropertiesResource

type GremlinDatabaseGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB Gremlin database
	ID *string

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (GremlinDatabaseGetPropertiesResource) MarshalJSON

func (g GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetPropertiesResource.

func (*GremlinDatabaseGetPropertiesResource) UnmarshalJSON

func (g *GremlinDatabaseGetPropertiesResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetPropertiesResource.

type GremlinDatabaseGetResults

type GremlinDatabaseGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB SQL database
	Properties *GremlinDatabaseGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

GremlinDatabaseGetResults - An Azure Cosmos DB Gremlin database.

func (GremlinDatabaseGetResults) MarshalJSON

func (g GremlinDatabaseGetResults) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetResults.

func (*GremlinDatabaseGetResults) UnmarshalJSON

func (g *GremlinDatabaseGetResults) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetResults.

type GremlinDatabaseListResult

type GremlinDatabaseListResult struct {
	// READ-ONLY; List of Gremlin databases and their properties.
	Value []*GremlinDatabaseGetResults
}

GremlinDatabaseListResult - The List operation response, that contains the Gremlin databases and their properties.

func (GremlinDatabaseListResult) MarshalJSON

func (g GremlinDatabaseListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseListResult.

func (*GremlinDatabaseListResult) UnmarshalJSON

func (g *GremlinDatabaseListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseListResult.

type GremlinDatabaseResource

type GremlinDatabaseResource struct {
	// REQUIRED; Name of the Cosmos DB Gremlin database
	ID *string

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters
}

GremlinDatabaseResource - Cosmos DB Gremlin database resource object

func (GremlinDatabaseResource) MarshalJSON

func (g GremlinDatabaseResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseResource.

func (*GremlinDatabaseResource) UnmarshalJSON

func (g *GremlinDatabaseResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseResource.

type GremlinDatabaseRestoreResource

type GremlinDatabaseRestoreResource struct {
	// The name of the gremlin database available for restore.
	DatabaseName *string

	// The names of the graphs available for restore.
	GraphNames []*string
}

GremlinDatabaseRestoreResource - Specific Gremlin Databases to restore.

func (GremlinDatabaseRestoreResource) MarshalJSON

func (g GremlinDatabaseRestoreResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseRestoreResource.

func (*GremlinDatabaseRestoreResource) UnmarshalJSON

func (g *GremlinDatabaseRestoreResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseRestoreResource.

type GremlinGraphCreateUpdateParameters

type GremlinGraphCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB Gremlin graph.
	Properties *GremlinGraphCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

GremlinGraphCreateUpdateParameters - Parameters to create and update Cosmos DB Gremlin graph.

func (GremlinGraphCreateUpdateParameters) MarshalJSON

func (g GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinGraphCreateUpdateParameters.

func (*GremlinGraphCreateUpdateParameters) UnmarshalJSON

func (g *GremlinGraphCreateUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphCreateUpdateParameters.

type GremlinGraphCreateUpdateProperties

type GremlinGraphCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a Gremlin graph
	Resource *GremlinGraphResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

GremlinGraphCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin graph.

func (GremlinGraphCreateUpdateProperties) MarshalJSON

func (g GremlinGraphCreateUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinGraphCreateUpdateProperties.

func (*GremlinGraphCreateUpdateProperties) UnmarshalJSON

func (g *GremlinGraphCreateUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphCreateUpdateProperties.

type GremlinGraphGetProperties

type GremlinGraphGetProperties struct {
	Options  *GremlinGraphGetPropertiesOptions
	Resource *GremlinGraphGetPropertiesResource
}

GremlinGraphGetProperties - The properties of an Azure Cosmos DB Gremlin graph

func (GremlinGraphGetProperties) MarshalJSON

func (g GremlinGraphGetProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetProperties.

func (*GremlinGraphGetProperties) UnmarshalJSON

func (g *GremlinGraphGetProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetProperties.

type GremlinGraphGetPropertiesOptions

type GremlinGraphGetPropertiesOptions struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

func (GremlinGraphGetPropertiesOptions) MarshalJSON

func (g GremlinGraphGetPropertiesOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetPropertiesOptions.

func (*GremlinGraphGetPropertiesOptions) UnmarshalJSON

func (g *GremlinGraphGetPropertiesOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetPropertiesOptions.

type GremlinGraphGetPropertiesResource

type GremlinGraphGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB Gremlin graph
	ID *string

	// Analytical TTL.
	AnalyticalStorageTTL *int64

	// The conflict resolution policy for the graph.
	ConflictResolutionPolicy *ConflictResolutionPolicy

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Default time to live
	DefaultTTL *int32

	// The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph
	IndexingPolicy *IndexingPolicy

	// The configuration of the partition key to be used for partitioning data into multiple partitions
	PartitionKey *ContainerPartitionKey

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos
	// DB service.
	UniqueKeyPolicy *UniqueKeyPolicy

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (GremlinGraphGetPropertiesResource) MarshalJSON

func (g GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetPropertiesResource.

func (*GremlinGraphGetPropertiesResource) UnmarshalJSON

func (g *GremlinGraphGetPropertiesResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetPropertiesResource.

type GremlinGraphGetResults

type GremlinGraphGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB Gremlin graph
	Properties *GremlinGraphGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

GremlinGraphGetResults - An Azure Cosmos DB Gremlin graph.

func (GremlinGraphGetResults) MarshalJSON

func (g GremlinGraphGetResults) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetResults.

func (*GremlinGraphGetResults) UnmarshalJSON

func (g *GremlinGraphGetResults) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetResults.

type GremlinGraphListResult

type GremlinGraphListResult struct {
	// READ-ONLY; List of graphs and their properties.
	Value []*GremlinGraphGetResults
}

GremlinGraphListResult - The List operation response, that contains the graphs and their properties.

func (GremlinGraphListResult) MarshalJSON

func (g GremlinGraphListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinGraphListResult.

func (*GremlinGraphListResult) UnmarshalJSON

func (g *GremlinGraphListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphListResult.

type GremlinGraphResource

type GremlinGraphResource struct {
	// REQUIRED; Name of the Cosmos DB Gremlin graph
	ID *string

	// Analytical TTL.
	AnalyticalStorageTTL *int64

	// The conflict resolution policy for the graph.
	ConflictResolutionPolicy *ConflictResolutionPolicy

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Default time to live
	DefaultTTL *int32

	// The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph
	IndexingPolicy *IndexingPolicy

	// The configuration of the partition key to be used for partitioning data into multiple partitions
	PartitionKey *ContainerPartitionKey

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos
	// DB service.
	UniqueKeyPolicy *UniqueKeyPolicy
}

GremlinGraphResource - Cosmos DB Gremlin graph resource object

func (GremlinGraphResource) MarshalJSON

func (g GremlinGraphResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GremlinGraphResource.

func (*GremlinGraphResource) UnmarshalJSON

func (g *GremlinGraphResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphResource.

type GremlinResourcesClient

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

GremlinResourcesClient contains the methods for the GremlinResources group. Don't use this type directly, use NewGremlinResourcesClient() instead.

func NewGremlinResourcesClient

func NewGremlinResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GremlinResourcesClient, error)

NewGremlinResourcesClient creates a new instance of GremlinResourcesClient with the specified values.

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

func (*GremlinResourcesClient) BeginCreateUpdateGremlinDatabase

func (client *GremlinResourcesClient) BeginCreateUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters, options *GremlinResourcesClientBeginCreateUpdateGremlinDatabaseOptions) (*runtime.Poller[GremlinResourcesClientCreateUpdateGremlinDatabaseResponse], error)

BeginCreateUpdateGremlinDatabase - Create or update an Azure Cosmos DB Gremlin database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • createUpdateGremlinDatabaseParameters - The parameters to provide for the current Gremlin database.
  • options - GremlinResourcesClientBeginCreateUpdateGremlinDatabaseOptions contains the optional parameters for the GremlinResourcesClient.BeginCreateUpdateGremlinDatabase method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginCreateUpdateGremlinDatabase(ctx, "rg1", "ddb1", "databaseName", armcosmos.GremlinDatabaseCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.GremlinDatabaseCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.GremlinDatabaseResource{
			ID: to.Ptr("databaseName"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.GremlinDatabaseGetResults = armcosmos.GremlinDatabaseGetResults{
// 	Name: to.Ptr("databaseName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.GremlinDatabaseGetProperties{
// 		Resource: &armcosmos.GremlinDatabaseGetPropertiesResource{
// 			Etag: to.Ptr("\"00000a00-0000-0000-0000-56672f920000\""),
// 			Rid: to.Ptr("CqNBAA=="),
// 			Ts: to.Ptr[float32](1449602962),
// 			ID: to.Ptr("databaseName"),
// 		},
// 	},
// }
Output:

func (*GremlinResourcesClient) BeginCreateUpdateGremlinGraph

func (client *GremlinResourcesClient) BeginCreateUpdateGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters, options *GremlinResourcesClientBeginCreateUpdateGremlinGraphOptions) (*runtime.Poller[GremlinResourcesClientCreateUpdateGremlinGraphResponse], error)

BeginCreateUpdateGremlinGraph - Create or update an Azure Cosmos DB Gremlin graph If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • graphName - Cosmos DB graph name.
  • createUpdateGremlinGraphParameters - The parameters to provide for the current Gremlin graph.
  • options - GremlinResourcesClientBeginCreateUpdateGremlinGraphOptions contains the optional parameters for the GremlinResourcesClient.BeginCreateUpdateGremlinGraph method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginCreateUpdateGremlinGraph(ctx, "rg1", "ddb1", "databaseName", "graphName", armcosmos.GremlinGraphCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.GremlinGraphCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.GremlinGraphResource{
			ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
				ConflictResolutionPath: to.Ptr("/path"),
				Mode:                   to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
			},
			DefaultTTL: to.Ptr[int32](100),
			ID:         to.Ptr("graphName"),
			IndexingPolicy: &armcosmos.IndexingPolicy{
				Automatic:     to.Ptr(true),
				ExcludedPaths: []*armcosmos.ExcludedPath{},
				IncludedPaths: []*armcosmos.IncludedPath{
					{
						Path: to.Ptr("/*"),
						Indexes: []*armcosmos.Indexes{
							{
								DataType:  to.Ptr(armcosmos.DataTypeString),
								Kind:      to.Ptr(armcosmos.IndexKindRange),
								Precision: to.Ptr[int32](-1),
							},
							{
								DataType:  to.Ptr(armcosmos.DataTypeNumber),
								Kind:      to.Ptr(armcosmos.IndexKindRange),
								Precision: to.Ptr[int32](-1),
							}},
					}},
				IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
			},
			PartitionKey: &armcosmos.ContainerPartitionKey{
				Kind: to.Ptr(armcosmos.PartitionKindHash),
				Paths: []*string{
					to.Ptr("/AccountNumber")},
			},
			UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
				UniqueKeys: []*armcosmos.UniqueKey{
					{
						Paths: []*string{
							to.Ptr("/testPath")},
					}},
			},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.GremlinGraphGetResults = armcosmos.GremlinGraphGetResults{
// 	Name: to.Ptr("graphName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/gremlinGraphs"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName/gremlinGraphs/graphName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.GremlinGraphGetProperties{
// 		Resource: &armcosmos.GremlinGraphGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
// 				ConflictResolutionPath: to.Ptr("/path"),
// 				Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
// 			},
// 			DefaultTTL: to.Ptr[int32](100),
// 			ID: to.Ptr("graphName"),
// 			IndexingPolicy: &armcosmos.IndexingPolicy{
// 				Automatic: to.Ptr(true),
// 				ExcludedPaths: []*armcosmos.ExcludedPath{
// 				},
// 				IncludedPaths: []*armcosmos.IncludedPath{
// 					{
// 						Path: to.Ptr("/*"),
// 						Indexes: []*armcosmos.Indexes{
// 							{
// 								DataType: to.Ptr(armcosmos.DataTypeString),
// 								Kind: to.Ptr(armcosmos.IndexKindRange),
// 								Precision: to.Ptr[int32](-1),
// 							},
// 							{
// 								DataType: to.Ptr(armcosmos.DataTypeNumber),
// 								Kind: to.Ptr(armcosmos.IndexKindRange),
// 								Precision: to.Ptr[int32](-1),
// 						}},
// 				}},
// 				IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
// 			},
// 			PartitionKey: &armcosmos.ContainerPartitionKey{
// 				Kind: to.Ptr(armcosmos.PartitionKindHash),
// 				Paths: []*string{
// 					to.Ptr("/AccountNumber")},
// 				},
// 				UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
// 					UniqueKeys: []*armcosmos.UniqueKey{
// 						{
// 							Paths: []*string{
// 								to.Ptr("/testPath")},
// 						}},
// 					},
// 				},
// 			},
// 		}
Output:

func (*GremlinResourcesClient) BeginDeleteGremlinDatabase

func (client *GremlinResourcesClient) BeginDeleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientBeginDeleteGremlinDatabaseOptions) (*runtime.Poller[GremlinResourcesClientDeleteGremlinDatabaseResponse], error)

BeginDeleteGremlinDatabase - Deletes an existing Azure Cosmos DB Gremlin database. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - GremlinResourcesClientBeginDeleteGremlinDatabaseOptions contains the optional parameters for the GremlinResourcesClient.BeginDeleteGremlinDatabase method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginDeleteGremlinDatabase(ctx, "rg1", "ddb1", "databaseName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*GremlinResourcesClient) BeginDeleteGremlinGraph

func (client *GremlinResourcesClient) BeginDeleteGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginDeleteGremlinGraphOptions) (*runtime.Poller[GremlinResourcesClientDeleteGremlinGraphResponse], error)

BeginDeleteGremlinGraph - Deletes an existing Azure Cosmos DB Gremlin graph. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • graphName - Cosmos DB graph name.
  • options - GremlinResourcesClientBeginDeleteGremlinGraphOptions contains the optional parameters for the GremlinResourcesClient.BeginDeleteGremlinGraph method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginDeleteGremlinGraph(ctx, "rg1", "ddb1", "databaseName", "graphName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*GremlinResourcesClient) BeginMigrateGremlinDatabaseToAutoscale

BeginMigrateGremlinDatabaseToAutoscale - Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - GremlinResourcesClientBeginMigrateGremlinDatabaseToAutoscaleOptions contains the optional parameters for the GremlinResourcesClient.BeginMigrateGremlinDatabaseToAutoscale method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginMigrateGremlinDatabaseToAutoscale(ctx, "rg1", "ddb1", "databaseName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			AutoscaleSettings: &armcosmos.AutoscaleSettingsResource{
// 				MaxThroughput: to.Ptr[int32](4000),
// 			},
// 			MinimumThroughput: to.Ptr("4000"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*GremlinResourcesClient) BeginMigrateGremlinDatabaseToManualThroughput

BeginMigrateGremlinDatabaseToManualThroughput - Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - GremlinResourcesClientBeginMigrateGremlinDatabaseToManualThroughputOptions contains the optional parameters for the GremlinResourcesClient.BeginMigrateGremlinDatabaseToManualThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginMigrateGremlinDatabaseToManualThroughput(ctx, "rg1", "ddb1", "databaseName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*GremlinResourcesClient) BeginMigrateGremlinGraphToAutoscale

func (client *GremlinResourcesClient) BeginMigrateGremlinGraphToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginMigrateGremlinGraphToAutoscaleOptions) (*runtime.Poller[GremlinResourcesClientMigrateGremlinGraphToAutoscaleResponse], error)

BeginMigrateGremlinGraphToAutoscale - Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • graphName - Cosmos DB graph name.
  • options - GremlinResourcesClientBeginMigrateGremlinGraphToAutoscaleOptions contains the optional parameters for the GremlinResourcesClient.BeginMigrateGremlinGraphToAutoscale method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginMigrateGremlinGraphToAutoscale(ctx, "rg1", "ddb1", "databaseName", "graphName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			AutoscaleSettings: &armcosmos.AutoscaleSettingsResource{
// 				MaxThroughput: to.Ptr[int32](4000),
// 			},
// 			MinimumThroughput: to.Ptr("4000"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*GremlinResourcesClient) BeginMigrateGremlinGraphToManualThroughput

func (client *GremlinResourcesClient) BeginMigrateGremlinGraphToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginMigrateGremlinGraphToManualThroughputOptions) (*runtime.Poller[GremlinResourcesClientMigrateGremlinGraphToManualThroughputResponse], error)

BeginMigrateGremlinGraphToManualThroughput - Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • graphName - Cosmos DB graph name.
  • options - GremlinResourcesClientBeginMigrateGremlinGraphToManualThroughputOptions contains the optional parameters for the GremlinResourcesClient.BeginMigrateGremlinGraphToManualThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginMigrateGremlinGraphToManualThroughput(ctx, "rg1", "ddb1", "databaseName", "graphName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*GremlinResourcesClient) BeginRetrieveContinuousBackupInformation

BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a gremlin graph. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • graphName - Cosmos DB graph name.
  • location - The name of the continuous backup restore location.
  • options - GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the GremlinResourcesClient.BeginRetrieveContinuousBackupInformation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphBackupInformation.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginRetrieveContinuousBackupInformation(ctx, "rgName", "ddb1", "databaseName", "graphName", armcosmos.ContinuousBackupRestoreLocation{
	Location: to.Ptr("North Europe"),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.BackupInformation = armcosmos.BackupInformation{
// 	ContinuousBackupInformation: &armcosmos.ContinuousBackupInformation{
// 		LatestRestorableTimestamp: to.Ptr("2021-02-05T02:40:50Z"),
// 	},
// }
Output:

func (*GremlinResourcesClient) BeginUpdateGremlinDatabaseThroughput

func (client *GremlinResourcesClient) BeginUpdateGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions) (*runtime.Poller[GremlinResourcesClientUpdateGremlinDatabaseThroughputResponse], error)

BeginUpdateGremlinDatabaseThroughput - Update RUs per second of an Azure Cosmos DB Gremlin database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • updateThroughputParameters - The RUs per second of the parameters to provide for the current Gremlin database.
  • options - GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions contains the optional parameters for the GremlinResourcesClient.BeginUpdateGremlinDatabaseThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginUpdateGremlinDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", armcosmos.ThroughputSettingsUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.ThroughputSettingsUpdateProperties{
		Resource: &armcosmos.ThroughputSettingsResource{
			Throughput: to.Ptr[int32](400),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*GremlinResourcesClient) BeginUpdateGremlinGraphThroughput

func (client *GremlinResourcesClient) BeginUpdateGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *GremlinResourcesClientBeginUpdateGremlinGraphThroughputOptions) (*runtime.Poller[GremlinResourcesClientUpdateGremlinGraphThroughputResponse], error)

BeginUpdateGremlinGraphThroughput - Update RUs per second of an Azure Cosmos DB Gremlin graph If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • graphName - Cosmos DB graph name.
  • updateThroughputParameters - The RUs per second of the parameters to provide for the current Gremlin graph.
  • options - GremlinResourcesClientBeginUpdateGremlinGraphThroughputOptions contains the optional parameters for the GremlinResourcesClient.BeginUpdateGremlinGraphThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginUpdateGremlinGraphThroughput(ctx, "rg1", "ddb1", "databaseName", "graphName", armcosmos.ThroughputSettingsUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.ThroughputSettingsUpdateProperties{
		Resource: &armcosmos.ThroughputSettingsResource{
			Throughput: to.Ptr[int32](400),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName/gremlinGraphs/graphName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*GremlinResourcesClient) GetGremlinDatabase

func (client *GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientGetGremlinDatabaseOptions) (GremlinResourcesClientGetGremlinDatabaseResponse, error)

GetGremlinDatabase - Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - GremlinResourcesClientGetGremlinDatabaseOptions contains the optional parameters for the GremlinResourcesClient.GetGremlinDatabase method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGremlinResourcesClient().GetGremlinDatabase(ctx, "rg1", "ddb1", "databaseName", 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.GremlinDatabaseGetResults = armcosmos.GremlinDatabaseGetResults{
// 	Name: to.Ptr("databaseName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.GremlinDatabaseGetProperties{
// 		Resource: &armcosmos.GremlinDatabaseGetPropertiesResource{
// 			Etag: to.Ptr("\"00000a00-0000-0000-0000-56672f920000\""),
// 			Rid: to.Ptr("CqNBAA=="),
// 			Ts: to.Ptr[float32](1449602962),
// 			ID: to.Ptr("databaseName"),
// 		},
// 	},
// }
Output:

func (*GremlinResourcesClient) GetGremlinDatabaseThroughput

func (client *GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientGetGremlinDatabaseThroughputOptions) (GremlinResourcesClientGetGremlinDatabaseThroughputResponse, error)

GetGremlinDatabaseThroughput - Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - GremlinResourcesClientGetGremlinDatabaseThroughputOptions contains the optional parameters for the GremlinResourcesClient.GetGremlinDatabaseThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGremlinResourcesClient().GetGremlinDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", 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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			InstantMaximumThroughput: to.Ptr("10000"),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			SoftAllowedMaximumThroughput: to.Ptr("1000000"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*GremlinResourcesClient) GetGremlinGraph

func (client *GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientGetGremlinGraphOptions) (GremlinResourcesClientGetGremlinGraphResponse, error)

GetGremlinGraph - Gets the Gremlin graph under an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • graphName - Cosmos DB graph name.
  • options - GremlinResourcesClientGetGremlinGraphOptions contains the optional parameters for the GremlinResourcesClient.GetGremlinGraph method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGremlinResourcesClient().GetGremlinGraph(ctx, "rgName", "ddb1", "databaseName", "graphName", 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.GremlinGraphGetResults = armcosmos.GremlinGraphGetResults{
// 	Name: to.Ptr("graphName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/apis/databases/graphs"),
// 	ID: to.Ptr("graphName"),
// 	Properties: &armcosmos.GremlinGraphGetProperties{
// 		Resource: &armcosmos.GremlinGraphGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
// 				ConflictResolutionPath: to.Ptr("/path"),
// 				Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
// 			},
// 			DefaultTTL: to.Ptr[int32](100),
// 			ID: to.Ptr("graphName"),
// 			IndexingPolicy: &armcosmos.IndexingPolicy{
// 				Automatic: to.Ptr(true),
// 				ExcludedPaths: []*armcosmos.ExcludedPath{
// 				},
// 				IncludedPaths: []*armcosmos.IncludedPath{
// 					{
// 						Path: to.Ptr("/*"),
// 						Indexes: []*armcosmos.Indexes{
// 							{
// 								DataType: to.Ptr(armcosmos.DataTypeString),
// 								Kind: to.Ptr(armcosmos.IndexKindRange),
// 								Precision: to.Ptr[int32](-1),
// 							},
// 							{
// 								DataType: to.Ptr(armcosmos.DataTypeNumber),
// 								Kind: to.Ptr(armcosmos.IndexKindRange),
// 								Precision: to.Ptr[int32](-1),
// 						}},
// 				}},
// 				IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
// 			},
// 			PartitionKey: &armcosmos.ContainerPartitionKey{
// 				Kind: to.Ptr(armcosmos.PartitionKindHash),
// 				Paths: []*string{
// 					to.Ptr("/AccountNumber")},
// 				},
// 				UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
// 					UniqueKeys: []*armcosmos.UniqueKey{
// 						{
// 							Paths: []*string{
// 								to.Ptr("/testPath")},
// 						}},
// 					},
// 				},
// 			},
// 		}
Output:

func (*GremlinResourcesClient) GetGremlinGraphThroughput

func (client *GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientGetGremlinGraphThroughputOptions) (GremlinResourcesClientGetGremlinGraphThroughputResponse, error)

GetGremlinGraphThroughput - Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • graphName - Cosmos DB graph name.
  • options - GremlinResourcesClientGetGremlinGraphThroughputOptions contains the optional parameters for the GremlinResourcesClient.GetGremlinGraphThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphThroughputGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGremlinResourcesClient().GetGremlinGraphThroughput(ctx, "rg1", "ddb1", "databaseName", "graphName", 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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName/gremlinGraphs/graphName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			InstantMaximumThroughput: to.Ptr("10000"),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			SoftAllowedMaximumThroughput: to.Ptr("1000000"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*GremlinResourcesClient) NewListGremlinDatabasesPager

NewListGremlinDatabasesPager - Lists the Gremlin databases under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - GremlinResourcesClientListGremlinDatabasesOptions contains the optional parameters for the GremlinResourcesClient.NewListGremlinDatabasesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinDatabaseList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewGremlinResourcesClient().NewListGremlinDatabasesPager("rgName", "ddb1", 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.GremlinDatabaseListResult = armcosmos.GremlinDatabaseListResult{
	// 	Value: []*armcosmos.GremlinDatabaseGetResults{
	// 		{
	// 			Name: to.Ptr("databaseName"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/gremlinDatabases"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.GremlinDatabaseGetProperties{
	// 				Resource: &armcosmos.GremlinDatabaseGetPropertiesResource{
	// 					Etag: to.Ptr("\"00000a00-0000-0000-0000-56672f920000\""),
	// 					Rid: to.Ptr("CqNBAA=="),
	// 					Ts: to.Ptr[float32](1449602962),
	// 					ID: to.Ptr("databaseName"),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

func (*GremlinResourcesClient) NewListGremlinGraphsPager

func (client *GremlinResourcesClient) NewListGremlinGraphsPager(resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientListGremlinGraphsOptions) *runtime.Pager[GremlinResourcesClientListGremlinGraphsResponse]

NewListGremlinGraphsPager - Lists the Gremlin graph under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - GremlinResourcesClientListGremlinGraphsOptions contains the optional parameters for the GremlinResourcesClient.NewListGremlinGraphsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGremlinGraphList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewGremlinResourcesClient().NewListGremlinGraphsPager("rgName", "ddb1", "databaseName", 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.GremlinGraphListResult = armcosmos.GremlinGraphListResult{
	// 	Value: []*armcosmos.GremlinGraphGetResults{
	// 		{
	// 			Name: to.Ptr("testgrf"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/apis/databases/graphs"),
	// 			ID: to.Ptr("testgrf"),
	// 			Properties: &armcosmos.GremlinGraphGetProperties{
	// 				Resource: &armcosmos.GremlinGraphGetPropertiesResource{
	// 					Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
	// 					Rid: to.Ptr("PD5DALigDgw="),
	// 					Ts: to.Ptr[float32](1459200611),
	// 					ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
	// 						ConflictResolutionPath: to.Ptr("/path"),
	// 						Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
	// 					},
	// 					DefaultTTL: to.Ptr[int32](100),
	// 					ID: to.Ptr("testgrf"),
	// 					IndexingPolicy: &armcosmos.IndexingPolicy{
	// 						Automatic: to.Ptr(true),
	// 						ExcludedPaths: []*armcosmos.ExcludedPath{
	// 						},
	// 						IncludedPaths: []*armcosmos.IncludedPath{
	// 							{
	// 								Path: to.Ptr("/*"),
	// 								Indexes: []*armcosmos.Indexes{
	// 									{
	// 										DataType: to.Ptr(armcosmos.DataTypeString),
	// 										Kind: to.Ptr(armcosmos.IndexKindRange),
	// 										Precision: to.Ptr[int32](-1),
	// 									},
	// 									{
	// 										DataType: to.Ptr(armcosmos.DataTypeNumber),
	// 										Kind: to.Ptr(armcosmos.IndexKindRange),
	// 										Precision: to.Ptr[int32](-1),
	// 								}},
	// 						}},
	// 						IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
	// 					},
	// 					PartitionKey: &armcosmos.ContainerPartitionKey{
	// 						Kind: to.Ptr(armcosmos.PartitionKindHash),
	// 						Paths: []*string{
	// 							to.Ptr("/AccountNumber")},
	// 						},
	// 						UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
	// 							UniqueKeys: []*armcosmos.UniqueKey{
	// 								{
	// 									Paths: []*string{
	// 										to.Ptr("/testPath")},
	// 								}},
	// 							},
	// 						},
	// 					},
	// 			}},
	// 		}
}
Output:

type GremlinResourcesClientBeginCreateUpdateGremlinDatabaseOptions

type GremlinResourcesClientBeginCreateUpdateGremlinDatabaseOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GremlinResourcesClientBeginCreateUpdateGremlinDatabaseOptions contains the optional parameters for the GremlinResourcesClient.BeginCreateUpdateGremlinDatabase method.

type GremlinResourcesClientBeginCreateUpdateGremlinGraphOptions

type GremlinResourcesClientBeginCreateUpdateGremlinGraphOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GremlinResourcesClientBeginCreateUpdateGremlinGraphOptions contains the optional parameters for the GremlinResourcesClient.BeginCreateUpdateGremlinGraph method.

type GremlinResourcesClientBeginDeleteGremlinDatabaseOptions

type GremlinResourcesClientBeginDeleteGremlinDatabaseOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GremlinResourcesClientBeginDeleteGremlinDatabaseOptions contains the optional parameters for the GremlinResourcesClient.BeginDeleteGremlinDatabase method.

type GremlinResourcesClientBeginDeleteGremlinGraphOptions

type GremlinResourcesClientBeginDeleteGremlinGraphOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GremlinResourcesClientBeginDeleteGremlinGraphOptions contains the optional parameters for the GremlinResourcesClient.BeginDeleteGremlinGraph method.

type GremlinResourcesClientBeginMigrateGremlinDatabaseToAutoscaleOptions

type GremlinResourcesClientBeginMigrateGremlinDatabaseToAutoscaleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GremlinResourcesClientBeginMigrateGremlinDatabaseToAutoscaleOptions contains the optional parameters for the GremlinResourcesClient.BeginMigrateGremlinDatabaseToAutoscale method.

type GremlinResourcesClientBeginMigrateGremlinDatabaseToManualThroughputOptions

type GremlinResourcesClientBeginMigrateGremlinDatabaseToManualThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GremlinResourcesClientBeginMigrateGremlinDatabaseToManualThroughputOptions contains the optional parameters for the GremlinResourcesClient.BeginMigrateGremlinDatabaseToManualThroughput method.

type GremlinResourcesClientBeginMigrateGremlinGraphToAutoscaleOptions

type GremlinResourcesClientBeginMigrateGremlinGraphToAutoscaleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GremlinResourcesClientBeginMigrateGremlinGraphToAutoscaleOptions contains the optional parameters for the GremlinResourcesClient.BeginMigrateGremlinGraphToAutoscale method.

type GremlinResourcesClientBeginMigrateGremlinGraphToManualThroughputOptions

type GremlinResourcesClientBeginMigrateGremlinGraphToManualThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GremlinResourcesClientBeginMigrateGremlinGraphToManualThroughputOptions contains the optional parameters for the GremlinResourcesClient.BeginMigrateGremlinGraphToManualThroughput method.

type GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions

type GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the GremlinResourcesClient.BeginRetrieveContinuousBackupInformation method.

type GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions

type GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions contains the optional parameters for the GremlinResourcesClient.BeginUpdateGremlinDatabaseThroughput method.

type GremlinResourcesClientBeginUpdateGremlinGraphThroughputOptions

type GremlinResourcesClientBeginUpdateGremlinGraphThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GremlinResourcesClientBeginUpdateGremlinGraphThroughputOptions contains the optional parameters for the GremlinResourcesClient.BeginUpdateGremlinGraphThroughput method.

type GremlinResourcesClientCreateUpdateGremlinDatabaseResponse

type GremlinResourcesClientCreateUpdateGremlinDatabaseResponse struct {
	// An Azure Cosmos DB Gremlin database.
	GremlinDatabaseGetResults
}

GremlinResourcesClientCreateUpdateGremlinDatabaseResponse contains the response from method GremlinResourcesClient.BeginCreateUpdateGremlinDatabase.

type GremlinResourcesClientCreateUpdateGremlinGraphResponse

type GremlinResourcesClientCreateUpdateGremlinGraphResponse struct {
	// An Azure Cosmos DB Gremlin graph.
	GremlinGraphGetResults
}

GremlinResourcesClientCreateUpdateGremlinGraphResponse contains the response from method GremlinResourcesClient.BeginCreateUpdateGremlinGraph.

type GremlinResourcesClientDeleteGremlinDatabaseResponse

type GremlinResourcesClientDeleteGremlinDatabaseResponse struct {
}

GremlinResourcesClientDeleteGremlinDatabaseResponse contains the response from method GremlinResourcesClient.BeginDeleteGremlinDatabase.

type GremlinResourcesClientDeleteGremlinGraphResponse

type GremlinResourcesClientDeleteGremlinGraphResponse struct {
}

GremlinResourcesClientDeleteGremlinGraphResponse contains the response from method GremlinResourcesClient.BeginDeleteGremlinGraph.

type GremlinResourcesClientGetGremlinDatabaseOptions

type GremlinResourcesClientGetGremlinDatabaseOptions struct {
}

GremlinResourcesClientGetGremlinDatabaseOptions contains the optional parameters for the GremlinResourcesClient.GetGremlinDatabase method.

type GremlinResourcesClientGetGremlinDatabaseResponse

type GremlinResourcesClientGetGremlinDatabaseResponse struct {
	// An Azure Cosmos DB Gremlin database.
	GremlinDatabaseGetResults
}

GremlinResourcesClientGetGremlinDatabaseResponse contains the response from method GremlinResourcesClient.GetGremlinDatabase.

type GremlinResourcesClientGetGremlinDatabaseThroughputOptions

type GremlinResourcesClientGetGremlinDatabaseThroughputOptions struct {
}

GremlinResourcesClientGetGremlinDatabaseThroughputOptions contains the optional parameters for the GremlinResourcesClient.GetGremlinDatabaseThroughput method.

type GremlinResourcesClientGetGremlinDatabaseThroughputResponse

type GremlinResourcesClientGetGremlinDatabaseThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

GremlinResourcesClientGetGremlinDatabaseThroughputResponse contains the response from method GremlinResourcesClient.GetGremlinDatabaseThroughput.

type GremlinResourcesClientGetGremlinGraphOptions

type GremlinResourcesClientGetGremlinGraphOptions struct {
}

GremlinResourcesClientGetGremlinGraphOptions contains the optional parameters for the GremlinResourcesClient.GetGremlinGraph method.

type GremlinResourcesClientGetGremlinGraphResponse

type GremlinResourcesClientGetGremlinGraphResponse struct {
	// An Azure Cosmos DB Gremlin graph.
	GremlinGraphGetResults
}

GremlinResourcesClientGetGremlinGraphResponse contains the response from method GremlinResourcesClient.GetGremlinGraph.

type GremlinResourcesClientGetGremlinGraphThroughputOptions

type GremlinResourcesClientGetGremlinGraphThroughputOptions struct {
}

GremlinResourcesClientGetGremlinGraphThroughputOptions contains the optional parameters for the GremlinResourcesClient.GetGremlinGraphThroughput method.

type GremlinResourcesClientGetGremlinGraphThroughputResponse

type GremlinResourcesClientGetGremlinGraphThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

GremlinResourcesClientGetGremlinGraphThroughputResponse contains the response from method GremlinResourcesClient.GetGremlinGraphThroughput.

type GremlinResourcesClientListGremlinDatabasesOptions

type GremlinResourcesClientListGremlinDatabasesOptions struct {
}

GremlinResourcesClientListGremlinDatabasesOptions contains the optional parameters for the GremlinResourcesClient.NewListGremlinDatabasesPager method.

type GremlinResourcesClientListGremlinDatabasesResponse

type GremlinResourcesClientListGremlinDatabasesResponse struct {
	// The List operation response, that contains the Gremlin databases and their properties.
	GremlinDatabaseListResult
}

GremlinResourcesClientListGremlinDatabasesResponse contains the response from method GremlinResourcesClient.NewListGremlinDatabasesPager.

type GremlinResourcesClientListGremlinGraphsOptions

type GremlinResourcesClientListGremlinGraphsOptions struct {
}

GremlinResourcesClientListGremlinGraphsOptions contains the optional parameters for the GremlinResourcesClient.NewListGremlinGraphsPager method.

type GremlinResourcesClientListGremlinGraphsResponse

type GremlinResourcesClientListGremlinGraphsResponse struct {
	// The List operation response, that contains the graphs and their properties.
	GremlinGraphListResult
}

GremlinResourcesClientListGremlinGraphsResponse contains the response from method GremlinResourcesClient.NewListGremlinGraphsPager.

type GremlinResourcesClientMigrateGremlinDatabaseToAutoscaleResponse

type GremlinResourcesClientMigrateGremlinDatabaseToAutoscaleResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

GremlinResourcesClientMigrateGremlinDatabaseToAutoscaleResponse contains the response from method GremlinResourcesClient.BeginMigrateGremlinDatabaseToAutoscale.

type GremlinResourcesClientMigrateGremlinDatabaseToManualThroughputResponse

type GremlinResourcesClientMigrateGremlinDatabaseToManualThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

GremlinResourcesClientMigrateGremlinDatabaseToManualThroughputResponse contains the response from method GremlinResourcesClient.BeginMigrateGremlinDatabaseToManualThroughput.

type GremlinResourcesClientMigrateGremlinGraphToAutoscaleResponse

type GremlinResourcesClientMigrateGremlinGraphToAutoscaleResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

GremlinResourcesClientMigrateGremlinGraphToAutoscaleResponse contains the response from method GremlinResourcesClient.BeginMigrateGremlinGraphToAutoscale.

type GremlinResourcesClientMigrateGremlinGraphToManualThroughputResponse

type GremlinResourcesClientMigrateGremlinGraphToManualThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

GremlinResourcesClientMigrateGremlinGraphToManualThroughputResponse contains the response from method GremlinResourcesClient.BeginMigrateGremlinGraphToManualThroughput.

type GremlinResourcesClientRetrieveContinuousBackupInformationResponse

type GremlinResourcesClientRetrieveContinuousBackupInformationResponse struct {
	// Backup information of a resource.
	BackupInformation
}

GremlinResourcesClientRetrieveContinuousBackupInformationResponse contains the response from method GremlinResourcesClient.BeginRetrieveContinuousBackupInformation.

type GremlinResourcesClientUpdateGremlinDatabaseThroughputResponse

type GremlinResourcesClientUpdateGremlinDatabaseThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

GremlinResourcesClientUpdateGremlinDatabaseThroughputResponse contains the response from method GremlinResourcesClient.BeginUpdateGremlinDatabaseThroughput.

type GremlinResourcesClientUpdateGremlinGraphThroughputResponse

type GremlinResourcesClientUpdateGremlinGraphThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

GremlinResourcesClientUpdateGremlinGraphThroughputResponse contains the response from method GremlinResourcesClient.BeginUpdateGremlinGraphThroughput.

type IPAddressOrRange

type IPAddressOrRange struct {
	// A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be well-formatted and cannot be
	// contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10,
	// 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245”
	// or “23.40.210.0/8”.
	IPAddressOrRange *string
}

IPAddressOrRange - IpAddressOrRange object

func (IPAddressOrRange) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type IPAddressOrRange.

func (*IPAddressOrRange) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type IPAddressOrRange.

type IncludedPath

type IncludedPath struct {
	// List of indexes for this path
	Indexes []*Indexes

	// The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
	Path *string
}

IncludedPath - The paths that are included in indexing

func (IncludedPath) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type IncludedPath.

func (*IncludedPath) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type IncludedPath.

type IndexKind

type IndexKind string

IndexKind - Indicates the type of index.

const (
	IndexKindHash    IndexKind = "Hash"
	IndexKindRange   IndexKind = "Range"
	IndexKindSpatial IndexKind = "Spatial"
)

func PossibleIndexKindValues

func PossibleIndexKindValues() []IndexKind

PossibleIndexKindValues returns the possible values for the IndexKind const type.

type Indexes

type Indexes struct {
	// The datatype for which the indexing behavior is applied to.
	DataType *DataType

	// Indicates the type of index.
	Kind *IndexKind

	// The precision of the index. -1 is maximum precision.
	Precision *int32
}

Indexes - The indexes for the path.

func (Indexes) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Indexes.

func (*Indexes) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Indexes.

type IndexingMode

type IndexingMode string

IndexingMode - Indicates the indexing mode.

const (
	IndexingModeConsistent IndexingMode = "consistent"
	IndexingModeLazy       IndexingMode = "lazy"
	IndexingModeNone       IndexingMode = "none"
)

func PossibleIndexingModeValues

func PossibleIndexingModeValues() []IndexingMode

PossibleIndexingModeValues returns the possible values for the IndexingMode const type.

type IndexingPolicy

type IndexingPolicy struct {
	// Indicates if the indexing policy is automatic
	Automatic *bool

	// List of composite path list
	CompositeIndexes [][]*CompositePath

	// List of paths to exclude from indexing
	ExcludedPaths []*ExcludedPath

	// List of paths to include in the indexing
	IncludedPaths []*IncludedPath

	// Indicates the indexing mode.
	IndexingMode *IndexingMode

	// List of spatial specifics
	SpatialIndexes []*SpatialSpec
}

IndexingPolicy - Cosmos DB indexing policy

func (IndexingPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type IndexingPolicy.

func (*IndexingPolicy) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type IndexingPolicy.

type KeyKind

type KeyKind string

KeyKind - The access key to regenerate.

const (
	KeyKindPrimary           KeyKind = "primary"
	KeyKindPrimaryReadonly   KeyKind = "primaryReadonly"
	KeyKindSecondary         KeyKind = "secondary"
	KeyKindSecondaryReadonly KeyKind = "secondaryReadonly"
)

func PossibleKeyKindValues

func PossibleKeyKindValues() []KeyKind

PossibleKeyKindValues returns the possible values for the KeyKind const type.

type KeyWrapMetadata

type KeyWrapMetadata struct {
	// Algorithm used in wrapping and unwrapping of the data encryption key.
	Algorithm *string

	// The name of associated KeyEncryptionKey (aka CustomerManagedKey).
	Name *string

	// ProviderName of KeyStoreProvider.
	Type *string

	// Reference / link to the KeyEncryptionKey.
	Value *string
}

KeyWrapMetadata - Represents key wrap metadata that a key wrapping provider can use to wrap/unwrap a client encryption key.

func (KeyWrapMetadata) MarshalJSON

func (k KeyWrapMetadata) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyWrapMetadata.

func (*KeyWrapMetadata) UnmarshalJSON

func (k *KeyWrapMetadata) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyWrapMetadata.

type Kind

type Kind string

Kind - Kind of the connection string key

const (
	KindPrimary           Kind = "Primary"
	KindPrimaryReadonly   Kind = "PrimaryReadonly"
	KindSecondary         Kind = "Secondary"
	KindSecondaryReadonly Kind = "SecondaryReadonly"
)

func PossibleKindValues

func PossibleKindValues() []Kind

PossibleKindValues returns the possible values for the Kind const type.

type ListBackups

type ListBackups struct {
	// READ-ONLY; Container for array of backups.
	Value []*BackupResource
}

ListBackups - List of restorable backups for a Cassandra cluster.

func (ListBackups) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ListBackups.

func (*ListBackups) UnmarshalJSON

func (l *ListBackups) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListBackups.

type ListClusters

type ListClusters struct {
	// Container for the array of clusters.
	Value []*ClusterResource
}

ListClusters - List of managed Cassandra clusters.

func (ListClusters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ListClusters.

func (*ListClusters) UnmarshalJSON

func (l *ListClusters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListClusters.

type ListCommands

type ListCommands struct {
	// READ-ONLY; Container for array of commands.
	Value []*CommandPublicResource
}

ListCommands - List of commands for cluster.

func (ListCommands) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ListCommands.

func (*ListCommands) UnmarshalJSON

func (l *ListCommands) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListCommands.

type ListConnectionStringsResult

type ListConnectionStringsResult struct {
	// READ-ONLY; An array that contains the connection strings for a mongo cluster.
	ConnectionStrings []*ConnectionString
}

ListConnectionStringsResult - The connection strings for the given mongo cluster.

func (ListConnectionStringsResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ListConnectionStringsResult.

func (*ListConnectionStringsResult) UnmarshalJSON

func (l *ListConnectionStringsResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListConnectionStringsResult.

type ListDataCenters

type ListDataCenters struct {
	// READ-ONLY; Container for array of data centers.
	Value []*DataCenterResource
}

ListDataCenters - List of managed Cassandra data centers and their properties.

func (ListDataCenters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ListDataCenters.

func (*ListDataCenters) UnmarshalJSON

func (l *ListDataCenters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListDataCenters.

type Location

type Location struct {
	// The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover
	// priority = (total number of regions - 1). Failover priority values must be
	// unique for each of the regions in which the database account exists.
	FailoverPriority *int32

	// Flag to indicate whether or not this region is an AvailabilityZone region
	IsZoneRedundant *bool

	// The name of the region.
	LocationName *string

	// READ-ONLY; The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/
	DocumentEndpoint *string

	// READ-ONLY; The unique identifier of the region within the database account. Example: <accountName>-<locationName>.
	ID *string

	// READ-ONLY; The status of the Cosmos DB account at the time the operation was called. The status can be one of following.
	// 'Creating' – the Cosmos DB account is being created. When an account is in Creating state,
	// only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the
	// Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being
	// updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed'
	// – the Cosmos DB account deletion failed.
	ProvisioningState *string
}

Location - A region in which the Azure Cosmos DB database account is deployed.

func (Location) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Location.

func (*Location) UnmarshalJSON

func (l *Location) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Location.

type LocationGetResult

type LocationGetResult struct {
	// Cosmos DB location metadata
	Properties *LocationProperties

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

LocationGetResult - Cosmos DB location get result

func (LocationGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LocationGetResult.

func (*LocationGetResult) UnmarshalJSON

func (l *LocationGetResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LocationGetResult.

type LocationListResult

type LocationListResult struct {
	// READ-ONLY; List of Cosmos DB locations and their properties.
	Value []*LocationGetResult
}

LocationListResult - The List operation response, that contains Cosmos DB locations and their properties.

func (LocationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LocationListResult.

func (*LocationListResult) UnmarshalJSON

func (l *LocationListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LocationListResult.

type LocationProperties

type LocationProperties struct {
	// READ-ONLY; The properties of available backup storage redundancies.
	BackupStorageRedundancies []*BackupStorageRedundancy

	// READ-ONLY; Flag indicating whether the location is residency sensitive.
	IsResidencyRestricted *bool

	// READ-ONLY; Flag indicating whether the subscription have access in region for Availability Zones(Az).
	IsSubscriptionRegionAccessAllowedForAz *bool

	// READ-ONLY; Flag indicating whether the subscription have access in region for Non-Availability Zones.
	IsSubscriptionRegionAccessAllowedForRegular *bool

	// READ-ONLY; Enum to indicate current buildout status of the region.
	Status *Status

	// READ-ONLY; Flag indicating whether the location supports availability zones or not.
	SupportsAvailabilityZone *bool
}

LocationProperties - Cosmos DB location metadata

func (LocationProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LocationProperties.

func (*LocationProperties) UnmarshalJSON

func (l *LocationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LocationProperties.

type LocationsClient

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

LocationsClient contains the methods for the Locations group. Don't use this type directly, use NewLocationsClient() instead.

func NewLocationsClient

func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationsClient, error)

NewLocationsClient creates a new instance of LocationsClient with the specified values.

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

func (*LocationsClient) Get

Get - Get the properties of an existing Cosmos DB location If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • options - LocationsClientGetOptions contains the optional parameters for the LocationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBLocationGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewLocationsClient().Get(ctx, "westus", 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.LocationGetResult = armcosmos.LocationGetResult{
// 	Name: to.Ptr("westus"),
// 	Type: to.Ptr("Microsoft.DocumentDB/locations"),
// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus"),
// 	Properties: &armcosmos.LocationProperties{
// 		BackupStorageRedundancies: []*armcosmos.BackupStorageRedundancy{
// 			to.Ptr(armcosmos.BackupStorageRedundancyLocal),
// 			to.Ptr(armcosmos.BackupStorageRedundancyGeo)},
// 			IsResidencyRestricted: to.Ptr(true),
// 			IsSubscriptionRegionAccessAllowedForAz: to.Ptr(true),
// 			IsSubscriptionRegionAccessAllowedForRegular: to.Ptr(true),
// 			Status: to.Ptr(armcosmos.StatusOnline),
// 			SupportsAvailabilityZone: to.Ptr(true),
// 		},
// 	}
Output:

func (*LocationsClient) NewListPager

NewListPager - List Cosmos DB locations and their properties

Generated from API version 2024-02-15-preview

  • options - LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBLocationList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewLocationsClient().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.LocationListResult = armcosmos.LocationListResult{
	// 	Value: []*armcosmos.LocationGetResult{
	// 		{
	// 			Name: to.Ptr("westus"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations"),
	// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus"),
	// 			Properties: &armcosmos.LocationProperties{
	// 				BackupStorageRedundancies: []*armcosmos.BackupStorageRedundancy{
	// 					to.Ptr(armcosmos.BackupStorageRedundancyLocal),
	// 					to.Ptr(armcosmos.BackupStorageRedundancyGeo)},
	// 					IsResidencyRestricted: to.Ptr(false),
	// 					IsSubscriptionRegionAccessAllowedForAz: to.Ptr(false),
	// 					IsSubscriptionRegionAccessAllowedForRegular: to.Ptr(true),
	// 					Status: to.Ptr(armcosmos.StatusOnline),
	// 					SupportsAvailabilityZone: to.Ptr(false),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("centralus"),
	// 				Type: to.Ptr("Microsoft.DocumentDB/locations"),
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/centralus"),
	// 				Properties: &armcosmos.LocationProperties{
	// 					BackupStorageRedundancies: []*armcosmos.BackupStorageRedundancy{
	// 						to.Ptr(armcosmos.BackupStorageRedundancyZone),
	// 						to.Ptr(armcosmos.BackupStorageRedundancyGeo)},
	// 						IsResidencyRestricted: to.Ptr(false),
	// 						IsSubscriptionRegionAccessAllowedForAz: to.Ptr(true),
	// 						IsSubscriptionRegionAccessAllowedForRegular: to.Ptr(false),
	// 						Status: to.Ptr(armcosmos.StatusOnline),
	// 						SupportsAvailabilityZone: to.Ptr(true),
	// 					},
	// 			}},
	// 		}
}
Output:

type LocationsClientGetOptions

type LocationsClientGetOptions struct {
}

LocationsClientGetOptions contains the optional parameters for the LocationsClient.Get method.

type LocationsClientGetResponse

type LocationsClientGetResponse struct {
	// Cosmos DB location get result
	LocationGetResult
}

LocationsClientGetResponse contains the response from method LocationsClient.Get.

type LocationsClientListOptions

type LocationsClientListOptions struct {
}

LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method.

type LocationsClientListResponse

type LocationsClientListResponse struct {
	// The List operation response, that contains Cosmos DB locations and their properties.
	LocationListResult
}

LocationsClientListResponse contains the response from method LocationsClient.NewListPager.

type ManagedCassandraARMResourceProperties

type ManagedCassandraARMResourceProperties struct {
	// Identity for the resource.
	Identity *ManagedCassandraManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

ManagedCassandraARMResourceProperties - The core properties of ARM resources.

func (ManagedCassandraARMResourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedCassandraARMResourceProperties.

func (*ManagedCassandraARMResourceProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCassandraARMResourceProperties.

type ManagedCassandraManagedServiceIdentity

type ManagedCassandraManagedServiceIdentity struct {
	// The type of the resource.
	Type *ManagedCassandraResourceIdentityType

	// READ-ONLY; The object id of the identity resource.
	PrincipalID *string

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

ManagedCassandraManagedServiceIdentity - Identity for the resource.

func (ManagedCassandraManagedServiceIdentity) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedCassandraManagedServiceIdentity.

func (*ManagedCassandraManagedServiceIdentity) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCassandraManagedServiceIdentity.

type ManagedCassandraProvisioningState

type ManagedCassandraProvisioningState string

ManagedCassandraProvisioningState - The status of the resource at the time the operation was called.

const (
	ManagedCassandraProvisioningStateCanceled  ManagedCassandraProvisioningState = "Canceled"
	ManagedCassandraProvisioningStateCreating  ManagedCassandraProvisioningState = "Creating"
	ManagedCassandraProvisioningStateDeleting  ManagedCassandraProvisioningState = "Deleting"
	ManagedCassandraProvisioningStateFailed    ManagedCassandraProvisioningState = "Failed"
	ManagedCassandraProvisioningStateSucceeded ManagedCassandraProvisioningState = "Succeeded"
	ManagedCassandraProvisioningStateUpdating  ManagedCassandraProvisioningState = "Updating"
)

func PossibleManagedCassandraProvisioningStateValues

func PossibleManagedCassandraProvisioningStateValues() []ManagedCassandraProvisioningState

PossibleManagedCassandraProvisioningStateValues returns the possible values for the ManagedCassandraProvisioningState const type.

type ManagedCassandraReaperStatus

type ManagedCassandraReaperStatus struct {
	Healthy *bool

	// Dictionary of
	RepairRunIDs map[string]*string

	// Dictionary of
	RepairSchedules map[string]*string
}

func (ManagedCassandraReaperStatus) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedCassandraReaperStatus.

func (*ManagedCassandraReaperStatus) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCassandraReaperStatus.

type ManagedCassandraResourceIdentityType

type ManagedCassandraResourceIdentityType string

ManagedCassandraResourceIdentityType - The type of the resource.

const (
	ManagedCassandraResourceIdentityTypeNone           ManagedCassandraResourceIdentityType = "None"
	ManagedCassandraResourceIdentityTypeSystemAssigned ManagedCassandraResourceIdentityType = "SystemAssigned"
)

func PossibleManagedCassandraResourceIdentityTypeValues

func PossibleManagedCassandraResourceIdentityTypeValues() []ManagedCassandraResourceIdentityType

PossibleManagedCassandraResourceIdentityTypeValues returns the possible values for the ManagedCassandraResourceIdentityType const type.

type ManagedServiceIdentity

type ManagedServiceIdentity struct {
	// The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created
	// identity and a set of user assigned identities. The type 'None' will remove any
	// identities from the service.
	Type *ResourceIdentityType

	// The list of user identities associated with resource. The user identity dictionary key references will be ARM resource
	// ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
	UserAssignedIdentities map[string]*Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties

	// READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned
	// identity.
	PrincipalID *string

	// READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity.
	TenantID *string
}

ManagedServiceIdentity - Identity for the resource.

func (ManagedServiceIdentity) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.

func (*ManagedServiceIdentity) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity.

type MaterializedViewDefinition

type MaterializedViewDefinition struct {
	// REQUIRED; The definition should be an SQL query which would be used to fetch data from the source container to populate
	// into the Materialized View container.
	Definition *string

	// REQUIRED; The name of the source container on which the Materialized View will be created.
	SourceCollectionID *string

	// READ-ONLY; An unique identifier for the source collection. This is a system generated property.
	SourceCollectionRid *string
}

MaterializedViewDefinition - Materialized View definition for the container.

func (MaterializedViewDefinition) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MaterializedViewDefinition.

func (*MaterializedViewDefinition) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MaterializedViewDefinition.

type MaterializedViewsBuilderRegionalServiceResource

type MaterializedViewsBuilderRegionalServiceResource struct {
	// READ-ONLY; The location name.
	Location *string

	// READ-ONLY; The regional service name.
	Name *string

	// READ-ONLY; Describes the status of a service.
	Status *ServiceStatus
}

MaterializedViewsBuilderRegionalServiceResource - Resource for a regional service location.

func (MaterializedViewsBuilderRegionalServiceResource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type MaterializedViewsBuilderRegionalServiceResource.

func (*MaterializedViewsBuilderRegionalServiceResource) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type MaterializedViewsBuilderRegionalServiceResource.

type MaterializedViewsBuilderServiceResource

type MaterializedViewsBuilderServiceResource struct {
	// Properties for MaterializedViewsBuilderServiceResource.
	Properties *MaterializedViewsBuilderServiceResourceProperties
}

MaterializedViewsBuilderServiceResource - Describes the service response property for MaterializedViewsBuilder.

func (MaterializedViewsBuilderServiceResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MaterializedViewsBuilderServiceResource.

func (*MaterializedViewsBuilderServiceResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MaterializedViewsBuilderServiceResource.

type MaterializedViewsBuilderServiceResourceProperties

type MaterializedViewsBuilderServiceResourceProperties struct {
	// REQUIRED; ServiceType for the service.
	ServiceType *ServiceType

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

	// Instance count for the service.
	InstanceCount *int32

	// Instance type for the service.
	InstanceSize *ServiceSize

	// READ-ONLY; Time of the last state change (ISO-8601 format).
	CreationTime *time.Time

	// READ-ONLY; An array that contains all of the locations for the service.
	Locations []*MaterializedViewsBuilderRegionalServiceResource

	// READ-ONLY; Describes the status of a service.
	Status *ServiceStatus
}

MaterializedViewsBuilderServiceResourceProperties - Properties for MaterializedViewsBuilderServiceResource.

func (*MaterializedViewsBuilderServiceResourceProperties) GetServiceResourceProperties

GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type MaterializedViewsBuilderServiceResourceProperties.

func (MaterializedViewsBuilderServiceResourceProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type MaterializedViewsBuilderServiceResourceProperties.

func (*MaterializedViewsBuilderServiceResourceProperties) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type MaterializedViewsBuilderServiceResourceProperties.

type MergeParameters

type MergeParameters struct {
	// Specifies whether the operation is a real merge operation or a simulation.
	IsDryRun *bool
}

MergeParameters - The properties of an Azure Cosmos DB merge operations

func (MergeParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MergeParameters.

func (*MergeParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MergeParameters.

type Metric

type Metric struct {
	// READ-ONLY; The end time for the metric (ISO-8601 format).
	EndTime *time.Time

	// READ-ONLY; The metric values for the specified time window and timestep.
	MetricValues []*MetricValue

	// READ-ONLY; The name information for the metric.
	Name *MetricName

	// READ-ONLY; The start time for the metric (ISO-8601 format).
	StartTime *time.Time

	// READ-ONLY; The time grain to be used to summarize the metric values.
	TimeGrain *string

	// READ-ONLY; The unit of the metric.
	Unit *UnitType
}

Metric data

func (Metric) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Metric.

func (*Metric) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Metric.

type MetricAvailability

type MetricAvailability struct {
	// READ-ONLY; The retention for the metric values.
	Retention *string

	// READ-ONLY; The time grain to be used to summarize the metric values.
	TimeGrain *string
}

MetricAvailability - The availability of the metric.

func (MetricAvailability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MetricAvailability.

func (*MetricAvailability) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MetricAvailability.

type MetricDefinition

type MetricDefinition struct {
	// READ-ONLY; The list of metric availabilities for the account.
	MetricAvailabilities []*MetricAvailability

	// READ-ONLY; The name information for the metric.
	Name *MetricName

	// READ-ONLY; The primary aggregation type of the metric.
	PrimaryAggregationType *PrimaryAggregationType

	// READ-ONLY; The resource uri of the database.
	ResourceURI *string

	// READ-ONLY; The unit of the metric.
	Unit *UnitType
}

MetricDefinition - The definition of a metric.

func (MetricDefinition) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MetricDefinition.

func (*MetricDefinition) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinition.

type MetricDefinitionsListResult

type MetricDefinitionsListResult struct {
	// READ-ONLY; The list of metric definitions for the account.
	Value []*MetricDefinition
}

MetricDefinitionsListResult - The response to a list metric definitions request.

func (MetricDefinitionsListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MetricDefinitionsListResult.

func (*MetricDefinitionsListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinitionsListResult.

type MetricListResult

type MetricListResult struct {
	// READ-ONLY; The list of metrics for the account.
	Value []*Metric
}

MetricListResult - The response to a list metrics request.

func (MetricListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MetricListResult.

func (*MetricListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MetricListResult.

type MetricName

type MetricName struct {
	// READ-ONLY; The friendly name of the metric.
	LocalizedValue *string

	// READ-ONLY; The name of the metric.
	Value *string
}

MetricName - A metric name.

func (MetricName) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MetricName.

func (*MetricName) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MetricName.

type MetricValue

type MetricValue struct {
	// READ-ONLY; The average value of the metric.
	Average *float64

	// READ-ONLY; The number of values for the metric.
	Count *int32

	// READ-ONLY; The max value of the metric.
	Maximum *float64

	// READ-ONLY; The min value of the metric.
	Minimum *float64

	// READ-ONLY; The metric timestamp (ISO-8601 format).
	Timestamp *time.Time

	// READ-ONLY; The total value of the metric.
	Total *float64
}

MetricValue - Represents metrics values.

func (MetricValue) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MetricValue.

func (*MetricValue) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MetricValue.

type MinimalTLSVersion

type MinimalTLSVersion string

MinimalTLSVersion - Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2.

const (
	MinimalTLSVersionTLS   MinimalTLSVersion = "Tls"
	MinimalTLSVersionTls11 MinimalTLSVersion = "Tls11"
	MinimalTLSVersionTls12 MinimalTLSVersion = "Tls12"
)

func PossibleMinimalTLSVersionValues

func PossibleMinimalTLSVersionValues() []MinimalTLSVersion

PossibleMinimalTLSVersionValues returns the possible values for the MinimalTLSVersion const type.

type MongoCluster

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

	// Properties of the mongo cluster.
	Properties *MongoClusterProperties

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

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

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

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

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

MongoCluster - Represents a mongo cluster resource.

func (MongoCluster) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoCluster.

func (*MongoCluster) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoCluster.

type MongoClusterListResult

type MongoClusterListResult struct {
	// The list of mongo clusters
	Value []*MongoCluster

	// READ-ONLY; The link used to get the next page of results.
	NextLink *string
}

MongoClusterListResult - A list of mongo clusters.

func (MongoClusterListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoClusterListResult.

func (*MongoClusterListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoClusterListResult.

type MongoClusterProperties

type MongoClusterProperties struct {
	// The administrator's login for the mongo cluster.
	AdministratorLogin *string

	// The password of the administrator login.
	AdministratorLoginPassword *string

	// The mode to create a mongo cluster.
	CreateMode *CreateMode

	// The list of node group specs in the cluster.
	NodeGroupSpecs []*NodeGroupSpec

	// Parameters used for restore operations
	RestoreParameters *MongoClusterRestoreParameters

	// The Mongo DB server version. Defaults to the latest available version if not specified.
	ServerVersion *string

	// READ-ONLY; A status of the mongo cluster.
	ClusterStatus *MongoClusterStatus

	// READ-ONLY; The default mongo connection string for the cluster.
	ConnectionString *string

	// READ-ONLY; Earliest restore timestamp in UTC ISO8601 format.
	EarliestRestoreTime *string

	// READ-ONLY; A provisioning state of the mongo cluster.
	ProvisioningState *ProvisioningState
}

MongoClusterProperties - The properties of a mongo cluster.

func (MongoClusterProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoClusterProperties.

func (*MongoClusterProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoClusterProperties.

type MongoClusterRestoreParameters

type MongoClusterRestoreParameters struct {
	// UTC point in time to restore a mongo cluster
	PointInTimeUTC *time.Time

	// Resource ID to locate the source cluster to restore
	SourceResourceID *string
}

MongoClusterRestoreParameters - Parameters used for restore operations

func (MongoClusterRestoreParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoClusterRestoreParameters.

func (*MongoClusterRestoreParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoClusterRestoreParameters.

type MongoClusterStatus

type MongoClusterStatus string

MongoClusterStatus - The status of the resource at the time the operation was called.

const (
	MongoClusterStatusDropping     MongoClusterStatus = "Dropping"
	MongoClusterStatusProvisioning MongoClusterStatus = "Provisioning"
	MongoClusterStatusReady        MongoClusterStatus = "Ready"
	MongoClusterStatusStarting     MongoClusterStatus = "Starting"
	MongoClusterStatusStopped      MongoClusterStatus = "Stopped"
	MongoClusterStatusStopping     MongoClusterStatus = "Stopping"
	MongoClusterStatusUpdating     MongoClusterStatus = "Updating"
)

func PossibleMongoClusterStatusValues

func PossibleMongoClusterStatusValues() []MongoClusterStatus

PossibleMongoClusterStatusValues returns the possible values for the MongoClusterStatus const type.

type MongoClusterUpdate

type MongoClusterUpdate struct {
	// Properties of the mongo cluster.
	Properties *MongoClusterProperties

	// Application-specific metadata in the form of key-value pairs.
	Tags map[string]*string
}

MongoClusterUpdate - Represents a mongo cluster resource for updates.

func (MongoClusterUpdate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoClusterUpdate.

func (*MongoClusterUpdate) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoClusterUpdate.

type MongoClustersClient

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

MongoClustersClient contains the methods for the MongoClusters group. Don't use this type directly, use NewMongoClustersClient() instead.

func NewMongoClustersClient

func NewMongoClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MongoClustersClient, error)

NewMongoClustersClient creates a new instance of MongoClustersClient with the specified values.

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

func (*MongoClustersClient) BeginCreateOrUpdate

func (client *MongoClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, mongoClusterName string, parameters MongoCluster, options *MongoClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[MongoClustersClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • mongoClusterName - The name of the mongo cluster.
  • parameters - The required parameters for creating or updating a mongo cluster.
  • options - MongoClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the MongoClustersClient.BeginCreateOrUpdate method.
Example (CreateANewMongoCluster)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoClustersClient().BeginCreateOrUpdate(ctx, "TestResourceGroup", "myMongoCluster", armcosmos.MongoCluster{
	Location: to.Ptr("westus2"),
	Properties: &armcosmos.MongoClusterProperties{
		AdministratorLogin:         to.Ptr("mongoAdmin"),
		AdministratorLoginPassword: to.Ptr("password"),
		NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
			{
				DiskSizeGB: to.Ptr[int64](128),
				EnableHa:   to.Ptr(true),
				SKU:        to.Ptr("M30"),
				Kind:       to.Ptr(armcosmos.NodeKindShard),
				NodeCount:  to.Ptr[int32](3),
			}},
		ServerVersion: to.Ptr("5.0"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.MongoCluster = armcosmos.MongoCluster{
// 	Name: to.Ptr("myMongoCluster"),
// 	Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"),
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"),
// 	SystemData: &armcosmos.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// 		CreatedBy: to.Ptr("user1"),
// 		CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()),
// 		LastModifiedBy: to.Ptr("user2"),
// 		LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 	},
// 	Location: to.Ptr("westus2"),
// 	Properties: &armcosmos.MongoClusterProperties{
// 		AdministratorLogin: to.Ptr("mongoAdmin"),
// 		ConnectionString: to.Ptr("mongodb+srv://<user>:<password>@myMongoCluster.mongocluster.cosmos.azure.com"),
// 		EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"),
// 		NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
// 			{
// 				DiskSizeGB: to.Ptr[int64](128),
// 				EnableHa: to.Ptr(true),
// 				SKU: to.Ptr("M30"),
// 				Kind: to.Ptr(armcosmos.NodeKindShard),
// 				NodeCount: to.Ptr[int32](3),
// 		}},
// 		ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
// 		ServerVersion: to.Ptr("5.0"),
// 	},
// }
Output:

Example (CreateANewMongoClusterWithPointInTimeRestore)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterCreatePITR.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoClustersClient().BeginCreateOrUpdate(ctx, "TestResourceGroup", "myMongoCluster", armcosmos.MongoCluster{
	Location: to.Ptr("westus2"),
	Properties: &armcosmos.MongoClusterProperties{
		CreateMode: to.Ptr(armcosmos.CreateModePointInTimeRestore),
		RestoreParameters: &armcosmos.MongoClusterRestoreParameters{
			PointInTimeUTC:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-13T20:07:35.000Z"); return t }()),
			SourceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myOtherMongoCluster"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.MongoCluster = armcosmos.MongoCluster{
// 	Name: to.Ptr("myMongoCluster"),
// 	Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"),
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"),
// 	Location: to.Ptr("westus2"),
// 	Properties: &armcosmos.MongoClusterProperties{
// 		AdministratorLogin: to.Ptr("mongoAdmin"),
// 		ConnectionString: to.Ptr("mongodb+srv://<user>:<password>@myMongoCluster.mongocluster.cosmos.azure.com"),
// 		EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"),
// 		NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
// 			{
// 				DiskSizeGB: to.Ptr[int64](128),
// 				EnableHa: to.Ptr(true),
// 				SKU: to.Ptr("M30"),
// 				Kind: to.Ptr(armcosmos.NodeKindShard),
// 				NodeCount: to.Ptr[int32](3),
// 		}},
// 		ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
// 		ServerVersion: to.Ptr("5.0"),
// 	},
// }
Output:

func (*MongoClustersClient) BeginCreateOrUpdateFirewallRule

func (client *MongoClustersClient) BeginCreateOrUpdateFirewallRule(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, parameters FirewallRule, options *MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions) (*runtime.Poller[MongoClustersClientCreateOrUpdateFirewallRuleResponse], error)

BeginCreateOrUpdateFirewallRule - Creates a new firewall rule or updates an existing firewall rule on a mongo cluster. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • mongoClusterName - The name of the mongo cluster.
  • firewallRuleName - The name of the mongo cluster firewall rule.
  • parameters - The required parameters for creating or updating a firewall rule.
  • options - MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions contains the optional parameters for the MongoClustersClient.BeginCreateOrUpdateFirewallRule method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterFirewallRuleCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoClustersClient().BeginCreateOrUpdateFirewallRule(ctx, "TestGroup", "myMongoCluster", "rule1", armcosmos.FirewallRule{
	Properties: &armcosmos.FirewallRuleProperties{
		EndIPAddress:   to.Ptr("255.255.255.255"),
		StartIPAddress: to.Ptr("0.0.0.0"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.FirewallRule = armcosmos.FirewallRule{
// 	Name: to.Ptr("rule1"),
// 	Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"),
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"),
// 	SystemData: &armcosmos.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// 		CreatedBy: to.Ptr("user1"),
// 		CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()),
// 		LastModifiedBy: to.Ptr("user2"),
// 		LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 	},
// 	Properties: &armcosmos.FirewallRuleProperties{
// 		EndIPAddress: to.Ptr("255.255.255.255"),
// 		ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
// 		StartIPAddress: to.Ptr("0.0.0.0"),
// 	},
// }
Output:

func (*MongoClustersClient) BeginDelete

func (client *MongoClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientBeginDeleteOptions) (*runtime.Poller[MongoClustersClientDeleteResponse], error)

BeginDelete - Deletes a mongo cluster. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • mongoClusterName - The name of the mongo cluster.
  • options - MongoClustersClientBeginDeleteOptions contains the optional parameters for the MongoClustersClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoClustersClient().BeginDelete(ctx, "TestResourceGroup", "myMongoCluster", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*MongoClustersClient) BeginDeleteFirewallRule

func (client *MongoClustersClient) BeginDeleteFirewallRule(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *MongoClustersClientBeginDeleteFirewallRuleOptions) (*runtime.Poller[MongoClustersClientDeleteFirewallRuleResponse], error)

BeginDeleteFirewallRule - Deletes a mongo cluster firewall rule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • mongoClusterName - The name of the mongo cluster.
  • firewallRuleName - The name of the mongo cluster firewall rule.
  • options - MongoClustersClientBeginDeleteFirewallRuleOptions contains the optional parameters for the MongoClustersClient.BeginDeleteFirewallRule method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterFirewallRuleDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoClustersClient().BeginDeleteFirewallRule(ctx, "TestGroup", "myMongoCluster", "rule1", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*MongoClustersClient) BeginUpdate

func (client *MongoClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, mongoClusterName string, parameters MongoClusterUpdate, options *MongoClustersClientBeginUpdateOptions) (*runtime.Poller[MongoClustersClientUpdateResponse], error)

BeginUpdate - Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • mongoClusterName - The name of the mongo cluster.
  • parameters - The parameters for updating a mongo cluster.
  • options - MongoClustersClientBeginUpdateOptions contains the optional parameters for the MongoClustersClient.BeginUpdate method.
Example (AddNewShardNodes)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterAddNode.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoClustersClient().BeginUpdate(ctx, "TestResourceGroup", "myMongoCluster", armcosmos.MongoClusterUpdate{
	Properties: &armcosmos.MongoClusterProperties{
		NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
			{
				Kind:      to.Ptr(armcosmos.NodeKindShard),
				NodeCount: to.Ptr[int32](4),
			}},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.MongoCluster = armcosmos.MongoCluster{
// 	Name: to.Ptr("myMongoCluster"),
// 	Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"),
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"),
// 	SystemData: &armcosmos.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// 		CreatedBy: to.Ptr("user1"),
// 		CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()),
// 		LastModifiedBy: to.Ptr("user2"),
// 		LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 	},
// 	Location: to.Ptr("westus2"),
// 	Properties: &armcosmos.MongoClusterProperties{
// 		AdministratorLogin: to.Ptr("mongoAdmin"),
// 		ConnectionString: to.Ptr("mongodb+srv://<user>:<password>@myMongoCluster.mongocluster.cosmos.azure.com"),
// 		EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"),
// 		NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
// 			{
// 				DiskSizeGB: to.Ptr[int64](128),
// 				EnableHa: to.Ptr(true),
// 				SKU: to.Ptr("M30"),
// 				Kind: to.Ptr(armcosmos.NodeKindShard),
// 				NodeCount: to.Ptr[int32](4),
// 		}},
// 		ServerVersion: to.Ptr("5.0"),
// 	},
// }
Output:

Example (UpdateTheMongoCluster)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoClustersClient().BeginUpdate(ctx, "TestResourceGroup", "myMongoCluster", armcosmos.MongoClusterUpdate{
	Properties: &armcosmos.MongoClusterProperties{
		AdministratorLogin:         to.Ptr("mongoAdmin"),
		AdministratorLoginPassword: to.Ptr("password"),
		NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
			{
				DiskSizeGB: to.Ptr[int64](256),
				EnableHa:   to.Ptr(true),
				SKU:        to.Ptr("M50"),
				Kind:       to.Ptr(armcosmos.NodeKindShard),
				NodeCount:  to.Ptr[int32](4),
			}},
		ServerVersion: to.Ptr("5.0"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.MongoCluster = armcosmos.MongoCluster{
// 	Name: to.Ptr("myMongoCluster"),
// 	Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"),
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"),
// 	SystemData: &armcosmos.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// 		CreatedBy: to.Ptr("user1"),
// 		CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()),
// 		LastModifiedBy: to.Ptr("user2"),
// 		LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 	},
// 	Location: to.Ptr("westus2"),
// 	Properties: &armcosmos.MongoClusterProperties{
// 		AdministratorLogin: to.Ptr("mongoAdmin"),
// 		ConnectionString: to.Ptr("mongodb+srv://<user>:<password>@myMongoCluster.mongocluster.cosmos.azure.com"),
// 		EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"),
// 		NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
// 			{
// 				DiskSizeGB: to.Ptr[int64](256),
// 				EnableHa: to.Ptr(true),
// 				SKU: to.Ptr("M50"),
// 				Kind: to.Ptr(armcosmos.NodeKindShard),
// 				NodeCount: to.Ptr[int32](4),
// 		}},
// 		ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
// 		ServerVersion: to.Ptr("5.0"),
// 	},
// }
Output:

func (*MongoClustersClient) CheckNameAvailability

CheckNameAvailability - Check the availability of name for resource If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • location - The name of the Azure region.
  • parameters - The required parameters for checking if resource name is available.
  • options - MongoClustersClientCheckNameAvailabilityOptions contains the optional parameters for the MongoClustersClient.CheckNameAvailability method.
Example (CheckNameAvailability)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterNameAvailability.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMongoClustersClient().CheckNameAvailability(ctx, "westus2", armcosmos.CheckNameAvailabilityRequest{
	Name: to.Ptr("newmongocluster"),
	Type: to.Ptr("Microsoft.DocumentDB/mongoClusters"),
}, 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.CheckNameAvailabilityResponse = armcosmos.CheckNameAvailabilityResponse{
// 	NameAvailable: to.Ptr(true),
// }
Output:

Example (CheckNameAvailabilityAlreadyExistsResult)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterNameAvailability_AlreadyExists.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMongoClustersClient().CheckNameAvailability(ctx, "westus2", armcosmos.CheckNameAvailabilityRequest{
	Name: to.Ptr("existingmongocluster"),
	Type: to.Ptr("Microsoft.DocumentDB/mongoClusters"),
}, 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.CheckNameAvailabilityResponse = armcosmos.CheckNameAvailabilityResponse{
// 	Message: to.Ptr("Cluster name 'existingmongocluster' is already in use."),
// 	NameAvailable: to.Ptr(false),
// 	Reason: to.Ptr(armcosmos.CheckNameAvailabilityReasonAlreadyExists),
// }
Output:

func (*MongoClustersClient) Get

func (client *MongoClustersClient) Get(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientGetOptions) (MongoClustersClientGetResponse, error)

Get - Gets information about a mongo cluster. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • mongoClusterName - The name of the mongo cluster.
  • options - MongoClustersClientGetOptions contains the optional parameters for the MongoClustersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMongoClustersClient().Get(ctx, "TestResourceGroup", "myMongoCluster", 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.MongoCluster = armcosmos.MongoCluster{
// 	Name: to.Ptr("myMongoCluster"),
// 	Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"),
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"),
// 	SystemData: &armcosmos.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// 		CreatedBy: to.Ptr("user1"),
// 		CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()),
// 		LastModifiedBy: to.Ptr("user2"),
// 		LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 	},
// 	Location: to.Ptr("westus2"),
// 	Tags: map[string]*string{
// 		"additionalProp1": to.Ptr("string"),
// 		"additionalProp2": to.Ptr("string"),
// 		"additionalProp3": to.Ptr("string"),
// 	},
// 	Properties: &armcosmos.MongoClusterProperties{
// 		AdministratorLogin: to.Ptr("mongoAdmin"),
// 		ConnectionString: to.Ptr("mongodb+srv://<user>:<password>@myMongoCluster.mongocluster.cosmos.azure.com"),
// 		EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"),
// 		NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
// 			{
// 				DiskSizeGB: to.Ptr[int64](128),
// 				EnableHa: to.Ptr(true),
// 				SKU: to.Ptr("M30"),
// 				Kind: to.Ptr(armcosmos.NodeKindShard),
// 				NodeCount: to.Ptr[int32](4),
// 		}},
// 		ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
// 		ServerVersion: to.Ptr("5.0"),
// 	},
// }
Output:

func (*MongoClustersClient) GetFirewallRule

func (client *MongoClustersClient) GetFirewallRule(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *MongoClustersClientGetFirewallRuleOptions) (MongoClustersClientGetFirewallRuleResponse, error)

GetFirewallRule - Gets information about a mongo cluster firewall rule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • mongoClusterName - The name of the mongo cluster.
  • firewallRuleName - The name of the mongo cluster firewall rule.
  • options - MongoClustersClientGetFirewallRuleOptions contains the optional parameters for the MongoClustersClient.GetFirewallRule method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterFirewallRuleGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMongoClustersClient().GetFirewallRule(ctx, "TestGroup", "myMongoCluster", "rule1", 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.FirewallRule = armcosmos.FirewallRule{
// 	Name: to.Ptr("rule1"),
// 	Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"),
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"),
// 	SystemData: &armcosmos.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// 		CreatedBy: to.Ptr("user1"),
// 		CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()),
// 		LastModifiedBy: to.Ptr("user2"),
// 		LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
// 	},
// 	Properties: &armcosmos.FirewallRuleProperties{
// 		EndIPAddress: to.Ptr("255.255.255.255"),
// 		ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
// 		StartIPAddress: to.Ptr("0.0.0.0"),
// 	},
// }
Output:

func (*MongoClustersClient) ListConnectionStrings

func (client *MongoClustersClient) ListConnectionStrings(ctx context.Context, resourceGroupName string, mongoClusterName string, options *MongoClustersClientListConnectionStringsOptions) (MongoClustersClientListConnectionStringsResponse, error)

ListConnectionStrings - List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well as other connection strings supported by the cluster. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • mongoClusterName - The name of the mongo cluster.
  • options - MongoClustersClientListConnectionStringsOptions contains the optional parameters for the MongoClustersClient.ListConnectionStrings method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterListConnectionStrings.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMongoClustersClient().ListConnectionStrings(ctx, "TestGroup", "myMongoCluster", 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.ListConnectionStringsResult = armcosmos.ListConnectionStringsResult{
// 	ConnectionStrings: []*armcosmos.ConnectionString{
// 		{
// 			Description: to.Ptr("default connection string"),
// 			ConnectionString: to.Ptr("mongodb+srv://<user>:<password>@myMongoCluster.mongocluster.cosmos.azure.com"),
// 	}},
// }
Output:

func (*MongoClustersClient) NewListByResourceGroupPager

NewListByResourceGroupPager - List all the mongo clusters in a given resource group.

Generated from API version 2024-02-15-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterListByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMongoClustersClient().NewListByResourceGroupPager("TestResourceGroup", 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.MongoClusterListResult = armcosmos.MongoClusterListResult{
	// 	Value: []*armcosmos.MongoCluster{
	// 		{
	// 			Name: to.Ptr("myMongoCluster"),
	// 			Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"),
	// 			SystemData: &armcosmos.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
	// 				CreatedBy: to.Ptr("user1"),
	// 				CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("user2"),
	// 				LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 			},
	// 			Location: to.Ptr("westus2"),
	// 			Tags: map[string]*string{
	// 				"additionalProp1": to.Ptr("string"),
	// 				"additionalProp2": to.Ptr("string"),
	// 				"additionalProp3": to.Ptr("string"),
	// 			},
	// 			Properties: &armcosmos.MongoClusterProperties{
	// 				AdministratorLogin: to.Ptr("mongoAdmin"),
	// 				ConnectionString: to.Ptr("mongodb+srv://<user>:<password>@myMongoCluster.mongocluster.cosmos.azure.com"),
	// 				EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"),
	// 				NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
	// 					{
	// 						DiskSizeGB: to.Ptr[int64](128),
	// 						EnableHa: to.Ptr(true),
	// 						SKU: to.Ptr("M30"),
	// 						Kind: to.Ptr(armcosmos.NodeKindShard),
	// 						NodeCount: to.Ptr[int32](4),
	// 				}},
	// 				ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
	// 				ServerVersion: to.Ptr("5.0"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("myMongoCluster2"),
	// 			Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster2"),
	// 			SystemData: &armcosmos.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T17:18:19.123Z"); return t}()),
	// 				CreatedBy: to.Ptr("user2"),
	// 				CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T17:18:19.123Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("user2"),
	// 				LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 			},
	// 			Location: to.Ptr("eastus"),
	// 			Tags: map[string]*string{
	// 				"additionalProp1": to.Ptr("string"),
	// 			},
	// 			Properties: &armcosmos.MongoClusterProperties{
	// 				AdministratorLogin: to.Ptr("mongoAdmin"),
	// 				ConnectionString: to.Ptr("mongodb+srv://<user>:<password>@myMongoCluster2.mongocluster.cosmos.azure.com"),
	// 				EarliestRestoreTime: to.Ptr("2023-01-10T20:07:35Z"),
	// 				NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
	// 					{
	// 						DiskSizeGB: to.Ptr[int64](256),
	// 						EnableHa: to.Ptr(true),
	// 						SKU: to.Ptr("M40"),
	// 						Kind: to.Ptr(armcosmos.NodeKindShard),
	// 						NodeCount: to.Ptr[int32](2),
	// 				}},
	// 				ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
	// 				ServerVersion: to.Ptr("5.0"),
	// 			},
	// 	}},
	// }
}
Output:

func (*MongoClustersClient) NewListFirewallRulesPager

func (client *MongoClustersClient) NewListFirewallRulesPager(resourceGroupName string, mongoClusterName string, options *MongoClustersClientListFirewallRulesOptions) *runtime.Pager[MongoClustersClientListFirewallRulesResponse]

NewListFirewallRulesPager - List all the firewall rules in a given mongo cluster.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • mongoClusterName - The name of the mongo cluster.
  • options - MongoClustersClientListFirewallRulesOptions contains the optional parameters for the MongoClustersClient.NewListFirewallRulesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterFirewallRuleList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMongoClustersClient().NewListFirewallRulesPager("TestGroup", "myMongoCluster", 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.FirewallRuleListResult = armcosmos.FirewallRuleListResult{
	// 	Value: []*armcosmos.FirewallRule{
	// 		{
	// 			Name: to.Ptr("rule1"),
	// 			Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"),
	// 			SystemData: &armcosmos.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
	// 				CreatedBy: to.Ptr("user1"),
	// 				CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("user2"),
	// 				LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 			},
	// 			Properties: &armcosmos.FirewallRuleProperties{
	// 				EndIPAddress: to.Ptr("255.255.255.255"),
	// 				ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
	// 				StartIPAddress: to.Ptr("0.0.0.0"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("rule2"),
	// 			Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule2"),
	// 			SystemData: &armcosmos.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
	// 				CreatedBy: to.Ptr("user1"),
	// 				CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("user2"),
	// 				LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 			},
	// 			Properties: &armcosmos.FirewallRuleProperties{
	// 				EndIPAddress: to.Ptr("255.0.0.0"),
	// 				ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
	// 				StartIPAddress: to.Ptr("1.0.0.0"),
	// 			},
	// 	}},
	// }
}
Output:

func (*MongoClustersClient) NewListPager

NewListPager - List all the mongo clusters in a given subscription.

Generated from API version 2024-02-15-preview

  • options - MongoClustersClientListOptions contains the optional parameters for the MongoClustersClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/mongo-cluster/CosmosDBMongoClusterList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMongoClustersClient().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.MongoClusterListResult = armcosmos.MongoClusterListResult{
	// 	Value: []*armcosmos.MongoCluster{
	// 		{
	// 			Name: to.Ptr("myMongoCluster"),
	// 			Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster"),
	// 			SystemData: &armcosmos.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
	// 				CreatedBy: to.Ptr("user1"),
	// 				CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("user2"),
	// 				LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 			},
	// 			Location: to.Ptr("westus2"),
	// 			Tags: map[string]*string{
	// 				"additionalProp1": to.Ptr("string"),
	// 				"additionalProp2": to.Ptr("string"),
	// 				"additionalProp3": to.Ptr("string"),
	// 			},
	// 			Properties: &armcosmos.MongoClusterProperties{
	// 				AdministratorLogin: to.Ptr("mongoAdmin"),
	// 				ConnectionString: to.Ptr("mongodb+srv://<user>:<password>@myMongoCluster.mongocluster.cosmos.azure.com"),
	// 				EarliestRestoreTime: to.Ptr("2023-01-13T20:07:35Z"),
	// 				NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
	// 					{
	// 						DiskSizeGB: to.Ptr[int64](128),
	// 						EnableHa: to.Ptr(true),
	// 						SKU: to.Ptr("M30"),
	// 						Kind: to.Ptr(armcosmos.NodeKindShard),
	// 						NodeCount: to.Ptr[int32](4),
	// 				}},
	// 				ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
	// 				ServerVersion: to.Ptr("5.0"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("myMongoCluster2"),
	// 			Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster2"),
	// 			SystemData: &armcosmos.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T17:18:19.123Z"); return t}()),
	// 				CreatedBy: to.Ptr("user2"),
	// 				CreatedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T17:18:19.123Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("user2"),
	// 				LastModifiedByType: to.Ptr(armcosmos.CreatedByTypeUser),
	// 			},
	// 			Location: to.Ptr("eastus"),
	// 			Tags: map[string]*string{
	// 				"additionalProp1": to.Ptr("string"),
	// 			},
	// 			Properties: &armcosmos.MongoClusterProperties{
	// 				AdministratorLogin: to.Ptr("mongoAdmin"),
	// 				ConnectionString: to.Ptr("mongodb+srv://<user>:<password>@myMongoCluster.mongocluster.cosmos.azure.com"),
	// 				EarliestRestoreTime: to.Ptr("2023-01-10T20:07:35Z"),
	// 				NodeGroupSpecs: []*armcosmos.NodeGroupSpec{
	// 					{
	// 						DiskSizeGB: to.Ptr[int64](256),
	// 						EnableHa: to.Ptr(true),
	// 						SKU: to.Ptr("M40"),
	// 						Kind: to.Ptr(armcosmos.NodeKindShard),
	// 						NodeCount: to.Ptr[int32](2),
	// 				}},
	// 				ProvisioningState: to.Ptr(armcosmos.ProvisioningStateSucceeded),
	// 				ServerVersion: to.Ptr("5.0"),
	// 			},
	// 	}},
	// }
}
Output:

type MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions

type MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoClustersClientBeginCreateOrUpdateFirewallRuleOptions contains the optional parameters for the MongoClustersClient.BeginCreateOrUpdateFirewallRule method.

type MongoClustersClientBeginCreateOrUpdateOptions

type MongoClustersClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the MongoClustersClient.BeginCreateOrUpdate method.

type MongoClustersClientBeginDeleteFirewallRuleOptions

type MongoClustersClientBeginDeleteFirewallRuleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoClustersClientBeginDeleteFirewallRuleOptions contains the optional parameters for the MongoClustersClient.BeginDeleteFirewallRule method.

type MongoClustersClientBeginDeleteOptions

type MongoClustersClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoClustersClientBeginDeleteOptions contains the optional parameters for the MongoClustersClient.BeginDelete method.

type MongoClustersClientBeginUpdateOptions

type MongoClustersClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoClustersClientBeginUpdateOptions contains the optional parameters for the MongoClustersClient.BeginUpdate method.

type MongoClustersClientCheckNameAvailabilityOptions

type MongoClustersClientCheckNameAvailabilityOptions struct {
}

MongoClustersClientCheckNameAvailabilityOptions contains the optional parameters for the MongoClustersClient.CheckNameAvailability method.

type MongoClustersClientCheckNameAvailabilityResponse

type MongoClustersClientCheckNameAvailabilityResponse struct {
	// The check availability result.
	CheckNameAvailabilityResponse
}

MongoClustersClientCheckNameAvailabilityResponse contains the response from method MongoClustersClient.CheckNameAvailability.

type MongoClustersClientCreateOrUpdateFirewallRuleResponse

type MongoClustersClientCreateOrUpdateFirewallRuleResponse struct {
	// Represents a mongo cluster firewall rule.
	FirewallRule
}

MongoClustersClientCreateOrUpdateFirewallRuleResponse contains the response from method MongoClustersClient.BeginCreateOrUpdateFirewallRule.

type MongoClustersClientCreateOrUpdateResponse

type MongoClustersClientCreateOrUpdateResponse struct {
	// Represents a mongo cluster resource.
	MongoCluster
}

MongoClustersClientCreateOrUpdateResponse contains the response from method MongoClustersClient.BeginCreateOrUpdate.

type MongoClustersClientDeleteFirewallRuleResponse

type MongoClustersClientDeleteFirewallRuleResponse struct {
}

MongoClustersClientDeleteFirewallRuleResponse contains the response from method MongoClustersClient.BeginDeleteFirewallRule.

type MongoClustersClientDeleteResponse

type MongoClustersClientDeleteResponse struct {
}

MongoClustersClientDeleteResponse contains the response from method MongoClustersClient.BeginDelete.

type MongoClustersClientGetFirewallRuleOptions

type MongoClustersClientGetFirewallRuleOptions struct {
}

MongoClustersClientGetFirewallRuleOptions contains the optional parameters for the MongoClustersClient.GetFirewallRule method.

type MongoClustersClientGetFirewallRuleResponse

type MongoClustersClientGetFirewallRuleResponse struct {
	// Represents a mongo cluster firewall rule.
	FirewallRule
}

MongoClustersClientGetFirewallRuleResponse contains the response from method MongoClustersClient.GetFirewallRule.

type MongoClustersClientGetOptions

type MongoClustersClientGetOptions struct {
}

MongoClustersClientGetOptions contains the optional parameters for the MongoClustersClient.Get method.

type MongoClustersClientGetResponse

type MongoClustersClientGetResponse struct {
	// Represents a mongo cluster resource.
	MongoCluster
}

MongoClustersClientGetResponse contains the response from method MongoClustersClient.Get.

type MongoClustersClientListByResourceGroupOptions

type MongoClustersClientListByResourceGroupOptions struct {
}

MongoClustersClientListByResourceGroupOptions contains the optional parameters for the MongoClustersClient.NewListByResourceGroupPager method.

type MongoClustersClientListByResourceGroupResponse

type MongoClustersClientListByResourceGroupResponse struct {
	// A list of mongo clusters.
	MongoClusterListResult
}

MongoClustersClientListByResourceGroupResponse contains the response from method MongoClustersClient.NewListByResourceGroupPager.

type MongoClustersClientListConnectionStringsOptions

type MongoClustersClientListConnectionStringsOptions struct {
}

MongoClustersClientListConnectionStringsOptions contains the optional parameters for the MongoClustersClient.ListConnectionStrings method.

type MongoClustersClientListConnectionStringsResponse

type MongoClustersClientListConnectionStringsResponse struct {
	// The connection strings for the given mongo cluster.
	ListConnectionStringsResult
}

MongoClustersClientListConnectionStringsResponse contains the response from method MongoClustersClient.ListConnectionStrings.

type MongoClustersClientListFirewallRulesOptions

type MongoClustersClientListFirewallRulesOptions struct {
}

MongoClustersClientListFirewallRulesOptions contains the optional parameters for the MongoClustersClient.NewListFirewallRulesPager method.

type MongoClustersClientListFirewallRulesResponse

type MongoClustersClientListFirewallRulesResponse struct {
	// A list of firewall rules.
	FirewallRuleListResult
}

MongoClustersClientListFirewallRulesResponse contains the response from method MongoClustersClient.NewListFirewallRulesPager.

type MongoClustersClientListOptions

type MongoClustersClientListOptions struct {
}

MongoClustersClientListOptions contains the optional parameters for the MongoClustersClient.NewListPager method.

type MongoClustersClientListResponse

type MongoClustersClientListResponse struct {
	// A list of mongo clusters.
	MongoClusterListResult
}

MongoClustersClientListResponse contains the response from method MongoClustersClient.NewListPager.

type MongoClustersClientUpdateResponse

type MongoClustersClientUpdateResponse struct {
	// Represents a mongo cluster resource.
	MongoCluster
}

MongoClustersClientUpdateResponse contains the response from method MongoClustersClient.BeginUpdate.

type MongoDBCollectionCreateUpdateParameters

type MongoDBCollectionCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB MongoDB collection.
	Properties *MongoDBCollectionCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

MongoDBCollectionCreateUpdateParameters - Parameters to create and update Cosmos DB MongoDB collection.

func (MongoDBCollectionCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionCreateUpdateParameters.

func (*MongoDBCollectionCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionCreateUpdateParameters.

type MongoDBCollectionCreateUpdateProperties

type MongoDBCollectionCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a MongoDB collection
	Resource *MongoDBCollectionResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

MongoDBCollectionCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB collection.

func (MongoDBCollectionCreateUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionCreateUpdateProperties.

func (*MongoDBCollectionCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionCreateUpdateProperties.

type MongoDBCollectionGetProperties

type MongoDBCollectionGetProperties struct {
	Options  *MongoDBCollectionGetPropertiesOptions
	Resource *MongoDBCollectionGetPropertiesResource
}

MongoDBCollectionGetProperties - The properties of an Azure Cosmos DB MongoDB collection

func (MongoDBCollectionGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetProperties.

func (*MongoDBCollectionGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetProperties.

type MongoDBCollectionGetPropertiesOptions

type MongoDBCollectionGetPropertiesOptions struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

func (MongoDBCollectionGetPropertiesOptions) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetPropertiesOptions.

func (*MongoDBCollectionGetPropertiesOptions) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetPropertiesOptions.

type MongoDBCollectionGetPropertiesResource

type MongoDBCollectionGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB MongoDB collection
	ID *string

	// Analytical TTL.
	AnalyticalStorageTTL *int32

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// List of index keys
	Indexes []*MongoIndex

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// A key-value pair of shard keys to be applied for the request.
	ShardKey map[string]*string

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (MongoDBCollectionGetPropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetPropertiesResource.

func (*MongoDBCollectionGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetPropertiesResource.

type MongoDBCollectionGetResults

type MongoDBCollectionGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB MongoDB collection
	Properties *MongoDBCollectionGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

MongoDBCollectionGetResults - An Azure Cosmos DB MongoDB collection.

func (MongoDBCollectionGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetResults.

func (*MongoDBCollectionGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetResults.

type MongoDBCollectionListResult

type MongoDBCollectionListResult struct {
	// READ-ONLY; List of MongoDB collections and their properties.
	Value []*MongoDBCollectionGetResults
}

MongoDBCollectionListResult - The List operation response, that contains the MongoDB collections and their properties.

func (MongoDBCollectionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionListResult.

func (*MongoDBCollectionListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionListResult.

type MongoDBCollectionResource

type MongoDBCollectionResource struct {
	// REQUIRED; Name of the Cosmos DB MongoDB collection
	ID *string

	// Analytical TTL.
	AnalyticalStorageTTL *int32

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// List of index keys
	Indexes []*MongoIndex

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// A key-value pair of shard keys to be applied for the request.
	ShardKey map[string]*string
}

MongoDBCollectionResource - Cosmos DB MongoDB collection resource object

func (MongoDBCollectionResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionResource.

func (*MongoDBCollectionResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionResource.

type MongoDBDatabaseCreateUpdateParameters

type MongoDBDatabaseCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB MongoDB database.
	Properties *MongoDBDatabaseCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

MongoDBDatabaseCreateUpdateParameters - Parameters to create and update Cosmos DB MongoDB database.

func (MongoDBDatabaseCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseCreateUpdateParameters.

func (*MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseCreateUpdateParameters.

type MongoDBDatabaseCreateUpdateProperties

type MongoDBDatabaseCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a MongoDB database
	Resource *MongoDBDatabaseResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

MongoDBDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB database.

func (MongoDBDatabaseCreateUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseCreateUpdateProperties.

func (*MongoDBDatabaseCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseCreateUpdateProperties.

type MongoDBDatabaseGetProperties

type MongoDBDatabaseGetProperties struct {
	Options  *MongoDBDatabaseGetPropertiesOptions
	Resource *MongoDBDatabaseGetPropertiesResource
}

MongoDBDatabaseGetProperties - The properties of an Azure Cosmos DB MongoDB database

func (MongoDBDatabaseGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetProperties.

func (*MongoDBDatabaseGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetProperties.

type MongoDBDatabaseGetPropertiesOptions

type MongoDBDatabaseGetPropertiesOptions struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

func (MongoDBDatabaseGetPropertiesOptions) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetPropertiesOptions.

func (*MongoDBDatabaseGetPropertiesOptions) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetPropertiesOptions.

type MongoDBDatabaseGetPropertiesResource

type MongoDBDatabaseGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB MongoDB database
	ID *string

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (MongoDBDatabaseGetPropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetPropertiesResource.

func (*MongoDBDatabaseGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetPropertiesResource.

type MongoDBDatabaseGetResults

type MongoDBDatabaseGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB MongoDB database
	Properties *MongoDBDatabaseGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

MongoDBDatabaseGetResults - An Azure Cosmos DB MongoDB database.

func (MongoDBDatabaseGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetResults.

func (*MongoDBDatabaseGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetResults.

type MongoDBDatabaseListResult

type MongoDBDatabaseListResult struct {
	// READ-ONLY; List of MongoDB databases and their properties.
	Value []*MongoDBDatabaseGetResults
}

MongoDBDatabaseListResult - The List operation response, that contains the MongoDB databases and their properties.

func (MongoDBDatabaseListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseListResult.

func (*MongoDBDatabaseListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseListResult.

type MongoDBDatabaseResource

type MongoDBDatabaseResource struct {
	// REQUIRED; Name of the Cosmos DB MongoDB database
	ID *string

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters
}

MongoDBDatabaseResource - Cosmos DB MongoDB database resource object

func (MongoDBDatabaseResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseResource.

func (*MongoDBDatabaseResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseResource.

type MongoDBResourcesClient

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

MongoDBResourcesClient contains the methods for the MongoDBResources group. Don't use this type directly, use NewMongoDBResourcesClient() instead.

func NewMongoDBResourcesClient

func NewMongoDBResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MongoDBResourcesClient, error)

NewMongoDBResourcesClient creates a new instance of MongoDBResourcesClient with the specified values.

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

func (*MongoDBResourcesClient) BeginCreateUpdateMongoDBCollection

func (client *MongoDBResourcesClient) BeginCreateUpdateMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, createUpdateMongoDBCollectionParameters MongoDBCollectionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoDBCollectionOptions) (*runtime.Poller[MongoDBResourcesClientCreateUpdateMongoDBCollectionResponse], error)

BeginCreateUpdateMongoDBCollection - Create or update an Azure Cosmos DB MongoDB Collection If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • collectionName - Cosmos DB collection name.
  • createUpdateMongoDBCollectionParameters - The parameters to provide for the current MongoDB Collection.
  • options - MongoDBResourcesClientBeginCreateUpdateMongoDBCollectionOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoDBCollection method.
Example (CosmosDbMongoDbCollectionCreateUpdate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginCreateUpdateMongoDBCollection(ctx, "rg1", "ddb1", "databaseName", "collectionName", armcosmos.MongoDBCollectionCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.MongoDBCollectionCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.MongoDBCollectionResource{
			AnalyticalStorageTTL: to.Ptr[int32](500),
			ID:                   to.Ptr("collectionName"),
			Indexes: []*armcosmos.MongoIndex{
				{
					Key: &armcosmos.MongoIndexKeys{
						Keys: []*string{
							to.Ptr("_ts")},
					},
					Options: &armcosmos.MongoIndexOptions{
						ExpireAfterSeconds: to.Ptr[int32](100),
						Unique:             to.Ptr(true),
					},
				},
				{
					Key: &armcosmos.MongoIndexKeys{
						Keys: []*string{
							to.Ptr("_id")},
					},
				}},
			ShardKey: map[string]*string{
				"testKey": to.Ptr("Hash"),
			},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.MongoDBCollectionGetResults = armcosmos.MongoDBCollectionGetResults{
// 	Name: to.Ptr("collectionName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/mongodbCollections"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/mongodbCollections/collectionName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.MongoDBCollectionGetProperties{
// 		Resource: &armcosmos.MongoDBCollectionGetPropertiesResource{
// 			AnalyticalStorageTTL: to.Ptr[int32](500),
// 			ID: to.Ptr("collectionName"),
// 			Indexes: []*armcosmos.MongoIndex{
// 				{
// 					Key: &armcosmos.MongoIndexKeys{
// 						Keys: []*string{
// 							to.Ptr("_ts")},
// 						},
// 						Options: &armcosmos.MongoIndexOptions{
// 							ExpireAfterSeconds: to.Ptr[int32](100),
// 							Unique: to.Ptr(true),
// 						},
// 					},
// 					{
// 						Key: &armcosmos.MongoIndexKeys{
// 							Keys: []*string{
// 								to.Ptr("_id")},
// 							},
// 					}},
// 					ShardKey: map[string]*string{
// 						"testKey": to.Ptr("Hash"),
// 					},
// 				},
// 			},
// 		}
Output:

Example (CosmosDbMongoDbCollectionRestore)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionRestore.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginCreateUpdateMongoDBCollection(ctx, "rg1", "ddb1", "databaseName", "collectionName", armcosmos.MongoDBCollectionCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.MongoDBCollectionCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.MongoDBCollectionResource{
			CreateMode: to.Ptr(armcosmos.CreateModeRestore),
			ID:         to.Ptr("collectionName"),
			RestoreParameters: &armcosmos.ResourceRestoreParameters{
				RestoreSource:          to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId"),
				RestoreTimestampInUTC:  to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-20T18:28:00.000Z"); return t }()),
				RestoreWithTTLDisabled: to.Ptr(false),
			},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.MongoDBCollectionGetResults = armcosmos.MongoDBCollectionGetResults{
// 	Name: to.Ptr("collectionName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/mongodbCollections"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/mongodbCollections/collectionName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.MongoDBCollectionGetProperties{
// 		Resource: &armcosmos.MongoDBCollectionGetPropertiesResource{
// 			AnalyticalStorageTTL: to.Ptr[int32](500),
// 			ID: to.Ptr("collectionName"),
// 			Indexes: []*armcosmos.MongoIndex{
// 				{
// 					Key: &armcosmos.MongoIndexKeys{
// 						Keys: []*string{
// 							to.Ptr("_ts")},
// 						},
// 						Options: &armcosmos.MongoIndexOptions{
// 							ExpireAfterSeconds: to.Ptr[int32](100),
// 							Unique: to.Ptr(true),
// 						},
// 					},
// 					{
// 						Key: &armcosmos.MongoIndexKeys{
// 							Keys: []*string{
// 								to.Ptr("_id")},
// 							},
// 					}},
// 					ShardKey: map[string]*string{
// 						"testKey": to.Ptr("Hash"),
// 					},
// 				},
// 			},
// 		}
Output:

func (*MongoDBResourcesClient) BeginCreateUpdateMongoDBDatabase

func (client *MongoDBResourcesClient) BeginCreateUpdateMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateMongoDBDatabaseParameters MongoDBDatabaseCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoDBDatabaseOptions) (*runtime.Poller[MongoDBResourcesClientCreateUpdateMongoDBDatabaseResponse], error)

BeginCreateUpdateMongoDBDatabase - Create or updates Azure Cosmos DB MongoDB database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • createUpdateMongoDBDatabaseParameters - The parameters to provide for the current MongoDB database.
  • options - MongoDBResourcesClientBeginCreateUpdateMongoDBDatabaseOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoDBDatabase method.
Example (CosmosDbMongoDbDatabaseCreateUpdate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginCreateUpdateMongoDBDatabase(ctx, "rg1", "ddb1", "databaseName", armcosmos.MongoDBDatabaseCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.MongoDBDatabaseCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.MongoDBDatabaseResource{
			ID: to.Ptr("databaseName"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.MongoDBDatabaseGetResults = armcosmos.MongoDBDatabaseGetResults{
// 	Name: to.Ptr("databaseName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.MongoDBDatabaseGetProperties{
// 		Resource: &armcosmos.MongoDBDatabaseGetPropertiesResource{
// 			ID: to.Ptr("updatedDatabaseName"),
// 		},
// 	},
// }
Output:

Example (CosmosDbMongoDbDatabaseRestore)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseRestore.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginCreateUpdateMongoDBDatabase(ctx, "rg1", "ddb1", "databaseName", armcosmos.MongoDBDatabaseCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.MongoDBDatabaseCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.MongoDBDatabaseResource{
			CreateMode: to.Ptr(armcosmos.CreateModeRestore),
			ID:         to.Ptr("databaseName"),
			RestoreParameters: &armcosmos.ResourceRestoreParameters{
				RestoreSource:          to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId"),
				RestoreTimestampInUTC:  to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-20T18:28:00.000Z"); return t }()),
				RestoreWithTTLDisabled: to.Ptr(false),
			},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.MongoDBDatabaseGetResults = armcosmos.MongoDBDatabaseGetResults{
// 	Name: to.Ptr("databaseName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.MongoDBDatabaseGetProperties{
// 		Resource: &armcosmos.MongoDBDatabaseGetPropertiesResource{
// 			ID: to.Ptr("updatedDatabaseName"),
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginCreateUpdateMongoRoleDefinition

func (client *MongoDBResourcesClient) BeginCreateUpdateMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoRoleDefinitionParameters MongoRoleDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse], error)

BeginCreateUpdateMongoRoleDefinition - Creates or updates an Azure Cosmos DB Mongo Role Definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • mongoRoleDefinitionID - The ID for the Role Definition {dbName.roleName}.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • createUpdateMongoRoleDefinitionParameters - The properties required to create or update a Role Definition.
  • options - MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoRoleDefinition method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginCreateUpdateMongoRoleDefinition(ctx, "myMongoRoleDefinitionId", "myResourceGroupName", "myAccountName", armcosmos.MongoRoleDefinitionCreateUpdateParameters{
	Properties: &armcosmos.MongoRoleDefinitionResource{
		DatabaseName: to.Ptr("sales"),
		Privileges: []*armcosmos.Privilege{
			{
				Actions: []*string{
					to.Ptr("insert"),
					to.Ptr("find")},
				Resource: &armcosmos.PrivilegeResource{
					Collection: to.Ptr("sales"),
					Db:         to.Ptr("sales"),
				},
			}},
		RoleName: to.Ptr("myRoleName"),
		Roles: []*armcosmos.Role{
			{
				Db:   to.Ptr("sales"),
				Role: to.Ptr("myInheritedRole"),
			}},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.MongoRoleDefinitionGetResults = armcosmos.MongoRoleDefinitionGetResults{
// 	Name: to.Ptr("myMongoDbRoleDefinitionId"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongoDbRoleDefinitionId"),
// 	ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbRoleDefinitions/myMongoDbRoleDefinitionId"),
// 	Properties: &armcosmos.MongoRoleDefinitionResource{
// 		Type: to.Ptr(armcosmos.MongoRoleDefinitionTypeCustomRole),
// 		DatabaseName: to.Ptr("sales"),
// 		Privileges: []*armcosmos.Privilege{
// 			{
// 				Actions: []*string{
// 					to.Ptr("find"),
// 					to.Ptr("insert")},
// 					Resource: &armcosmos.PrivilegeResource{
// 						Collection: to.Ptr("coll"),
// 						Db: to.Ptr("sales"),
// 					},
// 			}},
// 			RoleName: to.Ptr("myRoleName"),
// 			Roles: []*armcosmos.Role{
// 				{
// 					Db: to.Ptr("sales"),
// 					Role: to.Ptr("myReadRole"),
// 			}},
// 		},
// 	}
Output:

func (*MongoDBResourcesClient) BeginCreateUpdateMongoUserDefinition

func (client *MongoDBResourcesClient) BeginCreateUpdateMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoUserDefinitionParameters MongoUserDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse], error)

BeginCreateUpdateMongoUserDefinition - Creates or updates an Azure Cosmos DB Mongo User Definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • mongoUserDefinitionID - The ID for the User Definition {dbName.userName}.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • createUpdateMongoUserDefinitionParameters - The properties required to create or update a User Definition.
  • options - MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoUserDefinition method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginCreateUpdateMongoUserDefinition(ctx, "myMongoUserDefinitionId", "myResourceGroupName", "myAccountName", armcosmos.MongoUserDefinitionCreateUpdateParameters{
	Properties: &armcosmos.MongoUserDefinitionResource{
		CustomData:   to.Ptr("My custom data"),
		DatabaseName: to.Ptr("sales"),
		Mechanisms:   to.Ptr("SCRAM-SHA-256"),
		Password:     to.Ptr("myPassword"),
		Roles: []*armcosmos.Role{
			{
				Db:   to.Ptr("sales"),
				Role: to.Ptr("myReadRole"),
			}},
		UserName: to.Ptr("myUserName"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.MongoUserDefinitionGetResults = armcosmos.MongoUserDefinitionGetResults{
// 	Name: to.Ptr("myUserName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions"),
// 	ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbUserDefinitions/myUserId"),
// 	Properties: &armcosmos.MongoUserDefinitionResource{
// 		CustomData: to.Ptr("My custom data"),
// 		DatabaseName: to.Ptr("sales"),
// 		Mechanisms: to.Ptr("SCRAM-SHA-256"),
// 		Roles: []*armcosmos.Role{
// 			{
// 				Db: to.Ptr("sales"),
// 				Role: to.Ptr("myReadRole"),
// 		}},
// 		UserName: to.Ptr("myUserName"),
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginDeleteMongoDBCollection

func (client *MongoDBResourcesClient) BeginDeleteMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginDeleteMongoDBCollectionOptions) (*runtime.Poller[MongoDBResourcesClientDeleteMongoDBCollectionResponse], error)

BeginDeleteMongoDBCollection - Deletes an existing Azure Cosmos DB MongoDB Collection. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • collectionName - Cosmos DB collection name.
  • options - MongoDBResourcesClientBeginDeleteMongoDBCollectionOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoDBCollection method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginDeleteMongoDBCollection(ctx, "rg1", "ddb1", "databaseName", "collectionName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*MongoDBResourcesClient) BeginDeleteMongoDBDatabase

func (client *MongoDBResourcesClient) BeginDeleteMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientBeginDeleteMongoDBDatabaseOptions) (*runtime.Poller[MongoDBResourcesClientDeleteMongoDBDatabaseResponse], error)

BeginDeleteMongoDBDatabase - Deletes an existing Azure Cosmos DB MongoDB database. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - MongoDBResourcesClientBeginDeleteMongoDBDatabaseOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoDBDatabase method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginDeleteMongoDBDatabase(ctx, "rg1", "ddb1", "databaseName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*MongoDBResourcesClient) BeginDeleteMongoRoleDefinition

func (client *MongoDBResourcesClient) BeginDeleteMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientDeleteMongoRoleDefinitionResponse], error)

BeginDeleteMongoRoleDefinition - Deletes an existing Azure Cosmos DB Mongo Role Definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • mongoRoleDefinitionID - The ID for the Role Definition {dbName.roleName}.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoRoleDefinition method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginDeleteMongoRoleDefinition(ctx, "myMongoRoleDefinitionId", "myResourceGroupName", "myAccountName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*MongoDBResourcesClient) BeginDeleteMongoUserDefinition

func (client *MongoDBResourcesClient) BeginDeleteMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientDeleteMongoUserDefinitionResponse], error)

BeginDeleteMongoUserDefinition - Deletes an existing Azure Cosmos DB Mongo User Definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • mongoUserDefinitionID - The ID for the User Definition {dbName.userName}.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoUserDefinition method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginDeleteMongoUserDefinition(ctx, "myMongoUserDefinitionId", "myResourceGroupName", "myAccountName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*MongoDBResourcesClient) BeginListMongoDBCollectionPartitionMerge

func (client *MongoDBResourcesClient) BeginListMongoDBCollectionPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (*runtime.Poller[MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse], error)

BeginListMongoDBCollectionPartitionMerge - Merges the partitions of a MongoDB Collection If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • collectionName - Cosmos DB collection name.
  • mergeParameters - The parameters for the merge operation.
  • options - MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions contains the optional parameters for the MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginListMongoDBCollectionPartitionMerge(ctx, "rgName", "ddb1", "databaseName", "collectionName", armcosmos.MergeParameters{
	IsDryRun: to.Ptr(false),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionStorageInfoCollection = armcosmos.PhysicalPartitionStorageInfoCollection{
// 	PhysicalPartitionStorageInfoCollection: []*armcosmos.PhysicalPartitionStorageInfo{
// 		{
// 			ID: to.Ptr("0"),
// 			StorageInKB: to.Ptr[float64](333),
// 		},
// 		{
// 			ID: to.Ptr("1"),
// 			StorageInKB: to.Ptr[float64](305),
// 		},
// 		{
// 			ID: to.Ptr("177"),
// 			StorageInKB: to.Ptr[float64](368),
// 		},
// 		{
// 			ID: to.Ptr("178"),
// 			StorageInKB: to.Ptr[float64](96313),
// 		},
// 		{
// 			ID: to.Ptr("5"),
// 			StorageInKB: to.Ptr[float64](194),
// 		},
// 		{
// 			ID: to.Ptr("6"),
// 			StorageInKB: to.Ptr[float64](331),
// 		},
// 		{
// 			ID: to.Ptr("7"),
// 			StorageInKB: to.Ptr[float64](384),
// 		},
// 		{
// 			ID: to.Ptr("8"),
// 			StorageInKB: to.Ptr[float64](246),
// 	}},
// }
Output:

func (*MongoDBResourcesClient) BeginMigrateMongoDBCollectionToAutoscale

func (client *MongoDBResourcesClient) BeginMigrateMongoDBCollectionToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions) (*runtime.Poller[MongoDBResourcesClientMigrateMongoDBCollectionToAutoscaleResponse], error)

BeginMigrateMongoDBCollectionToAutoscale - Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • collectionName - Cosmos DB collection name.
  • options - MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions contains the optional parameters for the MongoDBResourcesClient.BeginMigrateMongoDBCollectionToAutoscale method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginMigrateMongoDBCollectionToAutoscale(ctx, "rg1", "ddb1", "databaseName", "collectionName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			AutoscaleSettings: &armcosmos.AutoscaleSettingsResource{
// 				MaxThroughput: to.Ptr[int32](4000),
// 			},
// 			MinimumThroughput: to.Ptr("4000"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginMigrateMongoDBCollectionToManualThroughput

func (client *MongoDBResourcesClient) BeginMigrateMongoDBCollectionToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginMigrateMongoDBCollectionToManualThroughputOptions) (*runtime.Poller[MongoDBResourcesClientMigrateMongoDBCollectionToManualThroughputResponse], error)

BeginMigrateMongoDBCollectionToManualThroughput - Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • collectionName - Cosmos DB collection name.
  • options - MongoDBResourcesClientBeginMigrateMongoDBCollectionToManualThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginMigrateMongoDBCollectionToManualThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginMigrateMongoDBCollectionToManualThroughput(ctx, "rg1", "ddb1", "databaseName", "collectionName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginMigrateMongoDBDatabaseToAutoscale

BeginMigrateMongoDBDatabaseToAutoscale - Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - MongoDBResourcesClientBeginMigrateMongoDBDatabaseToAutoscaleOptions contains the optional parameters for the MongoDBResourcesClient.BeginMigrateMongoDBDatabaseToAutoscale method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginMigrateMongoDBDatabaseToAutoscale(ctx, "rg1", "ddb1", "databaseName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			AutoscaleSettings: &armcosmos.AutoscaleSettingsResource{
// 				MaxThroughput: to.Ptr[int32](4000),
// 			},
// 			MinimumThroughput: to.Ptr("4000"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginMigrateMongoDBDatabaseToManualThroughput

BeginMigrateMongoDBDatabaseToManualThroughput - Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - MongoDBResourcesClientBeginMigrateMongoDBDatabaseToManualThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginMigrateMongoDBDatabaseToManualThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginMigrateMongoDBDatabaseToManualThroughput(ctx, "rg1", "ddb1", "databaseName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginMongoDBContainerRedistributeThroughput

func (client *MongoDBResourcesClient) BeginMongoDBContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse], error)

BeginMongoDBContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB container If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • collectionName - Cosmos DB collection name.
  • redistributeThroughputParameters - The parameters to provide for redistributing throughput for the current MongoDB container.
  • options - MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginMongoDBContainerRedistributeThroughput(ctx, "rg1", "ddb1", "databaseName", "collectionName", armcosmos.RedistributeThroughputParameters{
	Properties: &armcosmos.RedistributeThroughputProperties{
		Resource: &armcosmos.RedistributeThroughputPropertiesResource{
			SourcePhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
				{
					ID:         to.Ptr("2"),
					Throughput: to.Ptr[float64](5000),
				},
				{
					ID: to.Ptr("3"),
				}},
			TargetPhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
				{
					ID:         to.Ptr("0"),
					Throughput: to.Ptr[float64](5000),
				},
				{
					ID:         to.Ptr("1"),
					Throughput: to.Ptr[float64](5000),
				}},
			ThroughputPolicy: to.Ptr(armcosmos.ThroughputPolicyTypeCustom),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{
// 	Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{
// 		Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{
// 			PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
// 				{
// 					ID: to.Ptr("0"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("1"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("2"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("3"),
// 					Throughput: to.Ptr[float64](3000),
// 			}},
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginMongoDBContainerRetrieveThroughputDistribution

func (client *MongoDBResourcesClient) BeginMongoDBContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse], error)

BeginMongoDBContainerRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB MongoDB container If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • collectionName - Cosmos DB collection name.
  • retrieveThroughputParameters - The parameters to provide for retrieving throughput distribution for the current MongoDB container.
  • options - MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginMongoDBContainerRetrieveThroughputDistribution(ctx, "rg1", "ddb1", "databaseName", "collectionName", armcosmos.RetrieveThroughputParameters{
	Properties: &armcosmos.RetrieveThroughputProperties{
		Resource: &armcosmos.RetrieveThroughputPropertiesResource{
			PhysicalPartitionIDs: []*armcosmos.PhysicalPartitionID{
				{
					ID: to.Ptr("0"),
				},
				{
					ID: to.Ptr("1"),
				}},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{
// 	Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{
// 		Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{
// 			PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
// 				{
// 					ID: to.Ptr("0"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("1"),
// 					Throughput: to.Ptr[float64](5000),
// 			}},
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginMongoDBDatabasePartitionMerge

func (client *MongoDBResourcesClient) BeginMongoDBDatabasePartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse], error)

BeginMongoDBDatabasePartitionMerge - Merges the partitions of a MongoDB database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • mergeParameters - The parameters for the merge operation.
  • options - MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBDatabasePartitionMerge method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginMongoDBDatabasePartitionMerge(ctx, "rgName", "ddb1", "databaseName", armcosmos.MergeParameters{
	IsDryRun: to.Ptr(false),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionStorageInfoCollection = armcosmos.PhysicalPartitionStorageInfoCollection{
// 	PhysicalPartitionStorageInfoCollection: []*armcosmos.PhysicalPartitionStorageInfo{
// 		{
// 			ID: to.Ptr("0"),
// 			StorageInKB: to.Ptr[float64](333),
// 		},
// 		{
// 			ID: to.Ptr("1"),
// 			StorageInKB: to.Ptr[float64](305),
// 		},
// 		{
// 			ID: to.Ptr("177"),
// 			StorageInKB: to.Ptr[float64](368),
// 		},
// 		{
// 			ID: to.Ptr("178"),
// 			StorageInKB: to.Ptr[float64](96313),
// 		},
// 		{
// 			ID: to.Ptr("5"),
// 			StorageInKB: to.Ptr[float64](194),
// 		},
// 		{
// 			ID: to.Ptr("6"),
// 			StorageInKB: to.Ptr[float64](331),
// 		},
// 		{
// 			ID: to.Ptr("7"),
// 			StorageInKB: to.Ptr[float64](384),
// 		},
// 		{
// 			ID: to.Ptr("8"),
// 			StorageInKB: to.Ptr[float64](246),
// 	}},
// }
Output:

func (*MongoDBResourcesClient) BeginMongoDBDatabaseRedistributeThroughput

func (client *MongoDBResourcesClient) BeginMongoDBDatabaseRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse], error)

BeginMongoDBDatabaseRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • redistributeThroughputParameters - The parameters to provide for redistributing throughput for the current MongoDB database.
  • options - MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBDatabaseRedistributeThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginMongoDBDatabaseRedistributeThroughput(ctx, "rg1", "ddb1", "databaseName", armcosmos.RedistributeThroughputParameters{
	Properties: &armcosmos.RedistributeThroughputProperties{
		Resource: &armcosmos.RedistributeThroughputPropertiesResource{
			SourcePhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
				{
					ID:         to.Ptr("2"),
					Throughput: to.Ptr[float64](5000),
				},
				{
					ID: to.Ptr("3"),
				}},
			TargetPhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
				{
					ID:         to.Ptr("0"),
					Throughput: to.Ptr[float64](5000),
				},
				{
					ID:         to.Ptr("1"),
					Throughput: to.Ptr[float64](5000),
				}},
			ThroughputPolicy: to.Ptr(armcosmos.ThroughputPolicyTypeCustom),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{
// 	Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{
// 		Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{
// 			PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
// 				{
// 					ID: to.Ptr("0"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("1"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("2"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("3"),
// 					Throughput: to.Ptr[float64](3000),
// 			}},
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginMongoDBDatabaseRetrieveThroughputDistribution

func (client *MongoDBResourcesClient) BeginMongoDBDatabaseRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse], error)

BeginMongoDBDatabaseRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB MongoDB database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • retrieveThroughputParameters - The parameters to provide for retrieving throughput distribution for the current MongoDB database.
  • options - MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBDatabaseRetrieveThroughputDistribution method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginMongoDBDatabaseRetrieveThroughputDistribution(ctx, "rg1", "ddb1", "databaseName", armcosmos.RetrieveThroughputParameters{
	Properties: &armcosmos.RetrieveThroughputProperties{
		Resource: &armcosmos.RetrieveThroughputPropertiesResource{
			PhysicalPartitionIDs: []*armcosmos.PhysicalPartitionID{
				{
					ID: to.Ptr("0"),
				},
				{
					ID: to.Ptr("1"),
				}},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{
// 	Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{
// 		Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{
// 			PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
// 				{
// 					ID: to.Ptr("0"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("1"),
// 					Throughput: to.Ptr[float64](5000),
// 			}},
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginRetrieveContinuousBackupInformation

func (client *MongoDBResourcesClient) BeginRetrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, location ContinuousBackupRestoreLocation, options *MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*runtime.Poller[MongoDBResourcesClientRetrieveContinuousBackupInformationResponse], error)

BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a Mongodb collection. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • collectionName - Cosmos DB collection name.
  • location - The name of the continuous backup restore location.
  • options - MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the MongoDBResourcesClient.BeginRetrieveContinuousBackupInformation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginRetrieveContinuousBackupInformation(ctx, "rgName", "ddb1", "databaseName", "collectionName", armcosmos.ContinuousBackupRestoreLocation{
	Location: to.Ptr("North Europe"),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.BackupInformation = armcosmos.BackupInformation{
// 	ContinuousBackupInformation: &armcosmos.ContinuousBackupInformation{
// 		LatestRestorableTimestamp: to.Ptr("2021-02-05T02:40:50Z"),
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginUpdateMongoDBCollectionThroughput

func (client *MongoDBResourcesClient) BeginUpdateMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *MongoDBResourcesClientBeginUpdateMongoDBCollectionThroughputOptions) (*runtime.Poller[MongoDBResourcesClientUpdateMongoDBCollectionThroughputResponse], error)

BeginUpdateMongoDBCollectionThroughput - Update the RUs per second of an Azure Cosmos DB MongoDB collection If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • collectionName - Cosmos DB collection name.
  • updateThroughputParameters - The RUs per second of the parameters to provide for the current MongoDB collection.
  • options - MongoDBResourcesClientBeginUpdateMongoDBCollectionThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginUpdateMongoDBCollectionThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginUpdateMongoDBCollectionThroughput(ctx, "rg1", "ddb1", "databaseName", "collectionName", armcosmos.ThroughputSettingsUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.ThroughputSettingsUpdateProperties{
		Resource: &armcosmos.ThroughputSettingsResource{
			Throughput: to.Ptr[int32](400),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/mongodbCollections/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/mongodbCollections/collectionName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) BeginUpdateMongoDBDatabaseThroughput

func (client *MongoDBResourcesClient) BeginUpdateMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *MongoDBResourcesClientBeginUpdateMongoDBDatabaseThroughputOptions) (*runtime.Poller[MongoDBResourcesClientUpdateMongoDBDatabaseThroughputResponse], error)

BeginUpdateMongoDBDatabaseThroughput - Update RUs per second of the an Azure Cosmos DB MongoDB database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • updateThroughputParameters - The RUs per second of the parameters to provide for the current MongoDB database.
  • options - MongoDBResourcesClientBeginUpdateMongoDBDatabaseThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginUpdateMongoDBDatabaseThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMongoDBResourcesClient().BeginUpdateMongoDBDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", armcosmos.ThroughputSettingsUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.ThroughputSettingsUpdateProperties{
		Resource: &armcosmos.ThroughputSettingsResource{
			Throughput: to.Ptr[int32](400),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) GetMongoDBCollection

func (client *MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientGetMongoDBCollectionOptions) (MongoDBResourcesClientGetMongoDBCollectionResponse, error)

GetMongoDBCollection - Gets the MongoDB collection under an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • collectionName - Cosmos DB collection name.
  • options - MongoDBResourcesClientGetMongoDBCollectionOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoDBCollection method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMongoDBResourcesClient().GetMongoDBCollection(ctx, "rgName", "ddb1", "databaseName", "collectionName", 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.MongoDBCollectionGetResults = armcosmos.MongoDBCollectionGetResults{
// 	Name: to.Ptr("collectionName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/mongodbCollections"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/mongodbCollections/collectionName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.MongoDBCollectionGetProperties{
// 		Resource: &armcosmos.MongoDBCollectionGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			AnalyticalStorageTTL: to.Ptr[int32](500),
// 			ID: to.Ptr("testcoll"),
// 			Indexes: []*armcosmos.MongoIndex{
// 				{
// 					Key: &armcosmos.MongoIndexKeys{
// 						Keys: []*string{
// 							to.Ptr("testKey")},
// 						},
// 						Options: &armcosmos.MongoIndexOptions{
// 							ExpireAfterSeconds: to.Ptr[int32](100),
// 							Unique: to.Ptr(true),
// 						},
// 				}},
// 				ShardKey: map[string]*string{
// 					"testKey": to.Ptr("Hash"),
// 				},
// 			},
// 		},
// 	}
Output:

func (*MongoDBResourcesClient) GetMongoDBCollectionThroughput

func (client *MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientGetMongoDBCollectionThroughputOptions) (MongoDBResourcesClientGetMongoDBCollectionThroughputResponse, error)

GetMongoDBCollectionThroughput - Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • collectionName - Cosmos DB collection name.
  • options - MongoDBResourcesClientGetMongoDBCollectionThroughputOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoDBCollectionThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMongoDBResourcesClient().GetMongoDBCollectionThroughput(ctx, "rg1", "ddb1", "databaseName", "collectionName", 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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/mongodbCollections/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/mongodbCollections/collectionName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			InstantMaximumThroughput: to.Ptr("10000"),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			SoftAllowedMaximumThroughput: to.Ptr("1000000"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) GetMongoDBDatabase

func (client *MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientGetMongoDBDatabaseOptions) (MongoDBResourcesClientGetMongoDBDatabaseResponse, error)

GetMongoDBDatabase - Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - MongoDBResourcesClientGetMongoDBDatabaseOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoDBDatabase method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMongoDBResourcesClient().GetMongoDBDatabase(ctx, "rg1", "ddb1", "databaseName", 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.MongoDBDatabaseGetResults = armcosmos.MongoDBDatabaseGetResults{
// 	Name: to.Ptr("databaseName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.MongoDBDatabaseGetProperties{
// 		Resource: &armcosmos.MongoDBDatabaseGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			ID: to.Ptr("databaseName"),
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) GetMongoDBDatabaseThroughput

func (client *MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions) (MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse, error)

GetMongoDBDatabaseThroughput - Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoDBDatabaseThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMongoDBResourcesClient().GetMongoDBDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", 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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			InstantMaximumThroughput: to.Ptr("10000"),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			SoftAllowedMaximumThroughput: to.Ptr("1000000"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*MongoDBResourcesClient) GetMongoRoleDefinition

func (client *MongoDBResourcesClient) GetMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientGetMongoRoleDefinitionOptions) (MongoDBResourcesClientGetMongoRoleDefinitionResponse, error)

GetMongoRoleDefinition - Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • mongoRoleDefinitionID - The ID for the Role Definition {dbName.roleName}.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - MongoDBResourcesClientGetMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoRoleDefinition method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMongoDBResourcesClient().GetMongoRoleDefinition(ctx, "myMongoRoleDefinitionId", "myResourceGroupName", "myAccountName", 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.MongoRoleDefinitionGetResults = armcosmos.MongoRoleDefinitionGetResults{
// 	Name: to.Ptr("myMongoRoleDefinitionId"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions"),
// 	ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbRoleDefinitions/myMongoDbRoleDefinitionId"),
// 	Properties: &armcosmos.MongoRoleDefinitionResource{
// 		Type: to.Ptr(armcosmos.MongoRoleDefinitionTypeCustomRole),
// 		DatabaseName: to.Ptr("sales"),
// 		Privileges: []*armcosmos.Privilege{
// 			{
// 				Actions: []*string{
// 					to.Ptr("find"),
// 					to.Ptr("insert")},
// 					Resource: &armcosmos.PrivilegeResource{
// 						Collection: to.Ptr("coll"),
// 						Db: to.Ptr("sales"),
// 					},
// 			}},
// 			RoleName: to.Ptr("myRoleName"),
// 			Roles: []*armcosmos.Role{
// 				{
// 					Db: to.Ptr("sales"),
// 					Role: to.Ptr("myReadRole"),
// 			}},
// 		},
// 	}
Output:

func (*MongoDBResourcesClient) GetMongoUserDefinition

func (client *MongoDBResourcesClient) GetMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientGetMongoUserDefinitionOptions) (MongoDBResourcesClientGetMongoUserDefinitionResponse, error)

GetMongoUserDefinition - Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • mongoUserDefinitionID - The ID for the User Definition {dbName.userName}.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - MongoDBResourcesClientGetMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoUserDefinition method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMongoDBResourcesClient().GetMongoUserDefinition(ctx, "myMongoUserDefinitionId", "myResourceGroupName", "myAccountName", 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.MongoUserDefinitionGetResults = armcosmos.MongoUserDefinitionGetResults{
// 	Name: to.Ptr("myUserId"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions"),
// 	ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbUserDefinitions/myUserId"),
// 	Properties: &armcosmos.MongoUserDefinitionResource{
// 		CustomData: to.Ptr("My custom data"),
// 		DatabaseName: to.Ptr("sales"),
// 		Mechanisms: to.Ptr("SCRAM-SHA-256"),
// 		Roles: []*armcosmos.Role{
// 			{
// 				Db: to.Ptr("sales"),
// 				Role: to.Ptr("myReadRole"),
// 		}},
// 		UserName: to.Ptr("myUserName"),
// 	},
// }
Output:

func (*MongoDBResourcesClient) NewListMongoDBCollectionsPager

func (client *MongoDBResourcesClient) NewListMongoDBCollectionsPager(resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientListMongoDBCollectionsOptions) *runtime.Pager[MongoDBResourcesClientListMongoDBCollectionsResponse]

NewListMongoDBCollectionsPager - Lists the MongoDB collection under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - MongoDBResourcesClientListMongoDBCollectionsOptions contains the optional parameters for the MongoDBResourcesClient.NewListMongoDBCollectionsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBCollectionList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMongoDBResourcesClient().NewListMongoDBCollectionsPager("rgName", "ddb1", "databaseName", 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.MongoDBCollectionListResult = armcosmos.MongoDBCollectionListResult{
	// 	Value: []*armcosmos.MongoDBCollectionGetResults{
	// 		{
	// 			Name: to.Ptr("collectionName"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/mongodbCollections"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName/mongodbCollections/collectionName"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.MongoDBCollectionGetProperties{
	// 				Resource: &armcosmos.MongoDBCollectionGetPropertiesResource{
	// 					AnalyticalStorageTTL: to.Ptr[int32](500),
	// 					ID: to.Ptr("testcoll"),
	// 					Indexes: []*armcosmos.MongoIndex{
	// 						{
	// 							Key: &armcosmos.MongoIndexKeys{
	// 								Keys: []*string{
	// 									to.Ptr("testKey")},
	// 								},
	// 								Options: &armcosmos.MongoIndexOptions{
	// 									ExpireAfterSeconds: to.Ptr[int32](100),
	// 									Unique: to.Ptr(true),
	// 								},
	// 						}},
	// 						ShardKey: map[string]*string{
	// 							"testKey": to.Ptr("Hash"),
	// 						},
	// 					},
	// 				},
	// 		}},
	// 	}
}
Output:

func (*MongoDBResourcesClient) NewListMongoDBDatabasesPager

NewListMongoDBDatabasesPager - Lists the MongoDB databases under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - MongoDBResourcesClientListMongoDBDatabasesOptions contains the optional parameters for the MongoDBResourcesClient.NewListMongoDBDatabasesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBDatabaseList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMongoDBResourcesClient().NewListMongoDBDatabasesPager("rgName", "ddb1", 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.MongoDBDatabaseListResult = armcosmos.MongoDBDatabaseListResult{
	// 	Value: []*armcosmos.MongoDBDatabaseGetResults{
	// 		{
	// 			Name: to.Ptr("databaseName"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbDatabases"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/mongodbDatabases/databaseName"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.MongoDBDatabaseGetProperties{
	// 				Resource: &armcosmos.MongoDBDatabaseGetPropertiesResource{
	// 					ID: to.Ptr("databaseName"),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

func (*MongoDBResourcesClient) NewListMongoRoleDefinitionsPager

NewListMongoRoleDefinitionsPager - Retrieves the list of all Azure Cosmos DB Mongo Role Definitions.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - MongoDBResourcesClientListMongoRoleDefinitionsOptions contains the optional parameters for the MongoDBResourcesClient.NewListMongoRoleDefinitionsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMongoDBResourcesClient().NewListMongoRoleDefinitionsPager("myResourceGroupName", "myAccountName", 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.MongoRoleDefinitionListResult = armcosmos.MongoRoleDefinitionListResult{
	// 	Value: []*armcosmos.MongoRoleDefinitionGetResults{
	// 		{
	// 			Name: to.Ptr("myRoleDefinitionId"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions"),
	// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbRoleDefinitions/myRoleDefinitionId"),
	// 			Properties: &armcosmos.MongoRoleDefinitionResource{
	// 				Type: to.Ptr(armcosmos.MongoRoleDefinitionTypeCustomRole),
	// 				DatabaseName: to.Ptr("sales"),
	// 				Privileges: []*armcosmos.Privilege{
	// 					{
	// 						Actions: []*string{
	// 							to.Ptr("find"),
	// 							to.Ptr("insert")},
	// 							Resource: &armcosmos.PrivilegeResource{
	// 								Collection: to.Ptr("coll"),
	// 								Db: to.Ptr("sales"),
	// 							},
	// 					}},
	// 					RoleName: to.Ptr("myRoleName"),
	// 					Roles: []*armcosmos.Role{
	// 						{
	// 							Db: to.Ptr("sales"),
	// 							Role: to.Ptr("myReadRole"),
	// 					}},
	// 				},
	// 		}},
	// 	}
}
Output:

func (*MongoDBResourcesClient) NewListMongoUserDefinitionsPager

NewListMongoUserDefinitionsPager - Retrieves the list of all Azure Cosmos DB Mongo User Definition.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - MongoDBResourcesClientListMongoUserDefinitionsOptions contains the optional parameters for the MongoDBResourcesClient.NewListMongoUserDefinitionsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMongoDBUserDefinitionList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMongoDBResourcesClient().NewListMongoUserDefinitionsPager("myResourceGroupName", "myAccountName", 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.MongoUserDefinitionListResult = armcosmos.MongoUserDefinitionListResult{
	// 	Value: []*armcosmos.MongoUserDefinitionGetResults{
	// 		{
	// 			Name: to.Ptr("myUserId"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions"),
	// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbUserDefinitions/myUserId"),
	// 			Properties: &armcosmos.MongoUserDefinitionResource{
	// 				CustomData: to.Ptr("My custom data"),
	// 				DatabaseName: to.Ptr("sales"),
	// 				Mechanisms: to.Ptr("SCRAM-SHA-256"),
	// 				Roles: []*armcosmos.Role{
	// 					{
	// 						Db: to.Ptr("sales"),
	// 						Role: to.Ptr("myReadRole"),
	// 				}},
	// 				UserName: to.Ptr("myUserName"),
	// 			},
	// 	}},
	// }
}
Output:

type MongoDBResourcesClientBeginCreateUpdateMongoDBCollectionOptions

type MongoDBResourcesClientBeginCreateUpdateMongoDBCollectionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginCreateUpdateMongoDBCollectionOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoDBCollection method.

type MongoDBResourcesClientBeginCreateUpdateMongoDBDatabaseOptions

type MongoDBResourcesClientBeginCreateUpdateMongoDBDatabaseOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginCreateUpdateMongoDBDatabaseOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoDBDatabase method.

type MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions

type MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoRoleDefinition method.

type MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions

type MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoUserDefinition method.

type MongoDBResourcesClientBeginDeleteMongoDBCollectionOptions

type MongoDBResourcesClientBeginDeleteMongoDBCollectionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginDeleteMongoDBCollectionOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoDBCollection method.

type MongoDBResourcesClientBeginDeleteMongoDBDatabaseOptions

type MongoDBResourcesClientBeginDeleteMongoDBDatabaseOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginDeleteMongoDBDatabaseOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoDBDatabase method.

type MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions

type MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoRoleDefinition method.

type MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions

type MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoUserDefinition method.

type MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions

type MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions contains the optional parameters for the MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge method.

type MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions

type MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions contains the optional parameters for the MongoDBResourcesClient.BeginMigrateMongoDBCollectionToAutoscale method.

type MongoDBResourcesClientBeginMigrateMongoDBCollectionToManualThroughputOptions

type MongoDBResourcesClientBeginMigrateMongoDBCollectionToManualThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginMigrateMongoDBCollectionToManualThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginMigrateMongoDBCollectionToManualThroughput method.

type MongoDBResourcesClientBeginMigrateMongoDBDatabaseToAutoscaleOptions

type MongoDBResourcesClientBeginMigrateMongoDBDatabaseToAutoscaleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginMigrateMongoDBDatabaseToAutoscaleOptions contains the optional parameters for the MongoDBResourcesClient.BeginMigrateMongoDBDatabaseToAutoscale method.

type MongoDBResourcesClientBeginMigrateMongoDBDatabaseToManualThroughputOptions

type MongoDBResourcesClientBeginMigrateMongoDBDatabaseToManualThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginMigrateMongoDBDatabaseToManualThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginMigrateMongoDBDatabaseToManualThroughput method.

type MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions

type MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput method.

type MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions

type MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution method.

type MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions

type MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginMongoDBDatabasePartitionMergeOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBDatabasePartitionMerge method.

type MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions

type MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginMongoDBDatabaseRedistributeThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBDatabaseRedistributeThroughput method.

type MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions

type MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginMongoDBDatabaseRetrieveThroughputDistributionOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBDatabaseRetrieveThroughputDistribution method.

type MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions

type MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the MongoDBResourcesClient.BeginRetrieveContinuousBackupInformation method.

type MongoDBResourcesClientBeginUpdateMongoDBCollectionThroughputOptions

type MongoDBResourcesClientBeginUpdateMongoDBCollectionThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginUpdateMongoDBCollectionThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginUpdateMongoDBCollectionThroughput method.

type MongoDBResourcesClientBeginUpdateMongoDBDatabaseThroughputOptions

type MongoDBResourcesClientBeginUpdateMongoDBDatabaseThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

MongoDBResourcesClientBeginUpdateMongoDBDatabaseThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginUpdateMongoDBDatabaseThroughput method.

type MongoDBResourcesClientCreateUpdateMongoDBCollectionResponse

type MongoDBResourcesClientCreateUpdateMongoDBCollectionResponse struct {
	// An Azure Cosmos DB MongoDB collection.
	MongoDBCollectionGetResults
}

MongoDBResourcesClientCreateUpdateMongoDBCollectionResponse contains the response from method MongoDBResourcesClient.BeginCreateUpdateMongoDBCollection.

type MongoDBResourcesClientCreateUpdateMongoDBDatabaseResponse

type MongoDBResourcesClientCreateUpdateMongoDBDatabaseResponse struct {
	// An Azure Cosmos DB MongoDB database.
	MongoDBDatabaseGetResults
}

MongoDBResourcesClientCreateUpdateMongoDBDatabaseResponse contains the response from method MongoDBResourcesClient.BeginCreateUpdateMongoDBDatabase.

type MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse

type MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse struct {
	// An Azure Cosmos DB Mongo Role Definition.
	MongoRoleDefinitionGetResults
}

MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse contains the response from method MongoDBResourcesClient.BeginCreateUpdateMongoRoleDefinition.

type MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse

type MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse struct {
	// An Azure Cosmos DB User Definition
	MongoUserDefinitionGetResults
}

MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse contains the response from method MongoDBResourcesClient.BeginCreateUpdateMongoUserDefinition.

type MongoDBResourcesClientDeleteMongoDBCollectionResponse

type MongoDBResourcesClientDeleteMongoDBCollectionResponse struct {
}

MongoDBResourcesClientDeleteMongoDBCollectionResponse contains the response from method MongoDBResourcesClient.BeginDeleteMongoDBCollection.

type MongoDBResourcesClientDeleteMongoDBDatabaseResponse

type MongoDBResourcesClientDeleteMongoDBDatabaseResponse struct {
}

MongoDBResourcesClientDeleteMongoDBDatabaseResponse contains the response from method MongoDBResourcesClient.BeginDeleteMongoDBDatabase.

type MongoDBResourcesClientDeleteMongoRoleDefinitionResponse

type MongoDBResourcesClientDeleteMongoRoleDefinitionResponse struct {
}

MongoDBResourcesClientDeleteMongoRoleDefinitionResponse contains the response from method MongoDBResourcesClient.BeginDeleteMongoRoleDefinition.

type MongoDBResourcesClientDeleteMongoUserDefinitionResponse

type MongoDBResourcesClientDeleteMongoUserDefinitionResponse struct {
}

MongoDBResourcesClientDeleteMongoUserDefinitionResponse contains the response from method MongoDBResourcesClient.BeginDeleteMongoUserDefinition.

type MongoDBResourcesClientGetMongoDBCollectionOptions

type MongoDBResourcesClientGetMongoDBCollectionOptions struct {
}

MongoDBResourcesClientGetMongoDBCollectionOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoDBCollection method.

type MongoDBResourcesClientGetMongoDBCollectionResponse

type MongoDBResourcesClientGetMongoDBCollectionResponse struct {
	// An Azure Cosmos DB MongoDB collection.
	MongoDBCollectionGetResults
}

MongoDBResourcesClientGetMongoDBCollectionResponse contains the response from method MongoDBResourcesClient.GetMongoDBCollection.

type MongoDBResourcesClientGetMongoDBCollectionThroughputOptions

type MongoDBResourcesClientGetMongoDBCollectionThroughputOptions struct {
}

MongoDBResourcesClientGetMongoDBCollectionThroughputOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoDBCollectionThroughput method.

type MongoDBResourcesClientGetMongoDBCollectionThroughputResponse

type MongoDBResourcesClientGetMongoDBCollectionThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

MongoDBResourcesClientGetMongoDBCollectionThroughputResponse contains the response from method MongoDBResourcesClient.GetMongoDBCollectionThroughput.

type MongoDBResourcesClientGetMongoDBDatabaseOptions

type MongoDBResourcesClientGetMongoDBDatabaseOptions struct {
}

MongoDBResourcesClientGetMongoDBDatabaseOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoDBDatabase method.

type MongoDBResourcesClientGetMongoDBDatabaseResponse

type MongoDBResourcesClientGetMongoDBDatabaseResponse struct {
	// An Azure Cosmos DB MongoDB database.
	MongoDBDatabaseGetResults
}

MongoDBResourcesClientGetMongoDBDatabaseResponse contains the response from method MongoDBResourcesClient.GetMongoDBDatabase.

type MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions

type MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions struct {
}

MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoDBDatabaseThroughput method.

type MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse

type MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse contains the response from method MongoDBResourcesClient.GetMongoDBDatabaseThroughput.

type MongoDBResourcesClientGetMongoRoleDefinitionOptions

type MongoDBResourcesClientGetMongoRoleDefinitionOptions struct {
}

MongoDBResourcesClientGetMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoRoleDefinition method.

type MongoDBResourcesClientGetMongoRoleDefinitionResponse

type MongoDBResourcesClientGetMongoRoleDefinitionResponse struct {
	// An Azure Cosmos DB Mongo Role Definition.
	MongoRoleDefinitionGetResults
}

MongoDBResourcesClientGetMongoRoleDefinitionResponse contains the response from method MongoDBResourcesClient.GetMongoRoleDefinition.

type MongoDBResourcesClientGetMongoUserDefinitionOptions

type MongoDBResourcesClientGetMongoUserDefinitionOptions struct {
}

MongoDBResourcesClientGetMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoUserDefinition method.

type MongoDBResourcesClientGetMongoUserDefinitionResponse

type MongoDBResourcesClientGetMongoUserDefinitionResponse struct {
	// An Azure Cosmos DB User Definition
	MongoUserDefinitionGetResults
}

MongoDBResourcesClientGetMongoUserDefinitionResponse contains the response from method MongoDBResourcesClient.GetMongoUserDefinition.

type MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse

type MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse struct {
	// List of physical partitions and their properties returned by a merge operation.
	PhysicalPartitionStorageInfoCollection
}

MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse contains the response from method MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge.

type MongoDBResourcesClientListMongoDBCollectionsOptions

type MongoDBResourcesClientListMongoDBCollectionsOptions struct {
}

MongoDBResourcesClientListMongoDBCollectionsOptions contains the optional parameters for the MongoDBResourcesClient.NewListMongoDBCollectionsPager method.

type MongoDBResourcesClientListMongoDBCollectionsResponse

type MongoDBResourcesClientListMongoDBCollectionsResponse struct {
	// The List operation response, that contains the MongoDB collections and their properties.
	MongoDBCollectionListResult
}

MongoDBResourcesClientListMongoDBCollectionsResponse contains the response from method MongoDBResourcesClient.NewListMongoDBCollectionsPager.

type MongoDBResourcesClientListMongoDBDatabasesOptions

type MongoDBResourcesClientListMongoDBDatabasesOptions struct {
}

MongoDBResourcesClientListMongoDBDatabasesOptions contains the optional parameters for the MongoDBResourcesClient.NewListMongoDBDatabasesPager method.

type MongoDBResourcesClientListMongoDBDatabasesResponse

type MongoDBResourcesClientListMongoDBDatabasesResponse struct {
	// The List operation response, that contains the MongoDB databases and their properties.
	MongoDBDatabaseListResult
}

MongoDBResourcesClientListMongoDBDatabasesResponse contains the response from method MongoDBResourcesClient.NewListMongoDBDatabasesPager.

type MongoDBResourcesClientListMongoRoleDefinitionsOptions

type MongoDBResourcesClientListMongoRoleDefinitionsOptions struct {
}

MongoDBResourcesClientListMongoRoleDefinitionsOptions contains the optional parameters for the MongoDBResourcesClient.NewListMongoRoleDefinitionsPager method.

type MongoDBResourcesClientListMongoRoleDefinitionsResponse

type MongoDBResourcesClientListMongoRoleDefinitionsResponse struct {
	// The relevant Mongo Role Definitions.
	MongoRoleDefinitionListResult
}

MongoDBResourcesClientListMongoRoleDefinitionsResponse contains the response from method MongoDBResourcesClient.NewListMongoRoleDefinitionsPager.

type MongoDBResourcesClientListMongoUserDefinitionsOptions

type MongoDBResourcesClientListMongoUserDefinitionsOptions struct {
}

MongoDBResourcesClientListMongoUserDefinitionsOptions contains the optional parameters for the MongoDBResourcesClient.NewListMongoUserDefinitionsPager method.

type MongoDBResourcesClientListMongoUserDefinitionsResponse

type MongoDBResourcesClientListMongoUserDefinitionsResponse struct {
	// The relevant User Definition.
	MongoUserDefinitionListResult
}

MongoDBResourcesClientListMongoUserDefinitionsResponse contains the response from method MongoDBResourcesClient.NewListMongoUserDefinitionsPager.

type MongoDBResourcesClientMigrateMongoDBCollectionToAutoscaleResponse

type MongoDBResourcesClientMigrateMongoDBCollectionToAutoscaleResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

MongoDBResourcesClientMigrateMongoDBCollectionToAutoscaleResponse contains the response from method MongoDBResourcesClient.BeginMigrateMongoDBCollectionToAutoscale.

type MongoDBResourcesClientMigrateMongoDBCollectionToManualThroughputResponse

type MongoDBResourcesClientMigrateMongoDBCollectionToManualThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

MongoDBResourcesClientMigrateMongoDBCollectionToManualThroughputResponse contains the response from method MongoDBResourcesClient.BeginMigrateMongoDBCollectionToManualThroughput.

type MongoDBResourcesClientMigrateMongoDBDatabaseToAutoscaleResponse

type MongoDBResourcesClientMigrateMongoDBDatabaseToAutoscaleResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

MongoDBResourcesClientMigrateMongoDBDatabaseToAutoscaleResponse contains the response from method MongoDBResourcesClient.BeginMigrateMongoDBDatabaseToAutoscale.

type MongoDBResourcesClientMigrateMongoDBDatabaseToManualThroughputResponse

type MongoDBResourcesClientMigrateMongoDBDatabaseToManualThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

MongoDBResourcesClientMigrateMongoDBDatabaseToManualThroughputResponse contains the response from method MongoDBResourcesClient.BeginMigrateMongoDBDatabaseToManualThroughput.

type MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse

type MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse struct {
	// An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.
	PhysicalPartitionThroughputInfoResult
}

MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse contains the response from method MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput.

type MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse

type MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse struct {
	// An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.
	PhysicalPartitionThroughputInfoResult
}

MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse contains the response from method MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution.

type MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse

type MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse struct {
	// List of physical partitions and their properties returned by a merge operation.
	PhysicalPartitionStorageInfoCollection
}

MongoDBResourcesClientMongoDBDatabasePartitionMergeResponse contains the response from method MongoDBResourcesClient.BeginMongoDBDatabasePartitionMerge.

type MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse

type MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse struct {
	// An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.
	PhysicalPartitionThroughputInfoResult
}

MongoDBResourcesClientMongoDBDatabaseRedistributeThroughputResponse contains the response from method MongoDBResourcesClient.BeginMongoDBDatabaseRedistributeThroughput.

type MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse

type MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse struct {
	// An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.
	PhysicalPartitionThroughputInfoResult
}

MongoDBResourcesClientMongoDBDatabaseRetrieveThroughputDistributionResponse contains the response from method MongoDBResourcesClient.BeginMongoDBDatabaseRetrieveThroughputDistribution.

type MongoDBResourcesClientRetrieveContinuousBackupInformationResponse

type MongoDBResourcesClientRetrieveContinuousBackupInformationResponse struct {
	// Backup information of a resource.
	BackupInformation
}

MongoDBResourcesClientRetrieveContinuousBackupInformationResponse contains the response from method MongoDBResourcesClient.BeginRetrieveContinuousBackupInformation.

type MongoDBResourcesClientUpdateMongoDBCollectionThroughputResponse

type MongoDBResourcesClientUpdateMongoDBCollectionThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

MongoDBResourcesClientUpdateMongoDBCollectionThroughputResponse contains the response from method MongoDBResourcesClient.BeginUpdateMongoDBCollectionThroughput.

type MongoDBResourcesClientUpdateMongoDBDatabaseThroughputResponse

type MongoDBResourcesClientUpdateMongoDBDatabaseThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

MongoDBResourcesClientUpdateMongoDBDatabaseThroughputResponse contains the response from method MongoDBResourcesClient.BeginUpdateMongoDBDatabaseThroughput.

type MongoDataTransferDataSourceSink

type MongoDataTransferDataSourceSink struct {
	// REQUIRED
	CollectionName *string

	// REQUIRED
	Component *DataTransferComponent

	// REQUIRED
	DatabaseName      *string
	RemoteAccountName *string
}

MongoDataTransferDataSourceSink - A CosmosDB Mongo API data source/sink

func (*MongoDataTransferDataSourceSink) GetBaseCosmosDataTransferDataSourceSink

func (m *MongoDataTransferDataSourceSink) GetBaseCosmosDataTransferDataSourceSink() *BaseCosmosDataTransferDataSourceSink

GetBaseCosmosDataTransferDataSourceSink implements the BaseCosmosDataTransferDataSourceSinkClassification interface for type MongoDataTransferDataSourceSink.

func (*MongoDataTransferDataSourceSink) GetDataTransferDataSourceSink

func (m *MongoDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink

GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type MongoDataTransferDataSourceSink.

func (MongoDataTransferDataSourceSink) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoDataTransferDataSourceSink.

func (*MongoDataTransferDataSourceSink) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoDataTransferDataSourceSink.

type MongoIndex

type MongoIndex struct {
	// Cosmos DB MongoDB collection index keys
	Key *MongoIndexKeys

	// Cosmos DB MongoDB collection index key options
	Options *MongoIndexOptions
}

MongoIndex - Cosmos DB MongoDB collection index key

func (MongoIndex) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoIndex.

func (*MongoIndex) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoIndex.

type MongoIndexKeys

type MongoIndexKeys struct {
	// List of keys for each MongoDB collection in the Azure Cosmos DB service
	Keys []*string
}

MongoIndexKeys - Cosmos DB MongoDB collection resource object

func (MongoIndexKeys) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoIndexKeys.

func (*MongoIndexKeys) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoIndexKeys.

type MongoIndexOptions

type MongoIndexOptions struct {
	// Expire after seconds
	ExpireAfterSeconds *int32

	// Is unique or not
	Unique *bool
}

MongoIndexOptions - Cosmos DB MongoDB collection index options

func (MongoIndexOptions) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoIndexOptions.

func (*MongoIndexOptions) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoIndexOptions.

type MongoRoleDefinitionCreateUpdateParameters

type MongoRoleDefinitionCreateUpdateParameters struct {
	// Properties to create and update an Azure Cosmos DB Mongo Role Definition.
	Properties *MongoRoleDefinitionResource
}

MongoRoleDefinitionCreateUpdateParameters - Parameters to create and update an Azure Cosmos DB Mongo Role Definition.

func (MongoRoleDefinitionCreateUpdateParameters) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionCreateUpdateParameters.

func (*MongoRoleDefinitionCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionCreateUpdateParameters.

type MongoRoleDefinitionGetResults

type MongoRoleDefinitionGetResults struct {
	// Properties related to the Mongo Role Definition.
	Properties *MongoRoleDefinitionResource

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

MongoRoleDefinitionGetResults - An Azure Cosmos DB Mongo Role Definition.

func (MongoRoleDefinitionGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionGetResults.

func (*MongoRoleDefinitionGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionGetResults.

type MongoRoleDefinitionListResult

type MongoRoleDefinitionListResult struct {
	// READ-ONLY; List of Mongo Role Definitions and their properties.
	Value []*MongoRoleDefinitionGetResults
}

MongoRoleDefinitionListResult - The relevant Mongo Role Definitions.

func (MongoRoleDefinitionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionListResult.

func (*MongoRoleDefinitionListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionListResult.

type MongoRoleDefinitionResource

type MongoRoleDefinitionResource struct {
	// The database name for which access is being granted for this Role Definition.
	DatabaseName *string

	// A set of privileges contained by the Role Definition. This will allow application of this Role Definition on the entire
	// database account or any underlying Database / Collection. Scopes higher than
	// Database are not enforceable as privilege.
	Privileges []*Privilege

	// A user-friendly name for the Role Definition. Must be unique for the database account.
	RoleName *string

	// The set of roles inherited by this Role Definition.
	Roles []*Role

	// Indicates whether the Role Definition was built-in or user created.
	Type *MongoRoleDefinitionType
}

MongoRoleDefinitionResource - Azure Cosmos DB Mongo Role Definition resource object.

func (MongoRoleDefinitionResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionResource.

func (*MongoRoleDefinitionResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionResource.

type MongoRoleDefinitionType

type MongoRoleDefinitionType string

MongoRoleDefinitionType - Indicates whether the Role Definition was built-in or user created.

const (
	MongoRoleDefinitionTypeBuiltInRole MongoRoleDefinitionType = "BuiltInRole"
	MongoRoleDefinitionTypeCustomRole  MongoRoleDefinitionType = "CustomRole"
)

func PossibleMongoRoleDefinitionTypeValues

func PossibleMongoRoleDefinitionTypeValues() []MongoRoleDefinitionType

PossibleMongoRoleDefinitionTypeValues returns the possible values for the MongoRoleDefinitionType const type.

type MongoUserDefinitionCreateUpdateParameters

type MongoUserDefinitionCreateUpdateParameters struct {
	// Properties to create and update an Azure Cosmos DB Mongo User Definition.
	Properties *MongoUserDefinitionResource
}

MongoUserDefinitionCreateUpdateParameters - Parameters to create and update an Azure Cosmos DB Mongo User Definition.

func (MongoUserDefinitionCreateUpdateParameters) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionCreateUpdateParameters.

func (*MongoUserDefinitionCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionCreateUpdateParameters.

type MongoUserDefinitionGetResults

type MongoUserDefinitionGetResults struct {
	// Properties related to the User Definition.
	Properties *MongoUserDefinitionResource

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

MongoUserDefinitionGetResults - An Azure Cosmos DB User Definition

func (MongoUserDefinitionGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionGetResults.

func (*MongoUserDefinitionGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionGetResults.

type MongoUserDefinitionListResult

type MongoUserDefinitionListResult struct {
	// READ-ONLY; List of User Definition and their properties
	Value []*MongoUserDefinitionGetResults
}

MongoUserDefinitionListResult - The relevant User Definition.

func (MongoUserDefinitionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionListResult.

func (*MongoUserDefinitionListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionListResult.

type MongoUserDefinitionResource

type MongoUserDefinitionResource struct {
	// A custom definition for the USer Definition.
	CustomData *string

	// The database name for which access is being granted for this User Definition.
	DatabaseName *string

	// The Mongo Auth mechanism. For now, we only support auth mechanism SCRAM-SHA-256.
	Mechanisms *string

	// The password for User Definition. Response does not contain user password.
	Password *string

	// The set of roles inherited by the User Definition.
	Roles []*Role

	// The user name for User Definition.
	UserName *string
}

MongoUserDefinitionResource - Azure Cosmos DB Mongo User Definition resource object.

func (MongoUserDefinitionResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionResource.

func (*MongoUserDefinitionResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionResource.

type NetworkACLBypass

type NetworkACLBypass string

NetworkACLBypass - Indicates what services are allowed to bypass firewall checks.

const (
	NetworkACLBypassAzureServices NetworkACLBypass = "AzureServices"
	NetworkACLBypassNone          NetworkACLBypass = "None"
)

func PossibleNetworkACLBypassValues

func PossibleNetworkACLBypassValues() []NetworkACLBypass

PossibleNetworkACLBypassValues returns the possible values for the NetworkACLBypass const type.

type NodeGroupProperties

type NodeGroupProperties struct {
	// The disk storage size for the node group in GB. Example values: 128, 256, 512, 1024.
	DiskSizeGB *int64

	// Whether high availability is enabled on the node group.
	EnableHa *bool

	// The resource sku for the node group. This defines the size of CPU and memory that is provisioned for each node. Example
	// values: 'M30', 'M40'.
	SKU *string
}

NodeGroupProperties - The properties of the node group on a cluster.

func (NodeGroupProperties) MarshalJSON

func (n NodeGroupProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NodeGroupProperties.

func (*NodeGroupProperties) UnmarshalJSON

func (n *NodeGroupProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NodeGroupProperties.

type NodeGroupSpec

type NodeGroupSpec struct {
	// The disk storage size for the node group in GB. Example values: 128, 256, 512, 1024.
	DiskSizeGB *int64

	// Whether high availability is enabled on the node group.
	EnableHa *bool

	// The node type deployed in the node group.
	Kind *NodeKind

	// The number of nodes in the node group.
	NodeCount *int32

	// The resource sku for the node group. This defines the size of CPU and memory that is provisioned for each node. Example
	// values: 'M30', 'M40'.
	SKU *string
}

NodeGroupSpec - Specification for a node group.

func (NodeGroupSpec) MarshalJSON

func (n NodeGroupSpec) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NodeGroupSpec.

func (*NodeGroupSpec) UnmarshalJSON

func (n *NodeGroupSpec) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NodeGroupSpec.

type NodeKind

type NodeKind string

NodeKind - The kind of a node in the mongo cluster.

const (
	NodeKindShard NodeKind = "Shard"
)

func PossibleNodeKindValues

func PossibleNodeKindValues() []NodeKind

PossibleNodeKindValues returns the possible values for the NodeKind const type.

type NodeState

type NodeState string

NodeState - The state of the node in Cassandra ring.

const (
	NodeStateJoining NodeState = "Joining"
	NodeStateLeaving NodeState = "Leaving"
	NodeStateMoving  NodeState = "Moving"
	NodeStateNormal  NodeState = "Normal"
	NodeStateStopped NodeState = "Stopped"
)

func PossibleNodeStateValues

func PossibleNodeStateValues() []NodeState

PossibleNodeStateValues returns the possible values for the NodeState const type.

type NodeStatus

type NodeStatus string

NodeStatus - Indicates whether the node is functioning or not.

const (
	NodeStatusDown NodeStatus = "Down"
	NodeStatusUp   NodeStatus = "Up"
)

func PossibleNodeStatusValues

func PossibleNodeStatusValues() []NodeStatus

PossibleNodeStatusValues returns the possible values for the NodeStatus const type.

type NotebookWorkspace

type NotebookWorkspace struct {
	// Resource properties.
	Properties *NotebookWorkspaceProperties

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

NotebookWorkspace - A notebook workspace resource

func (NotebookWorkspace) MarshalJSON

func (n NotebookWorkspace) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotebookWorkspace.

func (*NotebookWorkspace) UnmarshalJSON

func (n *NotebookWorkspace) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspace.

type NotebookWorkspaceConnectionInfoResult

type NotebookWorkspaceConnectionInfoResult struct {
	// READ-ONLY; Specifies auth token used for connecting to Notebook server (uses token-based auth).
	AuthToken *string

	// READ-ONLY; Specifies the endpoint of Notebook server.
	NotebookServerEndpoint *string
}

NotebookWorkspaceConnectionInfoResult - The connection info for the given notebook workspace

func (NotebookWorkspaceConnectionInfoResult) MarshalJSON

func (n NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceConnectionInfoResult.

func (*NotebookWorkspaceConnectionInfoResult) UnmarshalJSON

func (n *NotebookWorkspaceConnectionInfoResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceConnectionInfoResult.

type NotebookWorkspaceCreateUpdateParameters

type NotebookWorkspaceCreateUpdateParameters struct {
	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

NotebookWorkspaceCreateUpdateParameters - Parameters to create a notebook workspace resource

func (NotebookWorkspaceCreateUpdateParameters) MarshalJSON

func (n NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceCreateUpdateParameters.

func (*NotebookWorkspaceCreateUpdateParameters) UnmarshalJSON

func (n *NotebookWorkspaceCreateUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceCreateUpdateParameters.

type NotebookWorkspaceListResult

type NotebookWorkspaceListResult struct {
	// Array of notebook workspace resources
	Value []*NotebookWorkspace
}

NotebookWorkspaceListResult - A list of notebook workspace resources

func (NotebookWorkspaceListResult) MarshalJSON

func (n NotebookWorkspaceListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceListResult.

func (*NotebookWorkspaceListResult) UnmarshalJSON

func (n *NotebookWorkspaceListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceListResult.

type NotebookWorkspaceName

type NotebookWorkspaceName string
const (
	NotebookWorkspaceNameDefault NotebookWorkspaceName = "default"
)

func PossibleNotebookWorkspaceNameValues

func PossibleNotebookWorkspaceNameValues() []NotebookWorkspaceName

PossibleNotebookWorkspaceNameValues returns the possible values for the NotebookWorkspaceName const type.

type NotebookWorkspaceProperties

type NotebookWorkspaceProperties struct {
	// READ-ONLY; Specifies the endpoint of Notebook server.
	NotebookServerEndpoint *string

	// READ-ONLY; Status of the notebook workspace. Possible values are: Creating, Online, Deleting, Failed, Updating.
	Status *string
}

NotebookWorkspaceProperties - Properties of a notebook workspace resource.

func (NotebookWorkspaceProperties) MarshalJSON

func (n NotebookWorkspaceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceProperties.

func (*NotebookWorkspaceProperties) UnmarshalJSON

func (n *NotebookWorkspaceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceProperties.

type NotebookWorkspacesClient

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

NotebookWorkspacesClient contains the methods for the NotebookWorkspaces group. Don't use this type directly, use NewNotebookWorkspacesClient() instead.

func NewNotebookWorkspacesClient

func NewNotebookWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NotebookWorkspacesClient, error)

NewNotebookWorkspacesClient creates a new instance of NotebookWorkspacesClient with the specified values.

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

func (*NotebookWorkspacesClient) BeginCreateOrUpdate

func (client *NotebookWorkspacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters, options *NotebookWorkspacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[NotebookWorkspacesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates the notebook workspace for a Cosmos DB account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • notebookWorkspaceName - The name of the notebook workspace resource.
  • notebookCreateUpdateParameters - The notebook workspace to create for the current database account.
  • options - NotebookWorkspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the NotebookWorkspacesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNotebookWorkspacesClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, armcosmos.NotebookWorkspaceCreateUpdateParameters{}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.NotebookWorkspace = armcosmos.NotebookWorkspace{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/notebookWorkspaces/default"),
// 	Properties: &armcosmos.NotebookWorkspaceProperties{
// 		NotebookServerEndpoint: to.Ptr("endpoint"),
// 		Status: to.Ptr("Online"),
// 	},
// }
Output:

func (*NotebookWorkspacesClient) BeginDelete

func (client *NotebookWorkspacesClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientBeginDeleteOptions) (*runtime.Poller[NotebookWorkspacesClientDeleteResponse], error)

BeginDelete - Deletes the notebook workspace for a Cosmos DB account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • notebookWorkspaceName - The name of the notebook workspace resource.
  • options - NotebookWorkspacesClientBeginDeleteOptions contains the optional parameters for the NotebookWorkspacesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNotebookWorkspacesClient().BeginDelete(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*NotebookWorkspacesClient) BeginRegenerateAuthToken

BeginRegenerateAuthToken - Regenerates the auth token for the notebook workspace If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • notebookWorkspaceName - The name of the notebook workspace resource.
  • options - NotebookWorkspacesClientBeginRegenerateAuthTokenOptions contains the optional parameters for the NotebookWorkspacesClient.BeginRegenerateAuthToken method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNotebookWorkspacesClient().BeginRegenerateAuthToken(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*NotebookWorkspacesClient) BeginStart

func (client *NotebookWorkspacesClient) BeginStart(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientBeginStartOptions) (*runtime.Poller[NotebookWorkspacesClientStartResponse], error)

BeginStart - Starts the notebook workspace If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • notebookWorkspaceName - The name of the notebook workspace resource.
  • options - NotebookWorkspacesClientBeginStartOptions contains the optional parameters for the NotebookWorkspacesClient.BeginStart method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceStart.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNotebookWorkspacesClient().BeginStart(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*NotebookWorkspacesClient) Get

func (client *NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientGetOptions) (NotebookWorkspacesClientGetResponse, error)

Get - Gets the notebook workspace for a Cosmos DB account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • notebookWorkspaceName - The name of the notebook workspace resource.
  • options - NotebookWorkspacesClientGetOptions contains the optional parameters for the NotebookWorkspacesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewNotebookWorkspacesClient().Get(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, 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.NotebookWorkspace = armcosmos.NotebookWorkspace{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/notebookWorkspaces/default"),
// 	Properties: &armcosmos.NotebookWorkspaceProperties{
// 		NotebookServerEndpoint: to.Ptr("endpoint"),
// 		Status: to.Ptr("Online"),
// 	},
// }
Output:

func (*NotebookWorkspacesClient) ListConnectionInfo

func (client *NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientListConnectionInfoOptions) (NotebookWorkspacesClientListConnectionInfoResponse, error)

ListConnectionInfo - Retrieves the connection info for the notebook workspace If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • notebookWorkspaceName - The name of the notebook workspace resource.
  • options - NotebookWorkspacesClientListConnectionInfoOptions contains the optional parameters for the NotebookWorkspacesClient.ListConnectionInfo method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewNotebookWorkspacesClient().ListConnectionInfo(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, 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.NotebookWorkspaceConnectionInfoResult = armcosmos.NotebookWorkspaceConnectionInfoResult{
// 	AuthToken: to.Ptr("auth-token"),
// 	NotebookServerEndpoint: to.Ptr("notebook endpoint"),
// }
Output:

func (*NotebookWorkspacesClient) NewListByDatabaseAccountPager

NewListByDatabaseAccountPager - Gets the notebook workspace resources of an existing Cosmos DB account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - NotebookWorkspacesClientListByDatabaseAccountOptions contains the optional parameters for the NotebookWorkspacesClient.NewListByDatabaseAccountPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBNotebookWorkspaceList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewNotebookWorkspacesClient().NewListByDatabaseAccountPager("rg1", "ddb1", 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.NotebookWorkspaceListResult = armcosmos.NotebookWorkspaceListResult{
	// 	Value: []*armcosmos.NotebookWorkspace{
	// 		{
	// 			Name: to.Ptr("default"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/notebookWorkspaces/default"),
	// 			Properties: &armcosmos.NotebookWorkspaceProperties{
	// 				NotebookServerEndpoint: to.Ptr("endpoint"),
	// 				Status: to.Ptr("Online"),
	// 			},
	// 	}},
	// }
}
Output:

type NotebookWorkspacesClientBeginCreateOrUpdateOptions

type NotebookWorkspacesClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

NotebookWorkspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the NotebookWorkspacesClient.BeginCreateOrUpdate method.

type NotebookWorkspacesClientBeginDeleteOptions

type NotebookWorkspacesClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

NotebookWorkspacesClientBeginDeleteOptions contains the optional parameters for the NotebookWorkspacesClient.BeginDelete method.

type NotebookWorkspacesClientBeginRegenerateAuthTokenOptions

type NotebookWorkspacesClientBeginRegenerateAuthTokenOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

NotebookWorkspacesClientBeginRegenerateAuthTokenOptions contains the optional parameters for the NotebookWorkspacesClient.BeginRegenerateAuthToken method.

type NotebookWorkspacesClientBeginStartOptions

type NotebookWorkspacesClientBeginStartOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

NotebookWorkspacesClientBeginStartOptions contains the optional parameters for the NotebookWorkspacesClient.BeginStart method.

type NotebookWorkspacesClientCreateOrUpdateResponse

type NotebookWorkspacesClientCreateOrUpdateResponse struct {
	// A notebook workspace resource
	NotebookWorkspace
}

NotebookWorkspacesClientCreateOrUpdateResponse contains the response from method NotebookWorkspacesClient.BeginCreateOrUpdate.

type NotebookWorkspacesClientDeleteResponse

type NotebookWorkspacesClientDeleteResponse struct {
}

NotebookWorkspacesClientDeleteResponse contains the response from method NotebookWorkspacesClient.BeginDelete.

type NotebookWorkspacesClientGetOptions

type NotebookWorkspacesClientGetOptions struct {
}

NotebookWorkspacesClientGetOptions contains the optional parameters for the NotebookWorkspacesClient.Get method.

type NotebookWorkspacesClientGetResponse

type NotebookWorkspacesClientGetResponse struct {
	// A notebook workspace resource
	NotebookWorkspace
}

NotebookWorkspacesClientGetResponse contains the response from method NotebookWorkspacesClient.Get.

type NotebookWorkspacesClientListByDatabaseAccountOptions

type NotebookWorkspacesClientListByDatabaseAccountOptions struct {
}

NotebookWorkspacesClientListByDatabaseAccountOptions contains the optional parameters for the NotebookWorkspacesClient.NewListByDatabaseAccountPager method.

type NotebookWorkspacesClientListByDatabaseAccountResponse

type NotebookWorkspacesClientListByDatabaseAccountResponse struct {
	// A list of notebook workspace resources
	NotebookWorkspaceListResult
}

NotebookWorkspacesClientListByDatabaseAccountResponse contains the response from method NotebookWorkspacesClient.NewListByDatabaseAccountPager.

type NotebookWorkspacesClientListConnectionInfoOptions

type NotebookWorkspacesClientListConnectionInfoOptions struct {
}

NotebookWorkspacesClientListConnectionInfoOptions contains the optional parameters for the NotebookWorkspacesClient.ListConnectionInfo method.

type NotebookWorkspacesClientListConnectionInfoResponse

type NotebookWorkspacesClientListConnectionInfoResponse struct {
	// The connection info for the given notebook workspace
	NotebookWorkspaceConnectionInfoResult
}

NotebookWorkspacesClientListConnectionInfoResponse contains the response from method NotebookWorkspacesClient.ListConnectionInfo.

type NotebookWorkspacesClientRegenerateAuthTokenResponse

type NotebookWorkspacesClientRegenerateAuthTokenResponse struct {
}

NotebookWorkspacesClientRegenerateAuthTokenResponse contains the response from method NotebookWorkspacesClient.BeginRegenerateAuthToken.

type NotebookWorkspacesClientStartResponse

type NotebookWorkspacesClientStartResponse struct {
}

NotebookWorkspacesClientStartResponse contains the response from method NotebookWorkspacesClient.BeginStart.

type Operation

type Operation struct {
	// The object that represents the operation.
	Display *OperationDisplay

	// Operation name: {provider}/{resource}/{operation}
	Name *string
}

Operation - REST API operation

func (Operation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// Description of operation
	Description *string

	// Operation type: Read, write, delete, etc.
	Operation *string

	// Service provider: Microsoft.ResourceProvider
	Provider *string

	// Resource on which the operation is performed: Profile, endpoint, etc.
	Resource *string
}

OperationDisplay - The object that represents the operation.

func (OperationDisplay) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// URL to get the next set of operation list results if there are any.
	NextLink *string

	// List of operations supported by the Resource Provider.
	Value []*Operation
}

OperationListResult - Result of the request to list Resource Provider operations. It contains a list of operations and a URL link to get the next set of results.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationType

type OperationType string

OperationType - Enum to indicate the operation type of the event.

const (
	OperationTypeCreate          OperationType = "Create"
	OperationTypeDelete          OperationType = "Delete"
	OperationTypeRecreate        OperationType = "Recreate"
	OperationTypeReplace         OperationType = "Replace"
	OperationTypeSystemOperation OperationType = "SystemOperation"
)

func PossibleOperationTypeValues

func PossibleOperationTypeValues() []OperationType

PossibleOperationTypeValues returns the possible values for the OperationType 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

NewListPager - Lists all of the available Cosmos DB Resource Provider operations.

Generated from API version 2024-02-15-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/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBOperationsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.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 = armcosmos.OperationListResult{
	// 	Value: []*armcosmos.Operation{
	// 		{
	// 			Name: to.Ptr("operationName"),
	// 			Display: &armcosmos.OperationDisplay{
	// 				Description: to.Ptr("description"),
	// 				Operation: to.Ptr("operationName"),
	// 				Provider: to.Ptr("providerName"),
	// 				Resource: to.Ptr("resourceName"),
	// 			},
	// 	}},
	// }
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// Result of the request to list Resource Provider operations. It contains a list of operations and a URL link to get the
	// next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type OptionsResource

type OptionsResource struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

OptionsResource - Cosmos DB options resource object

func (OptionsResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OptionsResource.

func (*OptionsResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OptionsResource.

type PartitionKeyRangeIDClient

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

PartitionKeyRangeIDClient contains the methods for the PartitionKeyRangeID group. Don't use this type directly, use NewPartitionKeyRangeIDClient() instead.

func NewPartitionKeyRangeIDClient

func NewPartitionKeyRangeIDClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PartitionKeyRangeIDClient, error)

NewPartitionKeyRangeIDClient creates a new instance of PartitionKeyRangeIDClient with the specified values.

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

func (*PartitionKeyRangeIDClient) NewListMetricsPager

func (client *PartitionKeyRangeIDClient) NewListMetricsPager(resourceGroupName string, accountName string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string, options *PartitionKeyRangeIDClientListMetricsOptions) *runtime.Pager[PartitionKeyRangeIDClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given partition key range id.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseRid - Cosmos DB database rid.
  • collectionRid - Cosmos DB collection rid.
  • partitionKeyRangeID - Partition Key Range Id for which to get data.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - PartitionKeyRangeIDClientListMetricsOptions contains the optional parameters for the PartitionKeyRangeIDClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewPartitionKeyRangeIDClient().NewListMetricsPager("rg1", "ddb1", "databaseRid", "collectionRid", "0", "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", 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.PartitionMetricListResult = armcosmos.PartitionMetricListResult{
	// 	Value: []*armcosmos.PartitionMetric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Max RUs Per Second"),
	// 				Value: to.Ptr("Max RUs Per Second"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T23:58:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.MetricValue{
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:54:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:55:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:56:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:57:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT1M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 			PartitionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			PartitionKeyRangeID: to.Ptr("0"),
	// 	}},
	// }
}
Output:

type PartitionKeyRangeIDClientListMetricsOptions

type PartitionKeyRangeIDClientListMetricsOptions struct {
}

PartitionKeyRangeIDClientListMetricsOptions contains the optional parameters for the PartitionKeyRangeIDClient.NewListMetricsPager method.

type PartitionKeyRangeIDClientListMetricsResponse

type PartitionKeyRangeIDClientListMetricsResponse struct {
	// The response to a list partition metrics request.
	PartitionMetricListResult
}

PartitionKeyRangeIDClientListMetricsResponse contains the response from method PartitionKeyRangeIDClient.NewListMetricsPager.

type PartitionKeyRangeIDRegionClient

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

PartitionKeyRangeIDRegionClient contains the methods for the PartitionKeyRangeIDRegion group. Don't use this type directly, use NewPartitionKeyRangeIDRegionClient() instead.

func NewPartitionKeyRangeIDRegionClient

func NewPartitionKeyRangeIDRegionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PartitionKeyRangeIDRegionClient, error)

NewPartitionKeyRangeIDRegionClient creates a new instance of PartitionKeyRangeIDRegionClient with the specified values.

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

func (*PartitionKeyRangeIDRegionClient) NewListMetricsPager

func (client *PartitionKeyRangeIDRegionClient) NewListMetricsPager(resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string, options *PartitionKeyRangeIDRegionClientListMetricsOptions) *runtime.Pager[PartitionKeyRangeIDRegionClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given partition key range id and region.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • region - Cosmos DB region, with spaces between words and each word capitalized.
  • databaseRid - Cosmos DB database rid.
  • collectionRid - Cosmos DB collection rid.
  • partitionKeyRangeID - Partition Key Range Id for which to get data.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - PartitionKeyRangeIDRegionClientListMetricsOptions contains the optional parameters for the PartitionKeyRangeIDRegionClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewPartitionKeyRangeIDRegionClient().NewListMetricsPager("rg1", "ddb1", "West US", "databaseRid", "collectionRid", "0", "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", 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.PartitionMetricListResult = armcosmos.PartitionMetricListResult{
	// 	Value: []*armcosmos.PartitionMetric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Max RUs Per Second"),
	// 				Value: to.Ptr("Max RUs Per Second"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T23:58:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.MetricValue{
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:54:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:55:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:56:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:57:55.278Z"); return t}()),
	// 				},
	// 				{
	// 					Maximum: to.Ptr[float64](5),
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:58:55.278Z"); return t}()),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT1M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeCount),
	// 			PartitionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			PartitionKeyRangeID: to.Ptr("0"),
	// 	}},
	// }
}
Output:

type PartitionKeyRangeIDRegionClientListMetricsOptions

type PartitionKeyRangeIDRegionClientListMetricsOptions struct {
}

PartitionKeyRangeIDRegionClientListMetricsOptions contains the optional parameters for the PartitionKeyRangeIDRegionClient.NewListMetricsPager method.

type PartitionKeyRangeIDRegionClientListMetricsResponse

type PartitionKeyRangeIDRegionClientListMetricsResponse struct {
	// The response to a list partition metrics request.
	PartitionMetricListResult
}

PartitionKeyRangeIDRegionClientListMetricsResponse contains the response from method PartitionKeyRangeIDRegionClient.NewListMetricsPager.

type PartitionKind

type PartitionKind string

PartitionKind - Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create

const (
	PartitionKindHash      PartitionKind = "Hash"
	PartitionKindMultiHash PartitionKind = "MultiHash"
	PartitionKindRange     PartitionKind = "Range"
)

func PossiblePartitionKindValues

func PossiblePartitionKindValues() []PartitionKind

PossiblePartitionKindValues returns the possible values for the PartitionKind const type.

type PartitionMetric

type PartitionMetric struct {
	// READ-ONLY; The end time for the metric (ISO-8601 format).
	EndTime *time.Time

	// READ-ONLY; The metric values for the specified time window and timestep.
	MetricValues []*MetricValue

	// READ-ONLY; The name information for the metric.
	Name *MetricName

	// READ-ONLY; The partition id (GUID identifier) of the metric values.
	PartitionID *string

	// READ-ONLY; The partition key range id (integer identifier) of the metric values.
	PartitionKeyRangeID *string

	// READ-ONLY; The start time for the metric (ISO-8601 format).
	StartTime *time.Time

	// READ-ONLY; The time grain to be used to summarize the metric values.
	TimeGrain *string

	// READ-ONLY; The unit of the metric.
	Unit *UnitType
}

PartitionMetric - The metric values for a single partition.

func (PartitionMetric) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PartitionMetric.

func (*PartitionMetric) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PartitionMetric.

type PartitionMetricListResult

type PartitionMetricListResult struct {
	// READ-ONLY; The list of partition-level metrics for the account.
	Value []*PartitionMetric
}

PartitionMetricListResult - The response to a list partition metrics request.

func (PartitionMetricListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PartitionMetricListResult.

func (*PartitionMetricListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PartitionMetricListResult.

type PartitionUsage

type PartitionUsage struct {
	// READ-ONLY; Current value for this metric
	CurrentValue *int64

	// READ-ONLY; Maximum value for this metric
	Limit *int64

	// READ-ONLY; The name information for the metric.
	Name *MetricName

	// READ-ONLY; The partition id (GUID identifier) of the usages.
	PartitionID *string

	// READ-ONLY; The partition key range id (integer identifier) of the usages.
	PartitionKeyRangeID *string

	// READ-ONLY; The quota period used to summarize the usage values.
	QuotaPeriod *string

	// READ-ONLY; The unit of the metric.
	Unit *UnitType
}

PartitionUsage - The partition level usage data for a usage request.

func (PartitionUsage) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PartitionUsage.

func (*PartitionUsage) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PartitionUsage.

type PartitionUsagesResult

type PartitionUsagesResult struct {
	// READ-ONLY; The list of partition-level usages for the database. A usage is a point in time metric
	Value []*PartitionUsage
}

PartitionUsagesResult - The response to a list partition level usage request.

func (PartitionUsagesResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PartitionUsagesResult.

func (*PartitionUsagesResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PartitionUsagesResult.

type PercentileClient

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

PercentileClient contains the methods for the Percentile group. Don't use this type directly, use NewPercentileClient() instead.

func NewPercentileClient

func NewPercentileClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PercentileClient, error)

NewPercentileClient creates a new instance of PercentileClient with the specified values.

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

func (*PercentileClient) NewListMetricsPager

func (client *PercentileClient) NewListMetricsPager(resourceGroupName string, accountName string, filter string, options *PercentileClientListMetricsOptions) *runtime.Pager[PercentileClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - PercentileClientListMetricsOptions contains the optional parameters for the PercentileClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPercentileGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewPercentileClient().NewListMetricsPager("rg1", "ddb1", "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", 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.PercentileMetricListResult = armcosmos.PercentileMetricListResult{
	// 	Value: []*armcosmos.PercentileMetric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"),
	// 				Value: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.PercentileMetricValue{
	// 				{
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 					P10: to.Ptr[float64](1.11),
	// 					P25: to.Ptr[float64](2.5),
	// 					P50: to.Ptr[float64](4.34),
	// 					P75: to.Ptr[float64](5.2),
	// 					P90: to.Ptr[float64](6.77),
	// 					P95: to.Ptr[float64](7.1),
	// 					P99: to.Ptr[float64](8.3),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT5M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeMilliseconds),
	// 		},
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-West US"),
	// 				Value: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-West US"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.PercentileMetricValue{
	// 				{
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 					P10: to.Ptr[float64](1.11),
	// 					P25: to.Ptr[float64](2.5),
	// 					P50: to.Ptr[float64](4.34),
	// 					P75: to.Ptr[float64](5.2),
	// 					P90: to.Ptr[float64](6.77),
	// 					P95: to.Ptr[float64](7.1),
	// 					P99: to.Ptr[float64](8.3),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT5M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeMilliseconds),
	// 	}},
	// }
}
Output:

type PercentileClientListMetricsOptions

type PercentileClientListMetricsOptions struct {
}

PercentileClientListMetricsOptions contains the optional parameters for the PercentileClient.NewListMetricsPager method.

type PercentileClientListMetricsResponse

type PercentileClientListMetricsResponse struct {
	// The response to a list percentile metrics request.
	PercentileMetricListResult
}

PercentileClientListMetricsResponse contains the response from method PercentileClient.NewListMetricsPager.

type PercentileMetric

type PercentileMetric struct {
	// READ-ONLY; The end time for the metric (ISO-8601 format).
	EndTime *time.Time

	// READ-ONLY; The percentile metric values for the specified time window and timestep.
	MetricValues []*PercentileMetricValue

	// READ-ONLY; The name information for the metric.
	Name *MetricName

	// READ-ONLY; The start time for the metric (ISO-8601 format).
	StartTime *time.Time

	// READ-ONLY; The time grain to be used to summarize the metric values.
	TimeGrain *string

	// READ-ONLY; The unit of the metric.
	Unit *UnitType
}

PercentileMetric - Percentile Metric data

func (PercentileMetric) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PercentileMetric.

func (*PercentileMetric) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PercentileMetric.

type PercentileMetricListResult

type PercentileMetricListResult struct {
	// READ-ONLY; The list of percentile metrics for the account.
	Value []*PercentileMetric
}

PercentileMetricListResult - The response to a list percentile metrics request.

func (PercentileMetricListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PercentileMetricListResult.

func (*PercentileMetricListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PercentileMetricListResult.

type PercentileMetricValue

type PercentileMetricValue struct {
	// READ-ONLY; The average value of the metric.
	Average *float64

	// READ-ONLY; The number of values for the metric.
	Count *int32

	// READ-ONLY; The max value of the metric.
	Maximum *float64

	// READ-ONLY; The min value of the metric.
	Minimum *float64

	// READ-ONLY; The 10th percentile value for the metric.
	P10 *float64

	// READ-ONLY; The 25th percentile value for the metric.
	P25 *float64

	// READ-ONLY; The 50th percentile value for the metric.
	P50 *float64

	// READ-ONLY; The 75th percentile value for the metric.
	P75 *float64

	// READ-ONLY; The 90th percentile value for the metric.
	P90 *float64

	// READ-ONLY; The 95th percentile value for the metric.
	P95 *float64

	// READ-ONLY; The 99th percentile value for the metric.
	P99 *float64

	// READ-ONLY; The metric timestamp (ISO-8601 format).
	Timestamp *time.Time

	// READ-ONLY; The total value of the metric.
	Total *float64
}

PercentileMetricValue - Represents percentile metrics values.

func (PercentileMetricValue) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PercentileMetricValue.

func (*PercentileMetricValue) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PercentileMetricValue.

type PercentileSourceTargetClient

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

PercentileSourceTargetClient contains the methods for the PercentileSourceTarget group. Don't use this type directly, use NewPercentileSourceTargetClient() instead.

func NewPercentileSourceTargetClient

func NewPercentileSourceTargetClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PercentileSourceTargetClient, error)

NewPercentileSourceTargetClient creates a new instance of PercentileSourceTargetClient with the specified values.

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

func (*PercentileSourceTargetClient) NewListMetricsPager

func (client *PercentileSourceTargetClient) NewListMetricsPager(resourceGroupName string, accountName string, sourceRegion string, targetRegion string, filter string, options *PercentileSourceTargetClientListMetricsOptions) *runtime.Pager[PercentileSourceTargetClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • sourceRegion - Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized.
  • targetRegion - Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - PercentileSourceTargetClientListMetricsOptions contains the optional parameters for the PercentileSourceTargetClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewPercentileSourceTargetClient().NewListMetricsPager("rg1", "ddb1", "West Central US", "East US", "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", 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.PercentileMetricListResult = armcosmos.PercentileMetricListResult{
	// 	Value: []*armcosmos.PercentileMetric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"),
	// 				Value: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.PercentileMetricValue{
	// 				{
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 					P10: to.Ptr[float64](1.11),
	// 					P25: to.Ptr[float64](2.5),
	// 					P50: to.Ptr[float64](4.34),
	// 					P75: to.Ptr[float64](5.2),
	// 					P90: to.Ptr[float64](6.77),
	// 					P95: to.Ptr[float64](7.1),
	// 					P99: to.Ptr[float64](8.3),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT5M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeMilliseconds),
	// 	}},
	// }
}
Output:

type PercentileSourceTargetClientListMetricsOptions

type PercentileSourceTargetClientListMetricsOptions struct {
}

PercentileSourceTargetClientListMetricsOptions contains the optional parameters for the PercentileSourceTargetClient.NewListMetricsPager method.

type PercentileSourceTargetClientListMetricsResponse

type PercentileSourceTargetClientListMetricsResponse struct {
	// The response to a list percentile metrics request.
	PercentileMetricListResult
}

PercentileSourceTargetClientListMetricsResponse contains the response from method PercentileSourceTargetClient.NewListMetricsPager.

type PercentileTargetClient

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

PercentileTargetClient contains the methods for the PercentileTarget group. Don't use this type directly, use NewPercentileTargetClient() instead.

func NewPercentileTargetClient

func NewPercentileTargetClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PercentileTargetClient, error)

NewPercentileTargetClient creates a new instance of PercentileTargetClient with the specified values.

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

func (*PercentileTargetClient) NewListMetricsPager

func (client *PercentileTargetClient) NewListMetricsPager(resourceGroupName string, accountName string, targetRegion string, filter string, options *PercentileTargetClientListMetricsOptions) *runtime.Pager[PercentileTargetClientListMetricsResponse]

NewListMetricsPager - Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • targetRegion - Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized.
  • filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • options - PercentileTargetClientListMetricsOptions contains the optional parameters for the PercentileTargetClient.NewListMetricsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPercentileTargetGetMetrics.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewPercentileTargetClient().NewListMetricsPager("rg1", "ddb1", "East US", "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", 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.PercentileMetricListResult = armcosmos.PercentileMetricListResult{
	// 	Value: []*armcosmos.PercentileMetric{
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"),
	// 				Value: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-East US"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.PercentileMetricValue{
	// 				{
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 					P10: to.Ptr[float64](1.11),
	// 					P25: to.Ptr[float64](2.5),
	// 					P50: to.Ptr[float64](4.34),
	// 					P75: to.Ptr[float64](5.2),
	// 					P90: to.Ptr[float64](6.77),
	// 					P95: to.Ptr[float64](7.1),
	// 					P99: to.Ptr[float64](8.3),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT5M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeMilliseconds),
	// 		},
	// 		{
	// 			Name: &armcosmos.MetricName{
	// 				LocalizedValue: to.Ptr("Probabilistic Bounded Staleness-S-West Central US-T-West US"),
	// 				Value: to.Ptr("Probabilistic Bounded Staleness-S-West US-T-East US"),
	// 			},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-20T00:13:55.278Z"); return t}()),
	// 			MetricValues: []*armcosmos.PercentileMetricValue{
	// 				{
	// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 					P10: to.Ptr[float64](1.11),
	// 					P25: to.Ptr[float64](2.5),
	// 					P50: to.Ptr[float64](4.34),
	// 					P75: to.Ptr[float64](5.2),
	// 					P90: to.Ptr[float64](6.77),
	// 					P95: to.Ptr[float64](7.1),
	// 					P99: to.Ptr[float64](8.3),
	// 			}},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-19T23:53:55.278Z"); return t}()),
	// 			TimeGrain: to.Ptr("PT5M"),
	// 			Unit: to.Ptr(armcosmos.UnitTypeMilliseconds),
	// 	}},
	// }
}
Output:

type PercentileTargetClientListMetricsOptions

type PercentileTargetClientListMetricsOptions struct {
}

PercentileTargetClientListMetricsOptions contains the optional parameters for the PercentileTargetClient.NewListMetricsPager method.

type PercentileTargetClientListMetricsResponse

type PercentileTargetClientListMetricsResponse struct {
	// The response to a list percentile metrics request.
	PercentileMetricListResult
}

PercentileTargetClientListMetricsResponse contains the response from method PercentileTargetClient.NewListMetricsPager.

type PeriodicModeBackupPolicy

type PeriodicModeBackupPolicy struct {
	// REQUIRED; Describes the mode of backups.
	Type *BackupPolicyType

	// The object representing the state of the migration between the backup policies.
	MigrationState *BackupPolicyMigrationState

	// Configuration values for periodic mode backup
	PeriodicModeProperties *PeriodicModeProperties
}

PeriodicModeBackupPolicy - The object representing periodic mode backup policy.

func (*PeriodicModeBackupPolicy) GetBackupPolicy

func (p *PeriodicModeBackupPolicy) GetBackupPolicy() *BackupPolicy

GetBackupPolicy implements the BackupPolicyClassification interface for type PeriodicModeBackupPolicy.

func (PeriodicModeBackupPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PeriodicModeBackupPolicy.

func (*PeriodicModeBackupPolicy) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicModeBackupPolicy.

type PeriodicModeProperties

type PeriodicModeProperties struct {
	// An integer representing the interval in minutes between two backups
	BackupIntervalInMinutes *int32

	// An integer representing the time (in hours) that each backup is retained
	BackupRetentionIntervalInHours *int32

	// Enum to indicate type of backup residency
	BackupStorageRedundancy *BackupStorageRedundancy
}

PeriodicModeProperties - Configuration values for periodic mode backup

func (PeriodicModeProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PeriodicModeProperties.

func (*PeriodicModeProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicModeProperties.

type Permission

type Permission struct {
	// An array of data actions that are allowed.
	DataActions []*string

	// An array of data actions that are denied.
	NotDataActions []*string
}

Permission - The set of data plane operations permitted through this Role Definition.

func (Permission) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Permission.

func (*Permission) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Permission.

type PhysicalPartitionID

type PhysicalPartitionID struct {
	// REQUIRED; Id of a physical partition
	ID *string
}

PhysicalPartitionID - PhysicalPartitionId object

func (PhysicalPartitionID) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionID.

func (*PhysicalPartitionID) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionID.

type PhysicalPartitionStorageInfo

type PhysicalPartitionStorageInfo struct {
	// READ-ONLY; The unique identifier of the partition.
	ID *string

	// READ-ONLY; The storage in KB for the physical partition.
	StorageInKB *float64
}

PhysicalPartitionStorageInfo - The storage of a physical partition

func (PhysicalPartitionStorageInfo) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionStorageInfo.

func (*PhysicalPartitionStorageInfo) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionStorageInfo.

type PhysicalPartitionStorageInfoCollection

type PhysicalPartitionStorageInfoCollection struct {
	// READ-ONLY; List of physical partitions and their properties.
	PhysicalPartitionStorageInfoCollection []*PhysicalPartitionStorageInfo
}

PhysicalPartitionStorageInfoCollection - List of physical partitions and their properties returned by a merge operation.

func (PhysicalPartitionStorageInfoCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionStorageInfoCollection.

func (*PhysicalPartitionStorageInfoCollection) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionStorageInfoCollection.

type PhysicalPartitionThroughputInfoProperties

type PhysicalPartitionThroughputInfoProperties struct {
	// Array of physical partition throughput info objects
	PhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource
}

PhysicalPartitionThroughputInfoProperties - The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object

func (PhysicalPartitionThroughputInfoProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoProperties.

func (*PhysicalPartitionThroughputInfoProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionThroughputInfoProperties.

type PhysicalPartitionThroughputInfoResource

type PhysicalPartitionThroughputInfoResource struct {
	// REQUIRED; Id of a physical partition
	ID *string

	// Throughput of a physical partition
	Throughput *float64
}

PhysicalPartitionThroughputInfoResource - PhysicalPartitionThroughputInfo object

func (PhysicalPartitionThroughputInfoResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoResource.

func (*PhysicalPartitionThroughputInfoResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionThroughputInfoResource.

type PhysicalPartitionThroughputInfoResult

type PhysicalPartitionThroughputInfoResult struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object
	Properties *PhysicalPartitionThroughputInfoResultProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

PhysicalPartitionThroughputInfoResult - An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.

func (PhysicalPartitionThroughputInfoResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoResult.

func (*PhysicalPartitionThroughputInfoResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionThroughputInfoResult.

type PhysicalPartitionThroughputInfoResultProperties

type PhysicalPartitionThroughputInfoResultProperties struct {
	// properties of physical partition throughput info
	Resource *PhysicalPartitionThroughputInfoResultPropertiesResource
}

PhysicalPartitionThroughputInfoResultProperties - The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object

func (PhysicalPartitionThroughputInfoResultProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoResultProperties.

func (*PhysicalPartitionThroughputInfoResultProperties) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionThroughputInfoResultProperties.

type PhysicalPartitionThroughputInfoResultPropertiesResource

type PhysicalPartitionThroughputInfoResultPropertiesResource struct {
	// Array of physical partition throughput info objects
	PhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource
}

PhysicalPartitionThroughputInfoResultPropertiesResource - properties of physical partition throughput info

func (PhysicalPartitionThroughputInfoResultPropertiesResource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoResultPropertiesResource.

func (*PhysicalPartitionThroughputInfoResultPropertiesResource) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionThroughputInfoResultPropertiesResource.

type PrimaryAggregationType

type PrimaryAggregationType string

PrimaryAggregationType - The primary aggregation type of the metric.

const (
	PrimaryAggregationTypeAverage PrimaryAggregationType = "Average"
	PrimaryAggregationTypeLast    PrimaryAggregationType = "Last"
	PrimaryAggregationTypeMaximum PrimaryAggregationType = "Maximum"
	PrimaryAggregationTypeMinimum PrimaryAggregationType = "Minimum"
	PrimaryAggregationTypeNone    PrimaryAggregationType = "None"
	PrimaryAggregationTypeTotal   PrimaryAggregationType = "Total"
)

func PossiblePrimaryAggregationTypeValues

func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType

PossiblePrimaryAggregationTypeValues returns the possible values for the PrimaryAggregationType const type.

type PrivateEndpointConnection

type PrivateEndpointConnection struct {
	// Resource properties.
	Properties *PrivateEndpointConnectionProperties

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

PrivateEndpointConnection - A private endpoint connection

func (PrivateEndpointConnection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.

func (*PrivateEndpointConnection) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.

type PrivateEndpointConnectionListResult

type PrivateEndpointConnectionListResult struct {
	// Array of private endpoint connections
	Value []*PrivateEndpointConnection
}

PrivateEndpointConnectionListResult - A list of private endpoint connections

func (PrivateEndpointConnectionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.

func (*PrivateEndpointConnectionListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.

type PrivateEndpointConnectionProperties

type PrivateEndpointConnectionProperties struct {
	// Group id of the private endpoint.
	GroupID *string

	// Private endpoint which the connection belongs to.
	PrivateEndpoint *PrivateEndpointProperty

	// Connection State of the Private Endpoint Connection.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty

	// Provisioning state of the private endpoint.
	ProvisioningState *string
}

PrivateEndpointConnectionProperties - Properties of a private endpoint connection.

func (PrivateEndpointConnectionProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.

func (*PrivateEndpointConnectionProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.

type PrivateEndpointConnectionsClient

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

PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead.

func NewPrivateEndpointConnectionsClient

func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values.

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

func (*PrivateEndpointConnectionsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • privateEndpointConnectionName - The name of the private endpoint connection.
  • options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", "privateEndpointConnectionName", armcosmos.PrivateEndpointConnection{
	Properties: &armcosmos.PrivateEndpointConnectionProperties{
		PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{
			Description: to.Ptr("Approved by johndoe@contoso.com"),
			Status:      to.Ptr("Approved"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PrivateEndpointConnection = armcosmos.PrivateEndpointConnection{
// 	Name: to.Ptr("privateEndpointConnectionName"),
// 	Type: to.Ptr("Microsoft.DocumentDb/databaseAccounts/privateEndpointConnections"),
// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateEndpointConnections/privateEndpointConnectionName"),
// 	Properties: &armcosmos.PrivateEndpointConnectionProperties{
// 		GroupID: to.Ptr("Sql"),
// 		PrivateEndpoint: &armcosmos.PrivateEndpointProperty{
// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName"),
// 		},
// 		PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{
// 			Description: to.Ptr("Auto-approved"),
// 			ActionsRequired: to.Ptr("None"),
// 			Status: to.Ptr("Approved"),
// 		},
// 		ProvisioningState: to.Ptr("Succeeded"),
// 	},
// }
Output:

func (*PrivateEndpointConnectionsClient) BeginDelete

func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)

BeginDelete - Deletes a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • privateEndpointConnectionName - The name of the private endpoint connection.
  • options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "rg1", "ddb1", "privateEndpointConnectionName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*PrivateEndpointConnectionsClient) Get

func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)

Get - Gets a private endpoint connection. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • privateEndpointConnectionName - The name of the private endpoint connection.
  • options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "rg1", "ddb1", "privateEndpointConnectionName", 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.PrivateEndpointConnection = armcosmos.PrivateEndpointConnection{
// 	Name: to.Ptr("privateEndpointConnectionName"),
// 	Type: to.Ptr("Microsoft.DocumentDb/databaseAccounts/privateEndpointConnections"),
// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateEndpointConnections/privateEndpointConnectionName"),
// 	Properties: &armcosmos.PrivateEndpointConnectionProperties{
// 		GroupID: to.Ptr("Sql"),
// 		PrivateEndpoint: &armcosmos.PrivateEndpointProperty{
// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName"),
// 		},
// 		PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{
// 			Description: to.Ptr("Auto-approved"),
// 			ActionsRequired: to.Ptr("None"),
// 			Status: to.Ptr("Approved"),
// 		},
// 		ProvisioningState: to.Ptr("Succeeded"),
// 	},
// }
Output:

func (*PrivateEndpointConnectionsClient) NewListByDatabaseAccountPager

NewListByDatabaseAccountPager - List all private endpoint connections on a Cosmos DB account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - PrivateEndpointConnectionsClientListByDatabaseAccountOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByDatabaseAccountPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByDatabaseAccountPager("rg1", "ddb1", 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.PrivateEndpointConnectionListResult = armcosmos.PrivateEndpointConnectionListResult{
	// 	Value: []*armcosmos.PrivateEndpointConnection{
	// 		{
	// 			Name: to.Ptr("privateEndpointConnectionName"),
	// 			Type: to.Ptr("Microsoft.DocumentDb/databaseAccounts/privateEndpointConnections"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateEndpointConnections/privateEndpointConnectionName"),
	// 			Properties: &armcosmos.PrivateEndpointConnectionProperties{
	// 				GroupID: to.Ptr("Sql"),
	// 				PrivateEndpoint: &armcosmos.PrivateEndpointProperty{
	// 					ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName"),
	// 				},
	// 				PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{
	// 					Description: to.Ptr("Auto-approved"),
	// 					ActionsRequired: to.Ptr("None"),
	// 					Status: to.Ptr("Approved"),
	// 				},
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("privateEndpointConnectionName"),
	// 			Type: to.Ptr("Microsoft.DocumentDb/databaseAccounts/privateEndpointConnections"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateEndpointConnections/privateEndpointConnectionName2"),
	// 			Properties: &armcosmos.PrivateEndpointConnectionProperties{
	// 				GroupID: to.Ptr("Sql"),
	// 				PrivateEndpoint: &armcosmos.PrivateEndpointProperty{
	// 					ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName2"),
	// 				},
	// 				PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{
	// 					Description: to.Ptr("Auto-approved"),
	// 					ActionsRequired: to.Ptr("None"),
	// 					Status: to.Ptr("Approved"),
	// 				},
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 			},
	// 	}},
	// }
}
Output:

type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions

type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.

type PrivateEndpointConnectionsClientBeginDeleteOptions

type PrivateEndpointConnectionsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.

type PrivateEndpointConnectionsClientCreateOrUpdateResponse

type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct {
	// A private endpoint connection
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate.

type PrivateEndpointConnectionsClientDeleteResponse

type PrivateEndpointConnectionsClientDeleteResponse struct {
}

PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete.

type PrivateEndpointConnectionsClientGetOptions

type PrivateEndpointConnectionsClientGetOptions struct {
}

PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.

type PrivateEndpointConnectionsClientGetResponse

type PrivateEndpointConnectionsClientGetResponse struct {
	// A private endpoint connection
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.

type PrivateEndpointConnectionsClientListByDatabaseAccountOptions

type PrivateEndpointConnectionsClientListByDatabaseAccountOptions struct {
}

PrivateEndpointConnectionsClientListByDatabaseAccountOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByDatabaseAccountPager method.

type PrivateEndpointConnectionsClientListByDatabaseAccountResponse

type PrivateEndpointConnectionsClientListByDatabaseAccountResponse struct {
	// A list of private endpoint connections
	PrivateEndpointConnectionListResult
}

PrivateEndpointConnectionsClientListByDatabaseAccountResponse contains the response from method PrivateEndpointConnectionsClient.NewListByDatabaseAccountPager.

type PrivateEndpointProperty

type PrivateEndpointProperty struct {
	// Resource id of the private endpoint.
	ID *string
}

PrivateEndpointProperty - Private endpoint which the connection belongs to.

func (PrivateEndpointProperty) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperty.

func (*PrivateEndpointProperty) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperty.

type PrivateLinkResource

type PrivateLinkResource struct {
	// Resource properties.
	Properties *PrivateLinkResourceProperties

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

PrivateLinkResource - A private link resource

func (PrivateLinkResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.

func (*PrivateLinkResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.

type PrivateLinkResourceListResult

type PrivateLinkResourceListResult struct {
	// Array of private link resources
	Value []*PrivateLinkResource
}

PrivateLinkResourceListResult - A list of private link resources

func (PrivateLinkResourceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.

func (*PrivateLinkResourceListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.

type PrivateLinkResourceProperties

type PrivateLinkResourceProperties struct {
	// READ-ONLY; The private link resource group id.
	GroupID *string

	// READ-ONLY; The private link resource required member names.
	RequiredMembers []*string

	// READ-ONLY; The private link resource required zone names.
	RequiredZoneNames []*string
}

PrivateLinkResourceProperties - Properties of a private link resource.

func (PrivateLinkResourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.

func (*PrivateLinkResourceProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.

type PrivateLinkResourcesClient

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

PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. Don't use this type directly, use NewPrivateLinkResourcesClient() instead.

func NewPrivateLinkResourcesClient

func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error)

NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values.

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

func (*PrivateLinkResourcesClient) Get

Get - Gets the private link resources that need to be created for a Cosmos DB account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • groupName - The name of the private link resource.
  • options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateLinkResourceGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "rg1", "ddb1", "sql", 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.PrivateLinkResource = armcosmos.PrivateLinkResource{
// 	Name: to.Ptr("sql"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/privateLinkResources"),
// 	ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateLinkResources/sql"),
// 	Properties: &armcosmos.PrivateLinkResourceProperties{
// 		GroupID: to.Ptr("sql"),
// 		RequiredMembers: []*string{
// 			to.Ptr("ddb1"),
// 			to.Ptr("ddb1-westus")},
// 			RequiredZoneNames: []*string{
// 				to.Ptr("privatelink.documents.azure.net")},
// 			},
// 		}
Output:

func (*PrivateLinkResourcesClient) NewListByDatabaseAccountPager

NewListByDatabaseAccountPager - Gets the private link resources that need to be created for a Cosmos DB account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - PrivateLinkResourcesClientListByDatabaseAccountOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByDatabaseAccountPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBPrivateLinkResourceListGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewPrivateLinkResourcesClient().NewListByDatabaseAccountPager("rg1", "ddb1", 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.PrivateLinkResourceListResult = armcosmos.PrivateLinkResourceListResult{
	// 	Value: []*armcosmos.PrivateLinkResource{
	// 		{
	// 			Name: to.Ptr("sql"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/privateLinkResources"),
	// 			ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DocumentDb/databaseAccounts/ddb1/privateLinkResources/sql"),
	// 			Properties: &armcosmos.PrivateLinkResourceProperties{
	// 				GroupID: to.Ptr("sql"),
	// 				RequiredMembers: []*string{
	// 					to.Ptr("ddb1"),
	// 					to.Ptr("ddb1-westus")},
	// 					RequiredZoneNames: []*string{
	// 						to.Ptr("privatelink.documents.azure.net")},
	// 					},
	// 			}},
	// 		}
}
Output:

type PrivateLinkResourcesClientGetOptions

type PrivateLinkResourcesClientGetOptions struct {
}

PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method.

type PrivateLinkResourcesClientGetResponse

type PrivateLinkResourcesClientGetResponse struct {
	// A private link resource
	PrivateLinkResource
}

PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get.

type PrivateLinkResourcesClientListByDatabaseAccountOptions

type PrivateLinkResourcesClientListByDatabaseAccountOptions struct {
}

PrivateLinkResourcesClientListByDatabaseAccountOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByDatabaseAccountPager method.

type PrivateLinkResourcesClientListByDatabaseAccountResponse

type PrivateLinkResourcesClientListByDatabaseAccountResponse struct {
	// A list of private link resources
	PrivateLinkResourceListResult
}

PrivateLinkResourcesClientListByDatabaseAccountResponse contains the response from method PrivateLinkResourcesClient.NewListByDatabaseAccountPager.

type PrivateLinkServiceConnectionStateProperty

type PrivateLinkServiceConnectionStateProperty struct {
	// The private link service connection description.
	Description *string

	// The private link service connection status.
	Status *string

	// READ-ONLY; Any action that is required beyond basic workflow (approve/ reject/ disconnect)
	ActionsRequired *string
}

PrivateLinkServiceConnectionStateProperty - Connection State of the Private Endpoint Connection.

func (PrivateLinkServiceConnectionStateProperty) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionStateProperty.

func (*PrivateLinkServiceConnectionStateProperty) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionStateProperty.

type Privilege

type Privilege struct {
	// An array of actions that are allowed.
	Actions []*string

	// An Azure Cosmos DB Mongo DB Resource.
	Resource *PrivilegeResource
}

Privilege - The set of data plane operations permitted through this Role Definition.

func (Privilege) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Privilege.

func (*Privilege) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Privilege.

type PrivilegeResource

type PrivilegeResource struct {
	// The collection name the role is applied.
	Collection *string

	// The database name the role is applied.
	Db *string
}

PrivilegeResource - An Azure Cosmos DB Mongo DB Resource.

func (PrivilegeResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivilegeResource.

func (*PrivilegeResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivilegeResource.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The provisioning state of the resource.

const (
	ProvisioningStateCanceled   ProvisioningState = "Canceled"
	ProvisioningStateDropping   ProvisioningState = "Dropping"
	ProvisioningStateFailed     ProvisioningState = "Failed"
	ProvisioningStateInProgress ProvisioningState = "InProgress"
	ProvisioningStateSucceeded  ProvisioningState = "Succeeded"
	ProvisioningStateUpdating   ProvisioningState = "Updating"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type ProxyResource

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

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

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

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

func (ProxyResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ProxyResource.

func (*ProxyResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.

type ProxyResourceAutoGenerated

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

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

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

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

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

func (ProxyResourceAutoGenerated) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ProxyResourceAutoGenerated.

func (*ProxyResourceAutoGenerated) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceAutoGenerated.

type PublicNetworkAccess

type PublicNetworkAccess string

PublicNetworkAccess - Whether requests from Public Network are allowed

const (
	PublicNetworkAccessDisabled           PublicNetworkAccess = "Disabled"
	PublicNetworkAccessEnabled            PublicNetworkAccess = "Enabled"
	PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter"
)

func PossiblePublicNetworkAccessValues

func PossiblePublicNetworkAccessValues() []PublicNetworkAccess

PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type.

type RedistributeThroughputParameters

type RedistributeThroughputParameters struct {
	// REQUIRED; Properties to redistribute throughput parameters object
	Properties *RedistributeThroughputProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RedistributeThroughputParameters - Cosmos DB redistribute throughput parameters object

func (RedistributeThroughputParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RedistributeThroughputParameters.

func (*RedistributeThroughputParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RedistributeThroughputParameters.

type RedistributeThroughputProperties

type RedistributeThroughputProperties struct {
	// REQUIRED; The standard JSON format of a resource throughput
	Resource *RedistributeThroughputPropertiesResource
}

RedistributeThroughputProperties - Properties to redistribute throughput for Azure Cosmos DB resource.

func (RedistributeThroughputProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RedistributeThroughputProperties.

func (*RedistributeThroughputProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RedistributeThroughputProperties.

type RedistributeThroughputPropertiesResource

type RedistributeThroughputPropertiesResource struct {
	// REQUIRED; Array of PhysicalPartitionThroughputInfoResource objects.
	SourcePhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource

	// REQUIRED; Array of PhysicalPartitionThroughputInfoResource objects.
	TargetPhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource

	// REQUIRED; ThroughputPolicy to apply for throughput redistribution
	ThroughputPolicy *ThroughputPolicyType
}

RedistributeThroughputPropertiesResource - Resource to redistribute throughput for Azure Cosmos DB resource

func (RedistributeThroughputPropertiesResource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RedistributeThroughputPropertiesResource.

func (*RedistributeThroughputPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RedistributeThroughputPropertiesResource.

type RegionForOnlineOffline

type RegionForOnlineOffline struct {
	// REQUIRED; Cosmos DB region, with spaces between words and each word capitalized.
	Region *string
}

RegionForOnlineOffline - Cosmos DB region to online or offline.

func (RegionForOnlineOffline) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RegionForOnlineOffline.

func (*RegionForOnlineOffline) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RegionForOnlineOffline.

type RegionalServiceResource

type RegionalServiceResource struct {
	// READ-ONLY; The location name.
	Location *string

	// READ-ONLY; The regional service name.
	Name *string

	// READ-ONLY; Describes the status of a service.
	Status *ServiceStatus
}

RegionalServiceResource - Resource for a regional service location.

func (RegionalServiceResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RegionalServiceResource.

func (*RegionalServiceResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RegionalServiceResource.

type Resource

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

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

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

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

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourceAutoGenerated

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

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

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

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

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

func (ResourceAutoGenerated) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated.

func (*ResourceAutoGenerated) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated.

type ResourceIdentityType

type ResourceIdentityType string

ResourceIdentityType - The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.

const (
	ResourceIdentityTypeNone                       ResourceIdentityType = "None"
	ResourceIdentityTypeSystemAssigned             ResourceIdentityType = "SystemAssigned"
	ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned,UserAssigned"
	ResourceIdentityTypeUserAssigned               ResourceIdentityType = "UserAssigned"
)

func PossibleResourceIdentityTypeValues

func PossibleResourceIdentityTypeValues() []ResourceIdentityType

PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type.

type ResourceRestoreParameters

type ResourceRestoreParameters struct {
	// The id of the restorable database account from which the restore has to be initiated. For example:
	// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
	RestoreSource *string

	// Time to which the account has to be restored (ISO-8601 format).
	RestoreTimestampInUTC *time.Time

	// Specifies whether the restored account will have Time-To-Live disabled upon the successful restore.
	RestoreWithTTLDisabled *bool
}

ResourceRestoreParameters - Parameters to indicate the information about the restore.

func (ResourceRestoreParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceRestoreParameters.

func (*ResourceRestoreParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRestoreParameters.

type RestorableDatabaseAccountGetResult

type RestorableDatabaseAccountGetResult struct {
	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of a restorable database account.
	Properties *RestorableDatabaseAccountProperties

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableDatabaseAccountGetResult - A Azure Cosmos DB restorable database account.

func (RestorableDatabaseAccountGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableDatabaseAccountGetResult.

func (*RestorableDatabaseAccountGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDatabaseAccountGetResult.

type RestorableDatabaseAccountProperties

type RestorableDatabaseAccountProperties struct {
	// The name of the global database account
	AccountName *string

	// The creation time of the restorable database account (ISO-8601 format).
	CreationTime *time.Time

	// The time at which the restorable database account has been deleted (ISO-8601 format).
	DeletionTime *time.Time

	// The least recent time at which the database account can be restored to (ISO-8601 format).
	OldestRestorableTime *time.Time

	// READ-ONLY; The API type of the restorable database account.
	APIType *APIType

	// READ-ONLY; List of regions where the of the database account can be restored from.
	RestorableLocations []*RestorableLocationResource
}

RestorableDatabaseAccountProperties - The properties of a restorable database account.

func (RestorableDatabaseAccountProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableDatabaseAccountProperties.

func (*RestorableDatabaseAccountProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDatabaseAccountProperties.

type RestorableDatabaseAccountsClient

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

RestorableDatabaseAccountsClient contains the methods for the RestorableDatabaseAccounts group. Don't use this type directly, use NewRestorableDatabaseAccountsClient() instead.

func NewRestorableDatabaseAccountsClient

func NewRestorableDatabaseAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableDatabaseAccountsClient, error)

NewRestorableDatabaseAccountsClient creates a new instance of RestorableDatabaseAccountsClient with the specified values.

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

func (*RestorableDatabaseAccountsClient) GetByLocation

GetByLocation - Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableDatabaseAccountsClientGetByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.GetByLocation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewRestorableDatabaseAccountsClient().GetByLocation(ctx, "West US", "d9b26648-2f53-4541-b3d8-3044f4f9810d", 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.RestorableDatabaseAccountGetResult = armcosmos.RestorableDatabaseAccountGetResult{
// 	Name: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"),
// 	Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts"),
// 	ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/West US/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d"),
// 	Location: to.Ptr("West US"),
// 	Properties: &armcosmos.RestorableDatabaseAccountProperties{
// 		AccountName: to.Ptr("ddb1"),
// 		APIType: to.Ptr(armcosmos.APITypeSQL),
// 		CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-11T21:56:15.000Z"); return t}()),
// 		DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()),
// 		OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-01T22:05:09.000Z"); return t}()),
// 		RestorableLocations: []*armcosmos.RestorableLocationResource{
// 			{
// 				CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()),
// 				DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:35.000Z"); return t}()),
// 				LocationName: to.Ptr("South Central US"),
// 				RegionalDatabaseAccountInstanceID: to.Ptr("d7a01f78-606f-45c6-9dac-0df32f433bb5"),
// 			},
// 			{
// 				CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()),
// 				LocationName: to.Ptr("West US"),
// 				RegionalDatabaseAccountInstanceID: to.Ptr("fdb43d84-1572-4697-b6e7-2bcda0c51b2c"),
// 		}},
// 	},
// }
Output:

func (*RestorableDatabaseAccountsClient) NewListByLocationPager

NewListByLocationPager - Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission.

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • options - RestorableDatabaseAccountsClientListByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.NewListByLocationPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableDatabaseAccountList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableDatabaseAccountsClient().NewListByLocationPager("West US", 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.RestorableDatabaseAccountsListResult = armcosmos.RestorableDatabaseAccountsListResult{
	// 	Value: []*armcosmos.RestorableDatabaseAccountGetResult{
	// 		{
	// 			Name: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/West US/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d"),
	// 			Location: to.Ptr("West US"),
	// 			Properties: &armcosmos.RestorableDatabaseAccountProperties{
	// 				AccountName: to.Ptr("ddb1"),
	// 				APIType: to.Ptr(armcosmos.APITypeSQL),
	// 				CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-11T21:56:15.000Z"); return t}()),
	// 				DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()),
	// 				OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-01T22:05:09.000Z"); return t}()),
	// 				RestorableLocations: []*armcosmos.RestorableLocationResource{
	// 					{
	// 						CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()),
	// 						DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:35.000Z"); return t}()),
	// 						LocationName: to.Ptr("South Central US"),
	// 						RegionalDatabaseAccountInstanceID: to.Ptr("d7a01f78-606f-45c6-9dac-0df32f433bb5"),
	// 					},
	// 					{
	// 						CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()),
	// 						LocationName: to.Ptr("West US"),
	// 						RegionalDatabaseAccountInstanceID: to.Ptr("fdb43d84-1572-4697-b6e7-2bcda0c51b2c"),
	// 				}},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("4f9e6ace-ac7a-446c-98bc-194c502a06b4"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/West US/restorableDatabaseAccounts/4f9e6ace-ac7a-446c-98bc-194c502a06b4"),
	// 			Location: to.Ptr("West US"),
	// 			Properties: &armcosmos.RestorableDatabaseAccountProperties{
	// 				AccountName: to.Ptr("ddb2"),
	// 				APIType: to.Ptr(armcosmos.APITypeSQL),
	// 				CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T08:05:18.000Z"); return t}()),
	// 				OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-01T22:05:09.000Z"); return t}()),
	// 				RestorableLocations: []*armcosmos.RestorableLocationResource{
	// 					{
	// 						CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()),
	// 						DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:35.000Z"); return t}()),
	// 						LocationName: to.Ptr("South Central US"),
	// 						RegionalDatabaseAccountInstanceID: to.Ptr("d7a01f78-606f-45c6-9dac-0df32f433bb5"),
	// 					},
	// 					{
	// 						CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()),
	// 						LocationName: to.Ptr("West US"),
	// 						RegionalDatabaseAccountInstanceID: to.Ptr("fdb43d84-1572-4697-b6e7-2bcda0c51b2c"),
	// 				}},
	// 			},
	// 	}},
	// }
}
Output:

func (*RestorableDatabaseAccountsClient) NewListPager

NewListPager - Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission.

Generated from API version 2024-02-15-preview

  • options - RestorableDatabaseAccountsClientListOptions contains the optional parameters for the RestorableDatabaseAccountsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableDatabaseAccountsClient().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.RestorableDatabaseAccountsListResult = armcosmos.RestorableDatabaseAccountsListResult{
	// 	Value: []*armcosmos.RestorableDatabaseAccountGetResult{
	// 		{
	// 			Name: to.Ptr("d9b26648-2f53-4541-b3d8-3044f4f9810d"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/West US/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d"),
	// 			Location: to.Ptr("West US"),
	// 			Properties: &armcosmos.RestorableDatabaseAccountProperties{
	// 				AccountName: to.Ptr("ddb1"),
	// 				APIType: to.Ptr(armcosmos.APITypeSQL),
	// 				CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-11T21:56:15.000Z"); return t}()),
	// 				DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-12T22:05:09.000Z"); return t}()),
	// 				OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-01T22:05:09.000Z"); return t}()),
	// 				RestorableLocations: []*armcosmos.RestorableLocationResource{
	// 					{
	// 						CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()),
	// 						DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:35.000Z"); return t}()),
	// 						LocationName: to.Ptr("South Central US"),
	// 						RegionalDatabaseAccountInstanceID: to.Ptr("d7a01f78-606f-45c6-9dac-0df32f433bb5"),
	// 					},
	// 					{
	// 						CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()),
	// 						LocationName: to.Ptr("West US"),
	// 						RegionalDatabaseAccountInstanceID: to.Ptr("fdb43d84-1572-4697-b6e7-2bcda0c51b2c"),
	// 				}},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("4f9e6ace-ac7a-446c-98bc-194c502a06b4"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/West US/restorableDatabaseAccounts/4f9e6ace-ac7a-446c-98bc-194c502a06b4"),
	// 			Location: to.Ptr("East US"),
	// 			Properties: &armcosmos.RestorableDatabaseAccountProperties{
	// 				AccountName: to.Ptr("ddb2"),
	// 				APIType: to.Ptr(armcosmos.APITypeSQL),
	// 				CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T08:05:18.000Z"); return t}()),
	// 				OldestRestorableTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-01T22:05:09.000Z"); return t}()),
	// 				RestorableLocations: []*armcosmos.RestorableLocationResource{
	// 					{
	// 						CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()),
	// 						DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:35.000Z"); return t}()),
	// 						LocationName: to.Ptr("South Central US"),
	// 						RegionalDatabaseAccountInstanceID: to.Ptr("d7a01f78-606f-45c6-9dac-0df32f433bb5"),
	// 					},
	// 					{
	// 						CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-30T21:13:10.000Z"); return t}()),
	// 						LocationName: to.Ptr("West US"),
	// 						RegionalDatabaseAccountInstanceID: to.Ptr("fdb43d84-1572-4697-b6e7-2bcda0c51b2c"),
	// 				}},
	// 			},
	// 	}},
	// }
}
Output:

type RestorableDatabaseAccountsClientGetByLocationOptions

type RestorableDatabaseAccountsClientGetByLocationOptions struct {
}

RestorableDatabaseAccountsClientGetByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.GetByLocation method.

type RestorableDatabaseAccountsClientGetByLocationResponse

type RestorableDatabaseAccountsClientGetByLocationResponse struct {
	// A Azure Cosmos DB restorable database account.
	RestorableDatabaseAccountGetResult
}

RestorableDatabaseAccountsClientGetByLocationResponse contains the response from method RestorableDatabaseAccountsClient.GetByLocation.

type RestorableDatabaseAccountsClientListByLocationOptions

type RestorableDatabaseAccountsClientListByLocationOptions struct {
}

RestorableDatabaseAccountsClientListByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.NewListByLocationPager method.

type RestorableDatabaseAccountsClientListByLocationResponse

type RestorableDatabaseAccountsClientListByLocationResponse struct {
	// The List operation response, that contains the restorable database accounts and their properties.
	RestorableDatabaseAccountsListResult
}

RestorableDatabaseAccountsClientListByLocationResponse contains the response from method RestorableDatabaseAccountsClient.NewListByLocationPager.

type RestorableDatabaseAccountsClientListOptions

type RestorableDatabaseAccountsClientListOptions struct {
}

RestorableDatabaseAccountsClientListOptions contains the optional parameters for the RestorableDatabaseAccountsClient.NewListPager method.

type RestorableDatabaseAccountsClientListResponse

type RestorableDatabaseAccountsClientListResponse struct {
	// The List operation response, that contains the restorable database accounts and their properties.
	RestorableDatabaseAccountsListResult
}

RestorableDatabaseAccountsClientListResponse contains the response from method RestorableDatabaseAccountsClient.NewListPager.

type RestorableDatabaseAccountsListResult

type RestorableDatabaseAccountsListResult struct {
	// READ-ONLY; List of restorable database accounts and their properties.
	Value []*RestorableDatabaseAccountGetResult
}

RestorableDatabaseAccountsListResult - The List operation response, that contains the restorable database accounts and their properties.

func (RestorableDatabaseAccountsListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableDatabaseAccountsListResult.

func (*RestorableDatabaseAccountsListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDatabaseAccountsListResult.

type RestorableGremlinDatabaseGetResult

type RestorableGremlinDatabaseGetResult struct {
	// The properties of a Gremlin database event.
	Properties *RestorableGremlinDatabaseProperties

	// READ-ONLY; The unique resource Identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableGremlinDatabaseGetResult - An Azure Cosmos DB Gremlin database event

func (RestorableGremlinDatabaseGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableGremlinDatabaseGetResult.

func (*RestorableGremlinDatabaseGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinDatabaseGetResult.

type RestorableGremlinDatabaseProperties

type RestorableGremlinDatabaseProperties struct {
	// The resource of an Azure Cosmos DB Gremlin database event
	Resource *RestorableGremlinDatabasePropertiesResource
}

RestorableGremlinDatabaseProperties - The properties of an Azure Cosmos DB Gremlin database event

func (RestorableGremlinDatabaseProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableGremlinDatabaseProperties.

func (*RestorableGremlinDatabaseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinDatabaseProperties.

type RestorableGremlinDatabasePropertiesResource

type RestorableGremlinDatabasePropertiesResource struct {
	// READ-ONLY; A state of this database to identify if this database is restorable in same account.
	CanUndelete *string

	// READ-ONLY; The reason why this database can not be restored in same account.
	CanUndeleteReason *string

	// READ-ONLY; The time when this database event happened.
	EventTimestamp *string

	// READ-ONLY; The operation type of this database event.
	OperationType *OperationType

	// READ-ONLY; The name of this Gremlin database.
	OwnerID *string

	// READ-ONLY; The resource ID of this Gremlin database.
	OwnerResourceID *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string
}

RestorableGremlinDatabasePropertiesResource - The resource of an Azure Cosmos DB Gremlin database event

func (RestorableGremlinDatabasePropertiesResource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RestorableGremlinDatabasePropertiesResource.

func (*RestorableGremlinDatabasePropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinDatabasePropertiesResource.

type RestorableGremlinDatabasesClient

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

RestorableGremlinDatabasesClient contains the methods for the RestorableGremlinDatabases group. Don't use this type directly, use NewRestorableGremlinDatabasesClient() instead.

func NewRestorableGremlinDatabasesClient

func NewRestorableGremlinDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableGremlinDatabasesClient, error)

NewRestorableGremlinDatabasesClient creates a new instance of RestorableGremlinDatabasesClient with the specified values.

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

func (*RestorableGremlinDatabasesClient) NewListPager

NewListPager - Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableGremlinDatabasesClientListOptions contains the optional parameters for the RestorableGremlinDatabasesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableGremlinDatabaseList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableGremlinDatabasesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", 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.RestorableGremlinDatabasesListResult = armcosmos.RestorableGremlinDatabasesListResult{
	// 	Value: []*armcosmos.RestorableGremlinDatabaseGetResult{
	// 		{
	// 			Name: to.Ptr("59c21367-b98b-4a8e-abb7-b6f46600decc"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinDatabases"),
	// 			ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/36f09704-6be3-4f33-aa05-17b73e504c75/restorableGremlinDatabases/59c21367-b98b-4a8e-abb7-b6f46600decc"),
	// 			Properties: &armcosmos.RestorableGremlinDatabaseProperties{
	// 				Resource: &armcosmos.RestorableGremlinDatabasePropertiesResource{
	// 					Rid: to.Ptr("DLB14gAAAA=="),
	// 					CanUndelete: to.Ptr("invalid"),
	// 					EventTimestamp: to.Ptr("2020-09-02T19:45:03Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeCreate),
	// 					OwnerID: to.Ptr("Database1"),
	// 					OwnerResourceID: to.Ptr("PD5DALigDgw="),
	// 				},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("8456cb17-cdb0-4c6a-8db8-d0ff3f886257"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinDatabases"),
	// 			ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinDatabases/8456cb17-cdb0-4c6a-8db8-d0ff3f886257"),
	// 			Properties: &armcosmos.RestorableGremlinDatabaseProperties{
	// 				Resource: &armcosmos.RestorableGremlinDatabasePropertiesResource{
	// 					Rid: to.Ptr("ESXNLAAAAA=="),
	// 					CanUndelete: to.Ptr("notRestorable"),
	// 					CanUndeleteReason: to.Ptr("Database already exists. Only deleted resources can be restored within same account."),
	// 					EventTimestamp: to.Ptr("2020-09-02T19:53:42Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeDelete),
	// 					OwnerID: to.Ptr("Database1"),
	// 					OwnerResourceID: to.Ptr("PD5DALigDgw="),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type RestorableGremlinDatabasesClientListOptions

type RestorableGremlinDatabasesClientListOptions struct {
}

RestorableGremlinDatabasesClientListOptions contains the optional parameters for the RestorableGremlinDatabasesClient.NewListPager method.

type RestorableGremlinDatabasesClientListResponse

type RestorableGremlinDatabasesClientListResponse struct {
	// The List operation response, that contains the Gremlin database events and their properties.
	RestorableGremlinDatabasesListResult
}

RestorableGremlinDatabasesClientListResponse contains the response from method RestorableGremlinDatabasesClient.NewListPager.

type RestorableGremlinDatabasesListResult

type RestorableGremlinDatabasesListResult struct {
	// READ-ONLY; List of Gremlin database events and their properties.
	Value []*RestorableGremlinDatabaseGetResult
}

RestorableGremlinDatabasesListResult - The List operation response, that contains the Gremlin database events and their properties.

func (RestorableGremlinDatabasesListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableGremlinDatabasesListResult.

func (*RestorableGremlinDatabasesListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinDatabasesListResult.

type RestorableGremlinGraphGetResult

type RestorableGremlinGraphGetResult struct {
	// The properties of a Gremlin graph event.
	Properties *RestorableGremlinGraphProperties

	// READ-ONLY; The unique resource Identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableGremlinGraphGetResult - An Azure Cosmos DB Gremlin graph event

func (RestorableGremlinGraphGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableGremlinGraphGetResult.

func (*RestorableGremlinGraphGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinGraphGetResult.

type RestorableGremlinGraphProperties

type RestorableGremlinGraphProperties struct {
	// The resource of an Azure Cosmos DB Gremlin graph event
	Resource *RestorableGremlinGraphPropertiesResource
}

RestorableGremlinGraphProperties - The properties of an Azure Cosmos DB Gremlin graph event

func (RestorableGremlinGraphProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableGremlinGraphProperties.

func (*RestorableGremlinGraphProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinGraphProperties.

type RestorableGremlinGraphPropertiesResource

type RestorableGremlinGraphPropertiesResource struct {
	// READ-ONLY; A state of this graph to identify if this graph is restorable in same account.
	CanUndelete *string

	// READ-ONLY; The reason why this graph can not be restored in same account.
	CanUndeleteReason *string

	// READ-ONLY; The time when this graph event happened.
	EventTimestamp *string

	// READ-ONLY; The operation type of this graph event.
	OperationType *OperationType

	// READ-ONLY; The name of this Gremlin graph.
	OwnerID *string

	// READ-ONLY; The resource ID of this Gremlin graph.
	OwnerResourceID *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string
}

RestorableGremlinGraphPropertiesResource - The resource of an Azure Cosmos DB Gremlin graph event

func (RestorableGremlinGraphPropertiesResource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RestorableGremlinGraphPropertiesResource.

func (*RestorableGremlinGraphPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinGraphPropertiesResource.

type RestorableGremlinGraphsClient

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

RestorableGremlinGraphsClient contains the methods for the RestorableGremlinGraphs group. Don't use this type directly, use NewRestorableGremlinGraphsClient() instead.

func NewRestorableGremlinGraphsClient

func NewRestorableGremlinGraphsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableGremlinGraphsClient, error)

NewRestorableGremlinGraphsClient creates a new instance of RestorableGremlinGraphsClient with the specified values.

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

func (*RestorableGremlinGraphsClient) NewListPager

NewListPager - Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableGremlinGraphsClientListOptions contains the optional parameters for the RestorableGremlinGraphsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableGremlinGraphList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableGremlinGraphsClient().NewListPager("WestUS", "98a570f2-63db-4117-91f0-366327b7b353", &armcosmos.RestorableGremlinGraphsClientListOptions{RestorableGremlinDatabaseRid: to.Ptr("PD5DALigDgw="),
	StartTime: nil,
	EndTime:   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.RestorableGremlinGraphsListResult = armcosmos.RestorableGremlinGraphsListResult{
	// 	Value: []*armcosmos.RestorableGremlinGraphGetResult{
	// 		{
	// 			Name: to.Ptr("79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGraphs"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableGraphs/79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Properties: &armcosmos.RestorableGremlinGraphProperties{
	// 				Resource: &armcosmos.RestorableGremlinGraphPropertiesResource{
	// 					Rid: to.Ptr("zAyAPQAAAA=="),
	// 					CanUndelete: to.Ptr("invalid"),
	// 					EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeCreate),
	// 					OwnerID: to.Ptr("Graph1"),
	// 					OwnerResourceID: to.Ptr("V18LoLrv-qA="),
	// 				},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGraphs"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableGraphs/79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Properties: &armcosmos.RestorableGremlinGraphProperties{
	// 				Resource: &armcosmos.RestorableGremlinGraphPropertiesResource{
	// 					Rid: to.Ptr("zAyAPQAAAA=="),
	// 					CanUndelete: to.Ptr("notRestorable"),
	// 					CanUndeleteReason: to.Ptr("Individual shared database collections restore is not supported. Please restore shared database to restore its collections that share the throughput."),
	// 					EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeDelete),
	// 					OwnerID: to.Ptr("Graph1"),
	// 					OwnerResourceID: to.Ptr("V18LoLrv-qA="),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type RestorableGremlinGraphsClientListOptions

type RestorableGremlinGraphsClientListOptions struct {
	// Restorable Gremlin graphs event feed end time.
	EndTime *string

	// The resource ID of the Gremlin database.
	RestorableGremlinDatabaseRid *string

	// Restorable Gremlin graphs event feed start time.
	StartTime *string
}

RestorableGremlinGraphsClientListOptions contains the optional parameters for the RestorableGremlinGraphsClient.NewListPager method.

type RestorableGremlinGraphsClientListResponse

type RestorableGremlinGraphsClientListResponse struct {
	// The List operation response, that contains the Gremlin graph events and their properties.
	RestorableGremlinGraphsListResult
}

RestorableGremlinGraphsClientListResponse contains the response from method RestorableGremlinGraphsClient.NewListPager.

type RestorableGremlinGraphsListResult

type RestorableGremlinGraphsListResult struct {
	// READ-ONLY; List of Gremlin graph events and their properties.
	Value []*RestorableGremlinGraphGetResult
}

RestorableGremlinGraphsListResult - The List operation response, that contains the Gremlin graph events and their properties.

func (RestorableGremlinGraphsListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableGremlinGraphsListResult.

func (*RestorableGremlinGraphsListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinGraphsListResult.

type RestorableGremlinResourcesClient

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

RestorableGremlinResourcesClient contains the methods for the RestorableGremlinResources group. Don't use this type directly, use NewRestorableGremlinResourcesClient() instead.

func NewRestorableGremlinResourcesClient

func NewRestorableGremlinResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableGremlinResourcesClient, error)

NewRestorableGremlinResourcesClient creates a new instance of RestorableGremlinResourcesClient with the specified values.

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

func (*RestorableGremlinResourcesClient) NewListPager

NewListPager - Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission.

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableGremlinResourcesClientListOptions contains the optional parameters for the RestorableGremlinResourcesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableGremlinResourceList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableGremlinResourcesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", &armcosmos.RestorableGremlinResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"),
	RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"),
})
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.RestorableGremlinResourcesListResult = armcosmos.RestorableGremlinResourcesListResult{
	// 	Value: []*armcosmos.RestorableGremlinResourcesGetResult{
	// 		{
	// 			Name: to.Ptr("Database1"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinResources"),
	// 			DatabaseName: to.Ptr("Database1"),
	// 			GraphNames: []*string{
	// 				to.Ptr("Graph1")},
	// 				ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinResources/Database1"),
	// 			},
	// 			{
	// 				Name: to.Ptr("Database2"),
	// 				Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinResources"),
	// 				DatabaseName: to.Ptr("Database2"),
	// 				GraphNames: []*string{
	// 					to.Ptr("Graph1"),
	// 					to.Ptr("Graph2")},
	// 					ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinResources/Database2"),
	// 				},
	// 				{
	// 					Name: to.Ptr("Database3"),
	// 					Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinResources"),
	// 					DatabaseName: to.Ptr("Database3"),
	// 					GraphNames: []*string{
	// 					},
	// 					ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinResources/Database3"),
	// 			}},
	// 		}
}
Output:

type RestorableGremlinResourcesClientListOptions

type RestorableGremlinResourcesClientListOptions struct {
	// The location where the restorable resources are located.
	RestoreLocation *string

	// The timestamp when the restorable resources existed.
	RestoreTimestampInUTC *string
}

RestorableGremlinResourcesClientListOptions contains the optional parameters for the RestorableGremlinResourcesClient.NewListPager method.

type RestorableGremlinResourcesClientListResponse

type RestorableGremlinResourcesClientListResponse struct {
	// The List operation response, that contains the restorable Gremlin resources.
	RestorableGremlinResourcesListResult
}

RestorableGremlinResourcesClientListResponse contains the response from method RestorableGremlinResourcesClient.NewListPager.

type RestorableGremlinResourcesGetResult

type RestorableGremlinResourcesGetResult struct {
	// The name of the gremlin database available for restore.
	DatabaseName *string

	// The names of the graphs available for restore.
	GraphNames []*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableGremlinResourcesGetResult - Specific Databases to restore.

func (RestorableGremlinResourcesGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableGremlinResourcesGetResult.

func (*RestorableGremlinResourcesGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinResourcesGetResult.

type RestorableGremlinResourcesListResult

type RestorableGremlinResourcesListResult struct {
	// READ-ONLY; List of restorable Gremlin resources, including the gremlin database and graph names.
	Value []*RestorableGremlinResourcesGetResult
}

RestorableGremlinResourcesListResult - The List operation response, that contains the restorable Gremlin resources.

func (RestorableGremlinResourcesListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableGremlinResourcesListResult.

func (*RestorableGremlinResourcesListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinResourcesListResult.

type RestorableLocationResource

type RestorableLocationResource struct {
	// READ-ONLY; The creation time of the regional restorable database account (ISO-8601 format).
	CreationTime *time.Time

	// READ-ONLY; The time at which the regional restorable database account has been deleted (ISO-8601 format).
	DeletionTime *time.Time

	// READ-ONLY; The location of the regional restorable account.
	LocationName *string

	// READ-ONLY; The instance id of the regional restorable account.
	RegionalDatabaseAccountInstanceID *string
}

RestorableLocationResource - Properties of the regional restorable account.

func (RestorableLocationResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableLocationResource.

func (*RestorableLocationResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableLocationResource.

type RestorableMongodbCollectionGetResult

type RestorableMongodbCollectionGetResult struct {
	// The properties of a MongoDB collection event.
	Properties *RestorableMongodbCollectionProperties

	// READ-ONLY; The unique resource Identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableMongodbCollectionGetResult - An Azure Cosmos DB MongoDB collection event

func (RestorableMongodbCollectionGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionGetResult.

func (*RestorableMongodbCollectionGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionGetResult.

type RestorableMongodbCollectionProperties

type RestorableMongodbCollectionProperties struct {
	// The resource of an Azure Cosmos DB MongoDB collection event
	Resource *RestorableMongodbCollectionPropertiesResource
}

RestorableMongodbCollectionProperties - The properties of an Azure Cosmos DB MongoDB collection event

func (RestorableMongodbCollectionProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionProperties.

func (*RestorableMongodbCollectionProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionProperties.

type RestorableMongodbCollectionPropertiesResource

type RestorableMongodbCollectionPropertiesResource struct {
	// READ-ONLY; A state of this collection to identify if this container is restorable in same account.
	CanUndelete *string

	// READ-ONLY; The reason why this collection can not be restored in same account.
	CanUndeleteReason *string

	// READ-ONLY; The time when this collection event happened.
	EventTimestamp *string

	// READ-ONLY; The operation type of this collection event.
	OperationType *OperationType

	// READ-ONLY; The name of this MongoDB collection.
	OwnerID *string

	// READ-ONLY; The resource ID of this MongoDB collection.
	OwnerResourceID *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string
}

RestorableMongodbCollectionPropertiesResource - The resource of an Azure Cosmos DB MongoDB collection event

func (RestorableMongodbCollectionPropertiesResource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionPropertiesResource.

func (*RestorableMongodbCollectionPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionPropertiesResource.

type RestorableMongodbCollectionsClient

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

RestorableMongodbCollectionsClient contains the methods for the RestorableMongodbCollections group. Don't use this type directly, use NewRestorableMongodbCollectionsClient() instead.

func NewRestorableMongodbCollectionsClient

func NewRestorableMongodbCollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableMongodbCollectionsClient, error)

NewRestorableMongodbCollectionsClient creates a new instance of RestorableMongodbCollectionsClient with the specified values.

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

func (*RestorableMongodbCollectionsClient) NewListPager

NewListPager - Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableMongodbCollectionsClientListOptions contains the optional parameters for the RestorableMongodbCollectionsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableMongodbCollectionList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableMongodbCollectionsClient().NewListPager("WestUS", "98a570f2-63db-4117-91f0-366327b7b353", &armcosmos.RestorableMongodbCollectionsClientListOptions{RestorableMongodbDatabaseRid: to.Ptr("PD5DALigDgw="),
	StartTime: nil,
	EndTime:   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.RestorableMongodbCollectionsListResult = armcosmos.RestorableMongodbCollectionsListResult{
	// 	Value: []*armcosmos.RestorableMongodbCollectionGetResult{
	// 		{
	// 			Name: to.Ptr("79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbCollections"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableMongodbCollections/79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Properties: &armcosmos.RestorableMongodbCollectionProperties{
	// 				Resource: &armcosmos.RestorableMongodbCollectionPropertiesResource{
	// 					Rid: to.Ptr("zAyAPQAAAA=="),
	// 					CanUndelete: to.Ptr("invalid"),
	// 					EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeCreate),
	// 					OwnerID: to.Ptr("Collection1"),
	// 					OwnerResourceID: to.Ptr("V18LoLrv-qA="),
	// 				},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbCollections"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableMongodbCollections/79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Properties: &armcosmos.RestorableMongodbCollectionProperties{
	// 				Resource: &armcosmos.RestorableMongodbCollectionPropertiesResource{
	// 					Rid: to.Ptr("zAyAPQAAAA=="),
	// 					CanUndelete: to.Ptr("notRestorable"),
	// 					CanUndeleteReason: to.Ptr("Individual shared database collections restore is not supported. Please restore shared database to restore its collections that share the throughput."),
	// 					EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeDelete),
	// 					OwnerID: to.Ptr("Collection1"),
	// 					OwnerResourceID: to.Ptr("V18LoLrv-qA="),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type RestorableMongodbCollectionsClientListOptions

type RestorableMongodbCollectionsClientListOptions struct {
	// Restorable MongoDB collections event feed end time.
	EndTime *string

	// The resource ID of the MongoDB database.
	RestorableMongodbDatabaseRid *string

	// Restorable MongoDB collections event feed start time.
	StartTime *string
}

RestorableMongodbCollectionsClientListOptions contains the optional parameters for the RestorableMongodbCollectionsClient.NewListPager method.

type RestorableMongodbCollectionsClientListResponse

type RestorableMongodbCollectionsClientListResponse struct {
	// The List operation response, that contains the MongoDB collection events and their properties.
	RestorableMongodbCollectionsListResult
}

RestorableMongodbCollectionsClientListResponse contains the response from method RestorableMongodbCollectionsClient.NewListPager.

type RestorableMongodbCollectionsListResult

type RestorableMongodbCollectionsListResult struct {
	// READ-ONLY; List of MongoDB collection events and their properties.
	Value []*RestorableMongodbCollectionGetResult
}

RestorableMongodbCollectionsListResult - The List operation response, that contains the MongoDB collection events and their properties.

func (RestorableMongodbCollectionsListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionsListResult.

func (*RestorableMongodbCollectionsListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionsListResult.

type RestorableMongodbDatabaseGetResult

type RestorableMongodbDatabaseGetResult struct {
	// The properties of a MongoDB database event.
	Properties *RestorableMongodbDatabaseProperties

	// READ-ONLY; The unique resource Identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableMongodbDatabaseGetResult - An Azure Cosmos DB MongoDB database event

func (RestorableMongodbDatabaseGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabaseGetResult.

func (*RestorableMongodbDatabaseGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabaseGetResult.

type RestorableMongodbDatabaseProperties

type RestorableMongodbDatabaseProperties struct {
	// The resource of an Azure Cosmos DB MongoDB database event
	Resource *RestorableMongodbDatabasePropertiesResource
}

RestorableMongodbDatabaseProperties - The properties of an Azure Cosmos DB MongoDB database event

func (RestorableMongodbDatabaseProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabaseProperties.

func (*RestorableMongodbDatabaseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabaseProperties.

type RestorableMongodbDatabasePropertiesResource

type RestorableMongodbDatabasePropertiesResource struct {
	// READ-ONLY; A state of this database to identify if this database is restorable in same account.
	CanUndelete *string

	// READ-ONLY; The reason why this database can not be restored in same account.
	CanUndeleteReason *string

	// READ-ONLY; The time when this database event happened.
	EventTimestamp *string

	// READ-ONLY; The operation type of this database event.
	OperationType *OperationType

	// READ-ONLY; The name of this MongoDB database.
	OwnerID *string

	// READ-ONLY; The resource ID of this MongoDB database.
	OwnerResourceID *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string
}

RestorableMongodbDatabasePropertiesResource - The resource of an Azure Cosmos DB MongoDB database event

func (RestorableMongodbDatabasePropertiesResource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabasePropertiesResource.

func (*RestorableMongodbDatabasePropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabasePropertiesResource.

type RestorableMongodbDatabasesClient

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

RestorableMongodbDatabasesClient contains the methods for the RestorableMongodbDatabases group. Don't use this type directly, use NewRestorableMongodbDatabasesClient() instead.

func NewRestorableMongodbDatabasesClient

func NewRestorableMongodbDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableMongodbDatabasesClient, error)

NewRestorableMongodbDatabasesClient creates a new instance of RestorableMongodbDatabasesClient with the specified values.

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

func (*RestorableMongodbDatabasesClient) NewListPager

NewListPager - Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableMongodbDatabasesClientListOptions contains the optional parameters for the RestorableMongodbDatabasesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableMongodbDatabaseList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableMongodbDatabasesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", 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.RestorableMongodbDatabasesListResult = armcosmos.RestorableMongodbDatabasesListResult{
	// 	Value: []*armcosmos.RestorableMongodbDatabaseGetResult{
	// 		{
	// 			Name: to.Ptr("59c21367-b98b-4a8e-abb7-b6f46600decc"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbDatabases"),
	// 			ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/36f09704-6be3-4f33-aa05-17b73e504c75/restorableMongodbDatabases/59c21367-b98b-4a8e-abb7-b6f46600decc"),
	// 			Properties: &armcosmos.RestorableMongodbDatabaseProperties{
	// 				Resource: &armcosmos.RestorableMongodbDatabasePropertiesResource{
	// 					Rid: to.Ptr("DLB14gAAAA=="),
	// 					CanUndelete: to.Ptr("invalid"),
	// 					EventTimestamp: to.Ptr("2020-09-02T19:45:03Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeCreate),
	// 					OwnerID: to.Ptr("Database1"),
	// 					OwnerResourceID: to.Ptr("PD5DALigDgw="),
	// 				},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("8456cb17-cdb0-4c6a-8db8-d0ff3f886257"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbDatabases"),
	// 			ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableMongodbDatabases/8456cb17-cdb0-4c6a-8db8-d0ff3f886257"),
	// 			Properties: &armcosmos.RestorableMongodbDatabaseProperties{
	// 				Resource: &armcosmos.RestorableMongodbDatabasePropertiesResource{
	// 					Rid: to.Ptr("ESXNLAAAAA=="),
	// 					CanUndelete: to.Ptr("notRestorable"),
	// 					CanUndeleteReason: to.Ptr("Database already exists. Only deleted resources can be restored within same account."),
	// 					EventTimestamp: to.Ptr("2020-09-02T19:53:42Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeDelete),
	// 					OwnerID: to.Ptr("Database1"),
	// 					OwnerResourceID: to.Ptr("PD5DALigDgw="),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type RestorableMongodbDatabasesClientListOptions

type RestorableMongodbDatabasesClientListOptions struct {
}

RestorableMongodbDatabasesClientListOptions contains the optional parameters for the RestorableMongodbDatabasesClient.NewListPager method.

type RestorableMongodbDatabasesClientListResponse

type RestorableMongodbDatabasesClientListResponse struct {
	// The List operation response, that contains the MongoDB database events and their properties.
	RestorableMongodbDatabasesListResult
}

RestorableMongodbDatabasesClientListResponse contains the response from method RestorableMongodbDatabasesClient.NewListPager.

type RestorableMongodbDatabasesListResult

type RestorableMongodbDatabasesListResult struct {
	// READ-ONLY; List of MongoDB database events and their properties.
	Value []*RestorableMongodbDatabaseGetResult
}

RestorableMongodbDatabasesListResult - The List operation response, that contains the MongoDB database events and their properties.

func (RestorableMongodbDatabasesListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabasesListResult.

func (*RestorableMongodbDatabasesListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabasesListResult.

type RestorableMongodbResourcesClient

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

RestorableMongodbResourcesClient contains the methods for the RestorableMongodbResources group. Don't use this type directly, use NewRestorableMongodbResourcesClient() instead.

func NewRestorableMongodbResourcesClient

func NewRestorableMongodbResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableMongodbResourcesClient, error)

NewRestorableMongodbResourcesClient creates a new instance of RestorableMongodbResourcesClient with the specified values.

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

func (*RestorableMongodbResourcesClient) NewListPager

NewListPager - Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission.

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableMongodbResourcesClientListOptions contains the optional parameters for the RestorableMongodbResourcesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableMongodbResourceList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableMongodbResourcesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", &armcosmos.RestorableMongodbResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"),
	RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"),
})
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.RestorableMongodbResourcesListResult = armcosmos.RestorableMongodbResourcesListResult{
	// 	Value: []*armcosmos.RestorableMongodbResourcesGetResult{
	// 		{
	// 			Name: to.Ptr("Database1"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablemongodbresources"),
	// 			CollectionNames: []*string{
	// 				to.Ptr("Collection1")},
	// 				DatabaseName: to.Ptr("Database1"),
	// 				ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablemongodbresources/Database1"),
	// 			},
	// 			{
	// 				Name: to.Ptr("Database2"),
	// 				Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablemongodbresources"),
	// 				CollectionNames: []*string{
	// 					to.Ptr("Collection1"),
	// 					to.Ptr("Collection2")},
	// 					DatabaseName: to.Ptr("Database2"),
	// 					ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablemongodbresources/Database2"),
	// 				},
	// 				{
	// 					Name: to.Ptr("Database3"),
	// 					Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablemongodbresources"),
	// 					CollectionNames: []*string{
	// 					},
	// 					DatabaseName: to.Ptr("Database3"),
	// 					ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablemongodbresources/Database3"),
	// 			}},
	// 		}
}
Output:

type RestorableMongodbResourcesClientListOptions

type RestorableMongodbResourcesClientListOptions struct {
	// The location where the restorable resources are located.
	RestoreLocation *string

	// The timestamp when the restorable resources existed.
	RestoreTimestampInUTC *string
}

RestorableMongodbResourcesClientListOptions contains the optional parameters for the RestorableMongodbResourcesClient.NewListPager method.

type RestorableMongodbResourcesClientListResponse

type RestorableMongodbResourcesClientListResponse struct {
	// The List operation response, that contains the restorable MongoDB resources.
	RestorableMongodbResourcesListResult
}

RestorableMongodbResourcesClientListResponse contains the response from method RestorableMongodbResourcesClient.NewListPager.

type RestorableMongodbResourcesGetResult

type RestorableMongodbResourcesGetResult struct {
	// The names of the collections available for restore.
	CollectionNames []*string

	// The name of the database available for restore.
	DatabaseName *string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableMongodbResourcesGetResult - Specific Databases to restore.

func (RestorableMongodbResourcesGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableMongodbResourcesGetResult.

func (*RestorableMongodbResourcesGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbResourcesGetResult.

type RestorableMongodbResourcesListResult

type RestorableMongodbResourcesListResult struct {
	// READ-ONLY; List of restorable MongoDB resources, including the database and collection names.
	Value []*RestorableMongodbResourcesGetResult
}

RestorableMongodbResourcesListResult - The List operation response, that contains the restorable MongoDB resources.

func (RestorableMongodbResourcesListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableMongodbResourcesListResult.

func (*RestorableMongodbResourcesListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbResourcesListResult.

type RestorableSQLContainerGetResult

type RestorableSQLContainerGetResult struct {
	// The properties of a SQL container event.
	Properties *RestorableSQLContainerProperties

	// READ-ONLY; The unique resource Identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableSQLContainerGetResult - An Azure Cosmos DB SQL container event

func (RestorableSQLContainerGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerGetResult.

func (*RestorableSQLContainerGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerGetResult.

type RestorableSQLContainerProperties

type RestorableSQLContainerProperties struct {
	// The resource of an Azure Cosmos DB SQL container event
	Resource *RestorableSQLContainerPropertiesResource
}

RestorableSQLContainerProperties - The properties of an Azure Cosmos DB SQL container event

func (RestorableSQLContainerProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerProperties.

func (*RestorableSQLContainerProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerProperties.

type RestorableSQLContainerPropertiesResource

type RestorableSQLContainerPropertiesResource struct {
	// Cosmos DB SQL container resource object
	Container *RestorableSQLContainerPropertiesResourceContainer

	// READ-ONLY; A state of this container to identify if this container is restorable in same account.
	CanUndelete *string

	// READ-ONLY; The reason why this container can not be restored in same account.
	CanUndeleteReason *string

	// READ-ONLY; The when this container event happened.
	EventTimestamp *string

	// READ-ONLY; The operation type of this container event.
	OperationType *OperationType

	// READ-ONLY; The name of this SQL container.
	OwnerID *string

	// READ-ONLY; The resource ID of this SQL container.
	OwnerResourceID *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string
}

RestorableSQLContainerPropertiesResource - The resource of an Azure Cosmos DB SQL container event

func (RestorableSQLContainerPropertiesResource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerPropertiesResource.

func (*RestorableSQLContainerPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerPropertiesResource.

type RestorableSQLContainerPropertiesResourceContainer

type RestorableSQLContainerPropertiesResourceContainer struct {
	// REQUIRED; Name of the Cosmos DB SQL container
	ID *string

	// Analytical TTL.
	AnalyticalStorageTTL *int64

	// The client encryption policy for the container.
	ClientEncryptionPolicy *ClientEncryptionPolicy

	// List of computed properties
	ComputedProperties []*ComputedProperty

	// The conflict resolution policy for the container.
	ConflictResolutionPolicy *ConflictResolutionPolicy

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Default time to live
	DefaultTTL *int32

	// The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container
	IndexingPolicy *IndexingPolicy

	// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container.
	MaterializedViewDefinition *MaterializedViewDefinition

	// The configuration of the partition key to be used for partitioning data into multiple partitions
	PartitionKey *ContainerPartitionKey

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos
	// DB service.
	UniqueKeyPolicy *UniqueKeyPolicy

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that specifies the addressable path of the container resource.
	Self *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

RestorableSQLContainerPropertiesResourceContainer - Cosmos DB SQL container resource object

func (RestorableSQLContainerPropertiesResourceContainer) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerPropertiesResourceContainer.

func (*RestorableSQLContainerPropertiesResourceContainer) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerPropertiesResourceContainer.

type RestorableSQLContainersClient

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

RestorableSQLContainersClient contains the methods for the RestorableSQLContainers group. Don't use this type directly, use NewRestorableSQLContainersClient() instead.

func NewRestorableSQLContainersClient

func NewRestorableSQLContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableSQLContainersClient, error)

NewRestorableSQLContainersClient creates a new instance of RestorableSQLContainersClient with the specified values.

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

func (*RestorableSQLContainersClient) NewListPager

NewListPager - Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableSQLContainersClientListOptions contains the optional parameters for the RestorableSQLContainersClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableSqlContainerList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableSQLContainersClient().NewListPager("WestUS", "98a570f2-63db-4117-91f0-366327b7b353", &armcosmos.RestorableSQLContainersClientListOptions{RestorableSQLDatabaseRid: to.Ptr("3fu-hg=="),
	StartTime: nil,
	EndTime:   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.RestorableSQLContainersListResult = armcosmos.RestorableSQLContainersListResult{
	// 	Value: []*armcosmos.RestorableSQLContainerGetResult{
	// 		{
	// 			Name: to.Ptr("79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlContainers"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableSqlContainers/79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Properties: &armcosmos.RestorableSQLContainerProperties{
	// 				Resource: &armcosmos.RestorableSQLContainerPropertiesResource{
	// 					Rid: to.Ptr("zAyAPQAAAA=="),
	// 					CanUndelete: to.Ptr("invalid"),
	// 					Container: &armcosmos.RestorableSQLContainerPropertiesResourceContainer{
	// 						Etag: to.Ptr("\"00003e00-0000-0700-0000-5f85338a0000\""),
	// 						Rid: to.Ptr("V18LoLrv-qA="),
	// 						ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
	// 							ConflictResolutionPath: to.Ptr("/_ts"),
	// 							ConflictResolutionProcedure: to.Ptr(""),
	// 							Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
	// 						},
	// 						ID: to.Ptr("Container1"),
	// 						IndexingPolicy: &armcosmos.IndexingPolicy{
	// 							Automatic: to.Ptr(true),
	// 							ExcludedPaths: []*armcosmos.ExcludedPath{
	// 								{
	// 									Path: to.Ptr("/\"_etag\"/?"),
	// 							}},
	// 							IncludedPaths: []*armcosmos.IncludedPath{
	// 								{
	// 									Path: to.Ptr("/*"),
	// 								},
	// 								{
	// 									Path: to.Ptr("/\"_ts\"/?"),
	// 							}},
	// 							IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
	// 						},
	// 						Self: to.Ptr("dbs/V18LoA==/colls/V18LoLrv-qA=/"),
	// 					},
	// 					EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeCreate),
	// 					OwnerID: to.Ptr("Container1"),
	// 					OwnerResourceID: to.Ptr("V18LoLrv-qA="),
	// 				},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("e85298a1-c631-4726-825e-a7ca092e9098"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlContainers"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableSqlContainers/e85298a1-c631-4726-825e-a7ca092e9098"),
	// 			Properties: &armcosmos.RestorableSQLContainerProperties{
	// 				Resource: &armcosmos.RestorableSQLContainerPropertiesResource{
	// 					Rid: to.Ptr("PrArcgAAAA=="),
	// 					CanUndelete: to.Ptr("invalid"),
	// 					Container: &armcosmos.RestorableSQLContainerPropertiesResourceContainer{
	// 						Etag: to.Ptr("\"00004400-0000-0700-0000-5f85351f0000\""),
	// 						Rid: to.Ptr("V18LoLrv-qA="),
	// 						ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
	// 							ConflictResolutionPath: to.Ptr("/_ts"),
	// 							ConflictResolutionProcedure: to.Ptr(""),
	// 							Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
	// 						},
	// 						DefaultTTL: to.Ptr[int32](12345),
	// 						ID: to.Ptr("Container1"),
	// 						IndexingPolicy: &armcosmos.IndexingPolicy{
	// 							Automatic: to.Ptr(true),
	// 							ExcludedPaths: []*armcosmos.ExcludedPath{
	// 								{
	// 									Path: to.Ptr("/\"_etag\"/?"),
	// 							}},
	// 							IncludedPaths: []*armcosmos.IncludedPath{
	// 								{
	// 									Path: to.Ptr("/*"),
	// 								},
	// 								{
	// 									Path: to.Ptr("/\"_ts\"/?"),
	// 							}},
	// 							IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
	// 						},
	// 						Self: to.Ptr("dbs/V18LoA==/colls/V18LoLrv-qA=/"),
	// 					},
	// 					EventTimestamp: to.Ptr("2020-10-13T05:03:27Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeReplace),
	// 					OwnerID: to.Ptr("Container1"),
	// 					OwnerResourceID: to.Ptr("V18LoLrv-qA="),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type RestorableSQLContainersClientListOptions

type RestorableSQLContainersClientListOptions struct {
	// Restorable Sql containers event feed end time.
	EndTime *string

	// The resource ID of the SQL database.
	RestorableSQLDatabaseRid *string

	// Restorable Sql containers event feed start time.
	StartTime *string
}

RestorableSQLContainersClientListOptions contains the optional parameters for the RestorableSQLContainersClient.NewListPager method.

type RestorableSQLContainersClientListResponse

type RestorableSQLContainersClientListResponse struct {
	// The List operation response, that contains the SQL container events and their properties.
	RestorableSQLContainersListResult
}

RestorableSQLContainersClientListResponse contains the response from method RestorableSQLContainersClient.NewListPager.

type RestorableSQLContainersListResult

type RestorableSQLContainersListResult struct {
	// READ-ONLY; List of SQL container events and their properties.
	Value []*RestorableSQLContainerGetResult
}

RestorableSQLContainersListResult - The List operation response, that contains the SQL container events and their properties.

func (RestorableSQLContainersListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainersListResult.

func (*RestorableSQLContainersListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainersListResult.

type RestorableSQLDatabaseGetResult

type RestorableSQLDatabaseGetResult struct {
	// The properties of a SQL database event.
	Properties *RestorableSQLDatabaseProperties

	// READ-ONLY; The unique resource Identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableSQLDatabaseGetResult - An Azure Cosmos DB SQL database event

func (RestorableSQLDatabaseGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabaseGetResult.

func (*RestorableSQLDatabaseGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabaseGetResult.

type RestorableSQLDatabaseProperties

type RestorableSQLDatabaseProperties struct {
	// The resource of an Azure Cosmos DB SQL database event
	Resource *RestorableSQLDatabasePropertiesResource
}

RestorableSQLDatabaseProperties - The properties of an Azure Cosmos DB SQL database event

func (RestorableSQLDatabaseProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabaseProperties.

func (*RestorableSQLDatabaseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabaseProperties.

type RestorableSQLDatabasePropertiesResource

type RestorableSQLDatabasePropertiesResource struct {
	// Cosmos DB SQL database resource object
	Database *RestorableSQLDatabasePropertiesResourceDatabase

	// READ-ONLY; A state of this database to identify if this database is restorable in same account.
	CanUndelete *string

	// READ-ONLY; The reason why this database can not be restored in same account.
	CanUndeleteReason *string

	// READ-ONLY; The time when this database event happened.
	EventTimestamp *string

	// READ-ONLY; The operation type of this database event.
	OperationType *OperationType

	// READ-ONLY; The name of the SQL database.
	OwnerID *string

	// READ-ONLY; The resource ID of the SQL database.
	OwnerResourceID *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string
}

RestorableSQLDatabasePropertiesResource - The resource of an Azure Cosmos DB SQL database event

func (RestorableSQLDatabasePropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabasePropertiesResource.

func (*RestorableSQLDatabasePropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabasePropertiesResource.

type RestorableSQLDatabasePropertiesResourceDatabase

type RestorableSQLDatabasePropertiesResourceDatabase struct {
	// REQUIRED; Name of the Cosmos DB SQL database
	ID *string

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// READ-ONLY; A system generated property that specified the addressable path of the collections resource.
	Colls *string

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that specifies the addressable path of the database resource.
	Self *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32

	// READ-ONLY; A system generated property that specifies the addressable path of the users resource.
	Users *string
}

RestorableSQLDatabasePropertiesResourceDatabase - Cosmos DB SQL database resource object

func (RestorableSQLDatabasePropertiesResourceDatabase) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabasePropertiesResourceDatabase.

func (*RestorableSQLDatabasePropertiesResourceDatabase) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabasePropertiesResourceDatabase.

type RestorableSQLDatabasesClient

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

RestorableSQLDatabasesClient contains the methods for the RestorableSQLDatabases group. Don't use this type directly, use NewRestorableSQLDatabasesClient() instead.

func NewRestorableSQLDatabasesClient

func NewRestorableSQLDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableSQLDatabasesClient, error)

NewRestorableSQLDatabasesClient creates a new instance of RestorableSQLDatabasesClient with the specified values.

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

func (*RestorableSQLDatabasesClient) NewListPager

NewListPager - Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableSQLDatabasesClientListOptions contains the optional parameters for the RestorableSQLDatabasesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableSqlDatabaseList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableSQLDatabasesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", 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.RestorableSQLDatabasesListResult = armcosmos.RestorableSQLDatabasesListResult{
	// 	Value: []*armcosmos.RestorableSQLDatabaseGetResult{
	// 		{
	// 			Name: to.Ptr("59c21367-b98b-4a8e-abb7-b6f46600decc"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlDatabases"),
	// 			ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/36f09704-6be3-4f33-aa05-17b73e504c75/restorableSqlDatabases/59c21367-b98b-4a8e-abb7-b6f46600decc"),
	// 			Properties: &armcosmos.RestorableSQLDatabaseProperties{
	// 				Resource: &armcosmos.RestorableSQLDatabasePropertiesResource{
	// 					Rid: to.Ptr("DLB14gAAAA=="),
	// 					CanUndelete: to.Ptr("invalid"),
	// 					Database: &armcosmos.RestorableSQLDatabasePropertiesResourceDatabase{
	// 						Etag: to.Ptr("\"0000c20a-0000-0700-0000-5f4ff63f0000\""),
	// 						Rid: to.Ptr("3fu-hg=="),
	// 						ID: to.Ptr("Database1"),
	// 						Colls: to.Ptr("colls/"),
	// 						Self: to.Ptr("dbs/3fu-hg==/"),
	// 						Users: to.Ptr("users/"),
	// 					},
	// 					EventTimestamp: to.Ptr("2020-09-02T19:45:03Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeCreate),
	// 					OwnerID: to.Ptr("Database1"),
	// 					OwnerResourceID: to.Ptr("3fu-hg=="),
	// 				},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("8456cb17-cdb0-4c6a-8db8-d0ff3f886257"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlDatabases"),
	// 			ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableSqlDatabases/8456cb17-cdb0-4c6a-8db8-d0ff3f886257"),
	// 			Properties: &armcosmos.RestorableSQLDatabaseProperties{
	// 				Resource: &armcosmos.RestorableSQLDatabasePropertiesResource{
	// 					Rid: to.Ptr("ESXNLAAAAA=="),
	// 					CanUndelete: to.Ptr("notRestorable"),
	// 					CanUndeleteReason: to.Ptr("Database already exists. Only deleted resources can be restored within same account."),
	// 					Database: &armcosmos.RestorableSQLDatabasePropertiesResourceDatabase{
	// 						Etag: to.Ptr("\"0000c20a-0000-0700-0000-5f4ff63f0000\""),
	// 						Rid: to.Ptr("3fu-hg=="),
	// 						Ts: to.Ptr[float32](1599075903),
	// 						ID: to.Ptr("Database1"),
	// 						Colls: to.Ptr("colls/"),
	// 						Self: to.Ptr("dbs/3fu-hg==/"),
	// 						Users: to.Ptr("users/"),
	// 					},
	// 					EventTimestamp: to.Ptr("2020-09-02T19:53:42Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeDelete),
	// 					OwnerID: to.Ptr("Database1"),
	// 					OwnerResourceID: to.Ptr("3fu-hg=="),
	// 				},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("2c07991b-9c7c-4e85-be68-b18c1f2ff326"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlDatabases"),
	// 			ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableSqlDatabases/2c07991b-9c7c-4e85-be68-b18c1f2ff326"),
	// 			Properties: &armcosmos.RestorableSQLDatabaseProperties{
	// 				Resource: &armcosmos.RestorableSQLDatabasePropertiesResource{
	// 					Rid: to.Ptr("aXFqUQAAAA=="),
	// 					CanUndelete: to.Ptr("invalid"),
	// 					Database: &armcosmos.RestorableSQLDatabasePropertiesResourceDatabase{
	// 						Etag: to.Ptr("\"0000ca0a-0000-0700-0000-5f4ff82b0000\""),
	// 						Rid: to.Ptr("0SziSg=="),
	// 						ID: to.Ptr("Database2"),
	// 						Colls: to.Ptr("colls/"),
	// 						Self: to.Ptr("dbs/0SziSg==/"),
	// 						Users: to.Ptr("users/"),
	// 					},
	// 					EventTimestamp: to.Ptr("2020-09-02T19:53:15Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeCreate),
	// 					OwnerID: to.Ptr("Database2"),
	// 					OwnerResourceID: to.Ptr("0SziSg=="),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type RestorableSQLDatabasesClientListOptions

type RestorableSQLDatabasesClientListOptions struct {
}

RestorableSQLDatabasesClientListOptions contains the optional parameters for the RestorableSQLDatabasesClient.NewListPager method.

type RestorableSQLDatabasesClientListResponse

type RestorableSQLDatabasesClientListResponse struct {
	// The List operation response, that contains the SQL database events and their properties.
	RestorableSQLDatabasesListResult
}

RestorableSQLDatabasesClientListResponse contains the response from method RestorableSQLDatabasesClient.NewListPager.

type RestorableSQLDatabasesListResult

type RestorableSQLDatabasesListResult struct {
	// READ-ONLY; List of SQL database events and their properties.
	Value []*RestorableSQLDatabaseGetResult
}

RestorableSQLDatabasesListResult - The List operation response, that contains the SQL database events and their properties.

func (RestorableSQLDatabasesListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabasesListResult.

func (*RestorableSQLDatabasesListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabasesListResult.

type RestorableSQLResourcesClient

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

RestorableSQLResourcesClient contains the methods for the RestorableSQLResources group. Don't use this type directly, use NewRestorableSQLResourcesClient() instead.

func NewRestorableSQLResourcesClient

func NewRestorableSQLResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableSQLResourcesClient, error)

NewRestorableSQLResourcesClient creates a new instance of RestorableSQLResourcesClient with the specified values.

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

func (*RestorableSQLResourcesClient) NewListPager

NewListPager - Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission.

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableSQLResourcesClientListOptions contains the optional parameters for the RestorableSQLResourcesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableSqlResourceList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableSQLResourcesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", &armcosmos.RestorableSQLResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"),
	RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"),
})
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.RestorableSQLResourcesListResult = armcosmos.RestorableSQLResourcesListResult{
	// 	Value: []*armcosmos.RestorableSQLResourcesGetResult{
	// 		{
	// 			Name: to.Ptr("Database1"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablesqlresources"),
	// 			CollectionNames: []*string{
	// 				to.Ptr("Container1")},
	// 				DatabaseName: to.Ptr("Database1"),
	// 				ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablesqlresources/Database1"),
	// 			},
	// 			{
	// 				Name: to.Ptr("Database2"),
	// 				Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablesqlresources"),
	// 				CollectionNames: []*string{
	// 					to.Ptr("Container1"),
	// 					to.Ptr("Container2")},
	// 					DatabaseName: to.Ptr("Database2"),
	// 					ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablesqlresources/Database2"),
	// 				},
	// 				{
	// 					Name: to.Ptr("Database3"),
	// 					Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablesqlresources"),
	// 					CollectionNames: []*string{
	// 					},
	// 					DatabaseName: to.Ptr("Database3"),
	// 					ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorablesqlresources/Database3"),
	// 			}},
	// 		}
}
Output:

type RestorableSQLResourcesClientListOptions

type RestorableSQLResourcesClientListOptions struct {
	// The location where the restorable resources are located.
	RestoreLocation *string

	// The timestamp when the restorable resources existed.
	RestoreTimestampInUTC *string
}

RestorableSQLResourcesClientListOptions contains the optional parameters for the RestorableSQLResourcesClient.NewListPager method.

type RestorableSQLResourcesClientListResponse

type RestorableSQLResourcesClientListResponse struct {
	// The List operation response, that contains the restorable SQL resources.
	RestorableSQLResourcesListResult
}

RestorableSQLResourcesClientListResponse contains the response from method RestorableSQLResourcesClient.NewListPager.

type RestorableSQLResourcesGetResult

type RestorableSQLResourcesGetResult struct {
	// The names of the collections available for restore.
	CollectionNames []*string

	// The name of the database available for restore.
	DatabaseName *string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableSQLResourcesGetResult - Specific Databases to restore.

func (RestorableSQLResourcesGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableSQLResourcesGetResult.

func (*RestorableSQLResourcesGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLResourcesGetResult.

type RestorableSQLResourcesListResult

type RestorableSQLResourcesListResult struct {
	// READ-ONLY; List of restorable SQL resources, including the database and collection names.
	Value []*RestorableSQLResourcesGetResult
}

RestorableSQLResourcesListResult - The List operation response, that contains the restorable SQL resources.

func (RestorableSQLResourcesListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableSQLResourcesListResult.

func (*RestorableSQLResourcesListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLResourcesListResult.

type RestorableTableGetResult

type RestorableTableGetResult struct {
	// The properties of a Table event.
	Properties *RestorableTableProperties

	// READ-ONLY; The unique resource Identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableTableGetResult - An Azure Cosmos DB Table event

func (RestorableTableGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableTableGetResult.

func (*RestorableTableGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTableGetResult.

type RestorableTableProperties

type RestorableTableProperties struct {
	// The resource of an Azure Cosmos DB Table event
	Resource *RestorableTablePropertiesResource
}

RestorableTableProperties - The properties of an Azure Cosmos DB Table event

func (RestorableTableProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableTableProperties.

func (*RestorableTableProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTableProperties.

type RestorableTablePropertiesResource

type RestorableTablePropertiesResource struct {
	// READ-ONLY; A state of this table to identify if this table is restorable in same account.
	CanUndelete *string

	// READ-ONLY; The reason why this table can not be restored in same account.
	CanUndeleteReason *string

	// READ-ONLY; The time when this table event happened.
	EventTimestamp *string

	// READ-ONLY; The operation type of this table event.
	OperationType *OperationType

	// READ-ONLY; The name of this Table.
	OwnerID *string

	// READ-ONLY; The resource ID of this Table.
	OwnerResourceID *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string
}

RestorableTablePropertiesResource - The resource of an Azure Cosmos DB Table event

func (RestorableTablePropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableTablePropertiesResource.

func (*RestorableTablePropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTablePropertiesResource.

type RestorableTableResourcesClient

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

RestorableTableResourcesClient contains the methods for the RestorableTableResources group. Don't use this type directly, use NewRestorableTableResourcesClient() instead.

func NewRestorableTableResourcesClient

func NewRestorableTableResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableTableResourcesClient, error)

NewRestorableTableResourcesClient creates a new instance of RestorableTableResourcesClient with the specified values.

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

func (*RestorableTableResourcesClient) NewListPager

NewListPager - Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission.

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableTableResourcesClientListOptions contains the optional parameters for the RestorableTableResourcesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableTableResourceList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableTableResourcesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", &armcosmos.RestorableTableResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"),
	RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"),
})
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.RestorableTableResourcesListResult = armcosmos.RestorableTableResourcesListResult{
	// 	Value: []*armcosmos.RestorableTableResourcesGetResult{
	// 		{
	// 			Name: to.Ptr("table1"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablesqlresources"),
	// 			ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorabletableresources/table1"),
	// 		},
	// 		{
	// 			Name: to.Ptr("table2"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorablesqlresources"),
	// 			ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorabletableresources/table2"),
	// 	}},
	// }
}
Output:

type RestorableTableResourcesClientListOptions

type RestorableTableResourcesClientListOptions struct {
	// The location where the restorable resources are located.
	RestoreLocation *string

	// The timestamp when the restorable resources existed.
	RestoreTimestampInUTC *string
}

RestorableTableResourcesClientListOptions contains the optional parameters for the RestorableTableResourcesClient.NewListPager method.

type RestorableTableResourcesClientListResponse

type RestorableTableResourcesClientListResponse struct {
	// List of restorable table names.
	RestorableTableResourcesListResult
}

RestorableTableResourcesClientListResponse contains the response from method RestorableTableResourcesClient.NewListPager.

type RestorableTableResourcesGetResult

type RestorableTableResourcesGetResult struct {
	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RestorableTableResourcesGetResult - Specific Databases to restore.

func (RestorableTableResourcesGetResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableTableResourcesGetResult.

func (*RestorableTableResourcesGetResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTableResourcesGetResult.

type RestorableTableResourcesListResult

type RestorableTableResourcesListResult struct {
	// READ-ONLY; List of restorable table names.
	Value []*RestorableTableResourcesGetResult
}

RestorableTableResourcesListResult - List of restorable table names.

func (RestorableTableResourcesListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableTableResourcesListResult.

func (*RestorableTableResourcesListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTableResourcesListResult.

type RestorableTablesClient

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

RestorableTablesClient contains the methods for the RestorableTables group. Don't use this type directly, use NewRestorableTablesClient() instead.

func NewRestorableTablesClient

func NewRestorableTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableTablesClient, error)

NewRestorableTablesClient creates a new instance of RestorableTablesClient with the specified values.

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

func (*RestorableTablesClient) NewListPager

NewListPager - Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission

Generated from API version 2024-02-15-preview

  • location - Cosmos DB region, with spaces between words and each word capitalized.
  • instanceID - The instanceId GUID of a restorable database account.
  • options - RestorableTablesClientListOptions contains the optional parameters for the RestorableTablesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBRestorableTableList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableTablesClient().NewListPager("WestUS", "98a570f2-63db-4117-91f0-366327b7b353", &armcosmos.RestorableTablesClientListOptions{StartTime: nil,
	EndTime: 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.RestorableTablesListResult = armcosmos.RestorableTablesListResult{
	// 	Value: []*armcosmos.RestorableTableGetResult{
	// 		{
	// 			Name: to.Ptr("79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableTables"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableTables/79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Properties: &armcosmos.RestorableTableProperties{
	// 				Resource: &armcosmos.RestorableTablePropertiesResource{
	// 					Rid: to.Ptr("zAyAPQAAAA=="),
	// 					CanUndelete: to.Ptr("invalid"),
	// 					EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeCreate),
	// 					OwnerID: to.Ptr("Table1"),
	// 					OwnerResourceID: to.Ptr("V18LoLrv-qA="),
	// 				},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableTables"),
	// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableTables/79609a98-3394-41f8-911f-cfab0c075c86"),
	// 			Properties: &armcosmos.RestorableTableProperties{
	// 				Resource: &armcosmos.RestorableTablePropertiesResource{
	// 					Rid: to.Ptr("zAyAPQAAAA=="),
	// 					CanUndelete: to.Ptr("notRestorable"),
	// 					CanUndeleteReason: to.Ptr("Collection with same name already exist as live collection."),
	// 					EventTimestamp: to.Ptr("2020-10-13T04:56:42Z"),
	// 					OperationType: to.Ptr(armcosmos.OperationTypeDelete),
	// 					OwnerID: to.Ptr("Table1"),
	// 					OwnerResourceID: to.Ptr("V18LoLrv-qA="),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type RestorableTablesClientListOptions

type RestorableTablesClientListOptions struct {
	// Restorable Tables event feed end time.
	EndTime *string

	// Restorable Tables event feed start time.
	StartTime *string
}

RestorableTablesClientListOptions contains the optional parameters for the RestorableTablesClient.NewListPager method.

type RestorableTablesClientListResponse

type RestorableTablesClientListResponse struct {
	// The List operation response, that contains the Table events and their properties.
	RestorableTablesListResult
}

RestorableTablesClientListResponse contains the response from method RestorableTablesClient.NewListPager.

type RestorableTablesListResult

type RestorableTablesListResult struct {
	// READ-ONLY; List of Table events and their properties.
	Value []*RestorableTableGetResult
}

RestorableTablesListResult - The List operation response, that contains the Table events and their properties.

func (RestorableTablesListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableTablesListResult.

func (*RestorableTablesListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTablesListResult.

type RestoreMode

type RestoreMode string

RestoreMode - Describes the mode of the restore.

const (
	RestoreModePointInTime RestoreMode = "PointInTime"
)

func PossibleRestoreModeValues

func PossibleRestoreModeValues() []RestoreMode

PossibleRestoreModeValues returns the possible values for the RestoreMode const type.

type RestoreParameters

type RestoreParameters struct {
	// List of specific databases available for restore.
	DatabasesToRestore []*DatabaseRestoreResource

	// List of specific gremlin databases available for restore.
	GremlinDatabasesToRestore []*GremlinDatabaseRestoreResource

	// Describes the mode of the restore.
	RestoreMode *RestoreMode

	// The id of the restorable database account from which the restore has to be initiated. For example:
	// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
	RestoreSource *string

	// Time to which the account has to be restored (ISO-8601 format).
	RestoreTimestampInUTC *time.Time

	// Specifies whether the restored account will have Time-To-Live disabled upon the successful restore.
	RestoreWithTTLDisabled *bool

	// The source backup location for restore.
	SourceBackupLocation *string

	// List of specific tables available for restore.
	TablesToRestore []*string
}

RestoreParameters - Parameters to indicate the information about the restore.

func (RestoreParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestoreParameters.

func (*RestoreParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestoreParameters.

type RestoreParametersBase

type RestoreParametersBase struct {
	// The id of the restorable database account from which the restore has to be initiated. For example:
	// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
	RestoreSource *string

	// Time to which the account has to be restored (ISO-8601 format).
	RestoreTimestampInUTC *time.Time

	// Specifies whether the restored account will have Time-To-Live disabled upon the successful restore.
	RestoreWithTTLDisabled *bool
}

RestoreParametersBase - Parameters to indicate the information about the restore.

func (RestoreParametersBase) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestoreParametersBase.

func (*RestoreParametersBase) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestoreParametersBase.

type RetrieveThroughputParameters

type RetrieveThroughputParameters struct {
	// REQUIRED; Properties to retrieve throughput parameters object
	Properties *RetrieveThroughputProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

RetrieveThroughputParameters - Cosmos DB retrieve throughput parameters object

func (RetrieveThroughputParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RetrieveThroughputParameters.

func (*RetrieveThroughputParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveThroughputParameters.

type RetrieveThroughputProperties

type RetrieveThroughputProperties struct {
	// REQUIRED; The standard JSON format of a resource throughput
	Resource *RetrieveThroughputPropertiesResource
}

RetrieveThroughputProperties - Properties to retrieve throughput for Azure Cosmos DB resource.

func (RetrieveThroughputProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RetrieveThroughputProperties.

func (*RetrieveThroughputProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveThroughputProperties.

type RetrieveThroughputPropertiesResource

type RetrieveThroughputPropertiesResource struct {
	// REQUIRED; Array of PhysicalPartitionId objects.
	PhysicalPartitionIDs []*PhysicalPartitionID
}

RetrieveThroughputPropertiesResource - Resource to retrieve throughput information for Cosmos DB resource

func (RetrieveThroughputPropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RetrieveThroughputPropertiesResource.

func (*RetrieveThroughputPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveThroughputPropertiesResource.

type Role

type Role struct {
	// The database name the role is applied.
	Db *string

	// The role name.
	Role *string
}

Role - The set of roles permitted through this Role Definition.

func (Role) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Role.

func (*Role) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Role.

type RoleDefinitionType

type RoleDefinitionType string

RoleDefinitionType - Indicates whether the Role Definition was built-in or user created.

const (
	RoleDefinitionTypeBuiltInRole RoleDefinitionType = "BuiltInRole"
	RoleDefinitionTypeCustomRole  RoleDefinitionType = "CustomRole"
)

func PossibleRoleDefinitionTypeValues

func PossibleRoleDefinitionTypeValues() []RoleDefinitionType

PossibleRoleDefinitionTypeValues returns the possible values for the RoleDefinitionType const type.

type SQLContainerCreateUpdateParameters

type SQLContainerCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB container.
	Properties *SQLContainerCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLContainerCreateUpdateParameters - Parameters to create and update Cosmos DB container.

func (SQLContainerCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLContainerCreateUpdateParameters.

func (*SQLContainerCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLContainerCreateUpdateParameters.

type SQLContainerCreateUpdateProperties

type SQLContainerCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a container
	Resource *SQLContainerResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

SQLContainerCreateUpdateProperties - Properties to create and update Azure Cosmos DB container.

func (SQLContainerCreateUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLContainerCreateUpdateProperties.

func (*SQLContainerCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLContainerCreateUpdateProperties.

type SQLContainerGetProperties

type SQLContainerGetProperties struct {
	Options  *SQLContainerGetPropertiesOptions
	Resource *SQLContainerGetPropertiesResource
}

SQLContainerGetProperties - The properties of an Azure Cosmos DB container

func (SQLContainerGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLContainerGetProperties.

func (*SQLContainerGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLContainerGetProperties.

type SQLContainerGetPropertiesOptions

type SQLContainerGetPropertiesOptions struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

func (SQLContainerGetPropertiesOptions) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLContainerGetPropertiesOptions.

func (*SQLContainerGetPropertiesOptions) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLContainerGetPropertiesOptions.

type SQLContainerGetPropertiesResource

type SQLContainerGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB SQL container
	ID *string

	// Analytical TTL.
	AnalyticalStorageTTL *int64

	// The client encryption policy for the container.
	ClientEncryptionPolicy *ClientEncryptionPolicy

	// List of computed properties
	ComputedProperties []*ComputedProperty

	// The conflict resolution policy for the container.
	ConflictResolutionPolicy *ConflictResolutionPolicy

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Default time to live
	DefaultTTL *int32

	// The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container
	IndexingPolicy *IndexingPolicy

	// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container.
	MaterializedViewDefinition *MaterializedViewDefinition

	// The configuration of the partition key to be used for partitioning data into multiple partitions
	PartitionKey *ContainerPartitionKey

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos
	// DB service.
	UniqueKeyPolicy *UniqueKeyPolicy

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (SQLContainerGetPropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLContainerGetPropertiesResource.

func (*SQLContainerGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLContainerGetPropertiesResource.

type SQLContainerGetResults

type SQLContainerGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB container
	Properties *SQLContainerGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLContainerGetResults - An Azure Cosmos DB container.

func (SQLContainerGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLContainerGetResults.

func (*SQLContainerGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLContainerGetResults.

type SQLContainerListResult

type SQLContainerListResult struct {
	// READ-ONLY; List of containers and their properties.
	Value []*SQLContainerGetResults
}

SQLContainerListResult - The List operation response, that contains the containers and their properties.

func (SQLContainerListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLContainerListResult.

func (*SQLContainerListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLContainerListResult.

type SQLContainerResource

type SQLContainerResource struct {
	// REQUIRED; Name of the Cosmos DB SQL container
	ID *string

	// Analytical TTL.
	AnalyticalStorageTTL *int64

	// The client encryption policy for the container.
	ClientEncryptionPolicy *ClientEncryptionPolicy

	// List of computed properties
	ComputedProperties []*ComputedProperty

	// The conflict resolution policy for the container.
	ConflictResolutionPolicy *ConflictResolutionPolicy

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Default time to live
	DefaultTTL *int32

	// The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container
	IndexingPolicy *IndexingPolicy

	// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container.
	MaterializedViewDefinition *MaterializedViewDefinition

	// The configuration of the partition key to be used for partitioning data into multiple partitions
	PartitionKey *ContainerPartitionKey

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos
	// DB service.
	UniqueKeyPolicy *UniqueKeyPolicy
}

SQLContainerResource - Cosmos DB SQL container resource object

func (SQLContainerResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLContainerResource.

func (*SQLContainerResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLContainerResource.

type SQLDataTransferDataSourceSink

type SQLDataTransferDataSourceSink struct {
	// REQUIRED
	Component *DataTransferComponent

	// REQUIRED
	ContainerName *string

	// REQUIRED
	DatabaseName      *string
	RemoteAccountName *string
}

SQLDataTransferDataSourceSink - A CosmosDB No Sql API data source/sink

func (*SQLDataTransferDataSourceSink) GetBaseCosmosDataTransferDataSourceSink

func (s *SQLDataTransferDataSourceSink) GetBaseCosmosDataTransferDataSourceSink() *BaseCosmosDataTransferDataSourceSink

GetBaseCosmosDataTransferDataSourceSink implements the BaseCosmosDataTransferDataSourceSinkClassification interface for type SQLDataTransferDataSourceSink.

func (*SQLDataTransferDataSourceSink) GetDataTransferDataSourceSink

func (s *SQLDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink

GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type SQLDataTransferDataSourceSink.

func (SQLDataTransferDataSourceSink) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLDataTransferDataSourceSink.

func (*SQLDataTransferDataSourceSink) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDataTransferDataSourceSink.

type SQLDatabaseCreateUpdateParameters

type SQLDatabaseCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB SQL database.
	Properties *SQLDatabaseCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLDatabaseCreateUpdateParameters - Parameters to create and update Cosmos DB SQL database.

func (SQLDatabaseCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLDatabaseCreateUpdateParameters.

func (*SQLDatabaseCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseCreateUpdateParameters.

type SQLDatabaseCreateUpdateProperties

type SQLDatabaseCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a SQL database
	Resource *SQLDatabaseResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

SQLDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB SQL database.

func (SQLDatabaseCreateUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLDatabaseCreateUpdateProperties.

func (*SQLDatabaseCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseCreateUpdateProperties.

type SQLDatabaseGetProperties

type SQLDatabaseGetProperties struct {
	Options  *SQLDatabaseGetPropertiesOptions
	Resource *SQLDatabaseGetPropertiesResource
}

SQLDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database

func (SQLDatabaseGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLDatabaseGetProperties.

func (*SQLDatabaseGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseGetProperties.

type SQLDatabaseGetPropertiesOptions

type SQLDatabaseGetPropertiesOptions struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

func (SQLDatabaseGetPropertiesOptions) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLDatabaseGetPropertiesOptions.

func (*SQLDatabaseGetPropertiesOptions) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseGetPropertiesOptions.

type SQLDatabaseGetPropertiesResource

type SQLDatabaseGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB SQL database
	ID *string

	// A system generated property that specified the addressable path of the collections resource.
	Colls *string

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// A system generated property that specifies the addressable path of the users resource.
	Users *string

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (SQLDatabaseGetPropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLDatabaseGetPropertiesResource.

func (*SQLDatabaseGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseGetPropertiesResource.

type SQLDatabaseGetResults

type SQLDatabaseGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB SQL database
	Properties *SQLDatabaseGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLDatabaseGetResults - An Azure Cosmos DB SQL database.

func (SQLDatabaseGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLDatabaseGetResults.

func (*SQLDatabaseGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseGetResults.

type SQLDatabaseListResult

type SQLDatabaseListResult struct {
	// READ-ONLY; List of SQL databases and their properties.
	Value []*SQLDatabaseGetResults
}

SQLDatabaseListResult - The List operation response, that contains the SQL databases and their properties.

func (SQLDatabaseListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLDatabaseListResult.

func (*SQLDatabaseListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseListResult.

type SQLDatabaseResource

type SQLDatabaseResource struct {
	// REQUIRED; Name of the Cosmos DB SQL database
	ID *string

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters
}

SQLDatabaseResource - Cosmos DB SQL database resource object

func (SQLDatabaseResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLDatabaseResource.

func (*SQLDatabaseResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseResource.

type SQLDedicatedGatewayRegionalServiceResource

type SQLDedicatedGatewayRegionalServiceResource struct {
	// READ-ONLY; The location name.
	Location *string

	// READ-ONLY; The regional service name.
	Name *string

	// READ-ONLY; The regional endpoint for SqlDedicatedGateway.
	SQLDedicatedGatewayEndpoint *string

	// READ-ONLY; Describes the status of a service.
	Status *ServiceStatus
}

SQLDedicatedGatewayRegionalServiceResource - Resource for a regional service location.

func (SQLDedicatedGatewayRegionalServiceResource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type SQLDedicatedGatewayRegionalServiceResource.

func (*SQLDedicatedGatewayRegionalServiceResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDedicatedGatewayRegionalServiceResource.

type SQLDedicatedGatewayServiceResource

type SQLDedicatedGatewayServiceResource struct {
	// Properties for SqlDedicatedGatewayServiceResource.
	Properties *SQLDedicatedGatewayServiceResourceProperties
}

SQLDedicatedGatewayServiceResource - Describes the service response property for SqlDedicatedGateway.

func (SQLDedicatedGatewayServiceResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLDedicatedGatewayServiceResource.

func (*SQLDedicatedGatewayServiceResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDedicatedGatewayServiceResource.

type SQLDedicatedGatewayServiceResourceProperties

type SQLDedicatedGatewayServiceResourceProperties struct {
	// REQUIRED; ServiceType for the service.
	ServiceType *ServiceType

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

	// Instance count for the service.
	InstanceCount *int32

	// Instance type for the service.
	InstanceSize *ServiceSize

	// SqlDedicatedGateway endpoint for the service.
	SQLDedicatedGatewayEndpoint *string

	// READ-ONLY; Time of the last state change (ISO-8601 format).
	CreationTime *time.Time

	// READ-ONLY; An array that contains all of the locations for the service.
	Locations []*SQLDedicatedGatewayRegionalServiceResource

	// READ-ONLY; Describes the status of a service.
	Status *ServiceStatus
}

SQLDedicatedGatewayServiceResourceProperties - Properties for SqlDedicatedGatewayServiceResource.

func (*SQLDedicatedGatewayServiceResourceProperties) GetServiceResourceProperties

GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type SQLDedicatedGatewayServiceResourceProperties.

func (SQLDedicatedGatewayServiceResourceProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type SQLDedicatedGatewayServiceResourceProperties.

func (*SQLDedicatedGatewayServiceResourceProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLDedicatedGatewayServiceResourceProperties.

type SQLResourcesClient

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

SQLResourcesClient contains the methods for the SQLResources group. Don't use this type directly, use NewSQLResourcesClient() instead.

func NewSQLResourcesClient

func NewSQLResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLResourcesClient, error)

NewSQLResourcesClient creates a new instance of SQLResourcesClient with the specified values.

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

func (*SQLResourcesClient) BeginCreateUpdateClientEncryptionKey

func (client *SQLResourcesClient) BeginCreateUpdateClientEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, createUpdateClientEncryptionKeyParameters ClientEncryptionKeyCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateClientEncryptionKeyResponse], error)

BeginCreateUpdateClientEncryptionKey - Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • clientEncryptionKeyName - Cosmos DB ClientEncryptionKey name.
  • createUpdateClientEncryptionKeyParameters - The parameters to provide for the client encryption key.
  • options - SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateClientEncryptionKey method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateClientEncryptionKey(ctx, "rgName", "accountName", "databaseName", "cekName", armcosmos.ClientEncryptionKeyCreateUpdateParameters{
	Properties: &armcosmos.ClientEncryptionKeyCreateUpdateProperties{
		Resource: &armcosmos.ClientEncryptionKeyResource{
			EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
			ID:                  to.Ptr("cekName"),
			KeyWrapMetadata: &armcosmos.KeyWrapMetadata{
				Name:      to.Ptr("customerManagedKey"),
				Type:      to.Ptr("AzureKeyVault"),
				Algorithm: to.Ptr("RSA-OAEP"),
				Value:     to.Ptr("AzureKeyVault Key URL"),
			},
			WrappedDataEncryptionKey: []byte("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ClientEncryptionKeyGetResults = armcosmos.ClientEncryptionKeyGetResults{
// 	Name: to.Ptr("cekName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"),
// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName"),
// 	Properties: &armcosmos.ClientEncryptionKeyGetProperties{
// 		Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{
// 			EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
// 			ID: to.Ptr("cekName"),
// 			KeyWrapMetadata: &armcosmos.KeyWrapMetadata{
// 				Name: to.Ptr("customerManagedKey"),
// 				Type: to.Ptr("AzureKeyVault"),
// 				Algorithm: to.Ptr("RSA-OAEP"),
// 				Value: to.Ptr("AzureKeyVault Key URL"),
// 			},
// 			WrappedDataEncryptionKey: []byte("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="),
// 			Etag: to.Ptr("00000000-0000-0000-7a1f-bc0828e801d7"),
// 			Rid: to.Ptr("tNc4AAAAAAAQkjzWAgAAAA=="),
// 			Ts: to.Ptr[float32](1626425552),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginCreateUpdateSQLContainer

func (client *SQLResourcesClient) BeginCreateUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLContainerOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateSQLContainerResponse], error)

BeginCreateUpdateSQLContainer - Create or update an Azure Cosmos DB SQL container If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • createUpdateSQLContainerParameters - The parameters to provide for the current SQL container.
  • options - SQLResourcesClientBeginCreateUpdateSQLContainerOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLContainer method.
Example (CosmosDbSqlContainerCreateUpdate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLContainer(ctx, "rg1", "ddb1", "databaseName", "containerName", armcosmos.SQLContainerCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.SQLContainerCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.SQLContainerResource{
			ClientEncryptionPolicy: &armcosmos.ClientEncryptionPolicy{
				IncludedPaths: []*armcosmos.ClientEncryptionIncludedPath{
					{
						Path:                  to.Ptr("/path"),
						ClientEncryptionKeyID: to.Ptr("keyId"),
						EncryptionAlgorithm:   to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
						EncryptionType:        to.Ptr("Deterministic"),
					}},
				PolicyFormatVersion: to.Ptr[int32](2),
			},
			ComputedProperties: []*armcosmos.ComputedProperty{
				{
					Name:  to.Ptr("cp_lowerName"),
					Query: to.Ptr("SELECT VALUE LOWER(c.name) FROM c"),
				}},
			ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
				ConflictResolutionPath: to.Ptr("/path"),
				Mode:                   to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
			},
			DefaultTTL: to.Ptr[int32](100),
			ID:         to.Ptr("containerName"),
			IndexingPolicy: &armcosmos.IndexingPolicy{
				Automatic:     to.Ptr(true),
				ExcludedPaths: []*armcosmos.ExcludedPath{},
				IncludedPaths: []*armcosmos.IncludedPath{
					{
						Path: to.Ptr("/*"),
						Indexes: []*armcosmos.Indexes{
							{
								DataType:  to.Ptr(armcosmos.DataTypeString),
								Kind:      to.Ptr(armcosmos.IndexKindRange),
								Precision: to.Ptr[int32](-1),
							},
							{
								DataType:  to.Ptr(armcosmos.DataTypeNumber),
								Kind:      to.Ptr(armcosmos.IndexKindRange),
								Precision: to.Ptr[int32](-1),
							}},
					}},
				IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
			},
			PartitionKey: &armcosmos.ContainerPartitionKey{
				Kind: to.Ptr(armcosmos.PartitionKindHash),
				Paths: []*string{
					to.Ptr("/AccountNumber")},
			},
			UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
				UniqueKeys: []*armcosmos.UniqueKey{
					{
						Paths: []*string{
							to.Ptr("/testPath")},
					}},
			},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.SQLContainerGetResults = armcosmos.SQLContainerGetResults{
// 	Name: to.Ptr("containerName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/containers/containerName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.SQLContainerGetProperties{
// 		Resource: &armcosmos.SQLContainerGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			ClientEncryptionPolicy: &armcosmos.ClientEncryptionPolicy{
// 				IncludedPaths: []*armcosmos.ClientEncryptionIncludedPath{
// 					{
// 						Path: to.Ptr("/path"),
// 						ClientEncryptionKeyID: to.Ptr("keyId"),
// 						EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
// 						EncryptionType: to.Ptr("Deterministic"),
// 				}},
// 				PolicyFormatVersion: to.Ptr[int32](1),
// 			},
// 			ComputedProperties: []*armcosmos.ComputedProperty{
// 				{
// 					Name: to.Ptr("cp_lowerName"),
// 					Query: to.Ptr("SELECT VALUE LOWER(c.name) FROM c"),
// 			}},
// 			ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
// 				ConflictResolutionPath: to.Ptr("/path"),
// 				Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
// 			},
// 			DefaultTTL: to.Ptr[int32](100),
// 			ID: to.Ptr("containerName"),
// 			IndexingPolicy: &armcosmos.IndexingPolicy{
// 				Automatic: to.Ptr(true),
// 				ExcludedPaths: []*armcosmos.ExcludedPath{
// 				},
// 				IncludedPaths: []*armcosmos.IncludedPath{
// 					{
// 						Path: to.Ptr("/*"),
// 						Indexes: []*armcosmos.Indexes{
// 							{
// 								DataType: to.Ptr(armcosmos.DataTypeString),
// 								Kind: to.Ptr(armcosmos.IndexKindRange),
// 								Precision: to.Ptr[int32](-1),
// 							},
// 							{
// 								DataType: to.Ptr(armcosmos.DataTypeNumber),
// 								Kind: to.Ptr(armcosmos.IndexKindRange),
// 								Precision: to.Ptr[int32](-1),
// 						}},
// 				}},
// 				IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
// 			},
// 			PartitionKey: &armcosmos.ContainerPartitionKey{
// 				Kind: to.Ptr(armcosmos.PartitionKindHash),
// 				Paths: []*string{
// 					to.Ptr("/AccountNumber")},
// 				},
// 				UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
// 					UniqueKeys: []*armcosmos.UniqueKey{
// 						{
// 							Paths: []*string{
// 								to.Ptr("/testPath")},
// 						}},
// 					},
// 				},
// 			},
// 		}
Output:

Example (CosmosDbSqlContainerRestore)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerRestore.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLContainer(ctx, "rg1", "ddb1", "databaseName", "containerName", armcosmos.SQLContainerCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.SQLContainerCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.SQLContainerResource{
			CreateMode: to.Ptr(armcosmos.CreateModeRestore),
			ID:         to.Ptr("containerName"),
			RestoreParameters: &armcosmos.ResourceRestoreParameters{
				RestoreSource:          to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId"),
				RestoreTimestampInUTC:  to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-20T18:28:00.000Z"); return t }()),
				RestoreWithTTLDisabled: to.Ptr(true),
			},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.SQLContainerGetResults = armcosmos.SQLContainerGetResults{
// 	Name: to.Ptr("containerName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/containers/containerName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.SQLContainerGetProperties{
// 		Resource: &armcosmos.SQLContainerGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			ClientEncryptionPolicy: &armcosmos.ClientEncryptionPolicy{
// 				IncludedPaths: []*armcosmos.ClientEncryptionIncludedPath{
// 					{
// 						Path: to.Ptr("/path"),
// 						ClientEncryptionKeyID: to.Ptr("keyId"),
// 						EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
// 						EncryptionType: to.Ptr("Deterministic"),
// 				}},
// 				PolicyFormatVersion: to.Ptr[int32](1),
// 			},
// 			ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
// 				ConflictResolutionPath: to.Ptr("/path"),
// 				Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
// 			},
// 			DefaultTTL: to.Ptr[int32](100),
// 			ID: to.Ptr("containerName"),
// 			IndexingPolicy: &armcosmos.IndexingPolicy{
// 				Automatic: to.Ptr(true),
// 				ExcludedPaths: []*armcosmos.ExcludedPath{
// 				},
// 				IncludedPaths: []*armcosmos.IncludedPath{
// 					{
// 						Path: to.Ptr("/*"),
// 						Indexes: []*armcosmos.Indexes{
// 							{
// 								DataType: to.Ptr(armcosmos.DataTypeString),
// 								Kind: to.Ptr(armcosmos.IndexKindRange),
// 								Precision: to.Ptr[int32](-1),
// 							},
// 							{
// 								DataType: to.Ptr(armcosmos.DataTypeNumber),
// 								Kind: to.Ptr(armcosmos.IndexKindRange),
// 								Precision: to.Ptr[int32](-1),
// 						}},
// 				}},
// 				IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
// 			},
// 			PartitionKey: &armcosmos.ContainerPartitionKey{
// 				Kind: to.Ptr(armcosmos.PartitionKindHash),
// 				Paths: []*string{
// 					to.Ptr("/AccountNumber")},
// 				},
// 				UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
// 					UniqueKeys: []*armcosmos.UniqueKey{
// 						{
// 							Paths: []*string{
// 								to.Ptr("/testPath")},
// 						}},
// 					},
// 				},
// 			},
// 		}
Output:

Example (CosmosDbSqlMaterializedViewCreateUpdate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLContainer(ctx, "rg1", "ddb1", "databaseName", "mvContainerName", armcosmos.SQLContainerCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.SQLContainerCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.SQLContainerResource{
			ID: to.Ptr("mvContainerName"),
			IndexingPolicy: &armcosmos.IndexingPolicy{
				Automatic:     to.Ptr(true),
				ExcludedPaths: []*armcosmos.ExcludedPath{},
				IncludedPaths: []*armcosmos.IncludedPath{
					{
						Path: to.Ptr("/*"),
						Indexes: []*armcosmos.Indexes{
							{
								DataType:  to.Ptr(armcosmos.DataTypeString),
								Kind:      to.Ptr(armcosmos.IndexKindRange),
								Precision: to.Ptr[int32](-1),
							},
							{
								DataType:  to.Ptr(armcosmos.DataTypeNumber),
								Kind:      to.Ptr(armcosmos.IndexKindRange),
								Precision: to.Ptr[int32](-1),
							}},
					}},
				IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
			},
			MaterializedViewDefinition: &armcosmos.MaterializedViewDefinition{
				Definition:         to.Ptr("select * from ROOT"),
				SourceCollectionID: to.Ptr("sourceContainerName"),
			},
			PartitionKey: &armcosmos.ContainerPartitionKey{
				Kind: to.Ptr(armcosmos.PartitionKindHash),
				Paths: []*string{
					to.Ptr("/mvpk")},
			},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.SQLContainerGetResults = armcosmos.SQLContainerGetResults{
// 	Name: to.Ptr("mvContainerName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/containers/mvContainerName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.SQLContainerGetProperties{
// 		Resource: &armcosmos.SQLContainerGetPropertiesResource{
// 			Etag: to.Ptr("\"00000800-0000-0200-0000-639ff6480000\""),
// 			Rid: to.Ptr("vb0sn8MDxLw="),
// 			Ts: to.Ptr[float32](1671427656),
// 			ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
// 				ConflictResolutionPath: to.Ptr("/_ts"),
// 				ConflictResolutionProcedure: to.Ptr(""),
// 				Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
// 			},
// 			DefaultTTL: to.Ptr[int32](-1),
// 			ID: to.Ptr("mvContainerName"),
// 			IndexingPolicy: &armcosmos.IndexingPolicy{
// 				Automatic: to.Ptr(true),
// 				ExcludedPaths: []*armcosmos.ExcludedPath{
// 					{
// 						Path: to.Ptr("/\"_etag\"/?"),
// 				}},
// 				IncludedPaths: []*armcosmos.IncludedPath{
// 					{
// 						Path: to.Ptr("/*"),
// 				}},
// 				IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
// 			},
// 			MaterializedViewDefinition: &armcosmos.MaterializedViewDefinition{
// 				Definition: to.Ptr("select * from ROOT"),
// 				SourceCollectionID: to.Ptr("sourceContainerName"),
// 				SourceCollectionRid: to.Ptr("vb0sn6nEu9A="),
// 			},
// 			PartitionKey: &armcosmos.ContainerPartitionKey{
// 				Kind: to.Ptr(armcosmos.PartitionKindHash),
// 				Paths: []*string{
// 					to.Ptr("/mvpk")},
// 				},
// 				UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
// 					UniqueKeys: []*armcosmos.UniqueKey{
// 					},
// 				},
// 			},
// 		},
// 	}
Output:

func (*SQLResourcesClient) BeginCreateUpdateSQLDatabase

func (client *SQLResourcesClient) BeginCreateUpdateSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters SQLDatabaseCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLDatabaseOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateSQLDatabaseResponse], error)

BeginCreateUpdateSQLDatabase - Create or update an Azure Cosmos DB SQL database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • createUpdateSQLDatabaseParameters - The parameters to provide for the current SQL database.
  • options - SQLResourcesClientBeginCreateUpdateSQLDatabaseOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLDatabase method.
Example (CosmosDbSqlDatabaseCreateUpdate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLDatabase(ctx, "rg1", "ddb1", "databaseName", armcosmos.SQLDatabaseCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.SQLDatabaseCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.SQLDatabaseResource{
			ID: to.Ptr("databaseName"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.SQLDatabaseGetResults = armcosmos.SQLDatabaseGetResults{
// 	Name: to.Ptr("databaseName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.SQLDatabaseGetProperties{
// 		Resource: &armcosmos.SQLDatabaseGetPropertiesResource{
// 			Etag: to.Ptr("\"00000a00-0000-0000-0000-56672f920000\""),
// 			Rid: to.Ptr("CqNBAA=="),
// 			Ts: to.Ptr[float32](1449602962),
// 			ID: to.Ptr("databaseName"),
// 		},
// 	},
// }
Output:

Example (CosmosDbSqlDatabaseRestore)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseRestore.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLDatabase(ctx, "rg1", "ddb1", "databaseName", armcosmos.SQLDatabaseCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.SQLDatabaseCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.SQLDatabaseResource{
			CreateMode: to.Ptr(armcosmos.CreateModeRestore),
			ID:         to.Ptr("databaseName"),
			RestoreParameters: &armcosmos.ResourceRestoreParameters{
				RestoreSource:          to.Ptr("/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId"),
				RestoreTimestampInUTC:  to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-20T18:28:00.000Z"); return t }()),
				RestoreWithTTLDisabled: to.Ptr(true),
			},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.SQLDatabaseGetResults = armcosmos.SQLDatabaseGetResults{
// 	Name: to.Ptr("databaseName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.SQLDatabaseGetProperties{
// 		Resource: &armcosmos.SQLDatabaseGetPropertiesResource{
// 			Etag: to.Ptr("\"00000a00-0000-0000-0000-56672f920000\""),
// 			Rid: to.Ptr("CqNBAA=="),
// 			Ts: to.Ptr[float32](1449602962),
// 			ID: to.Ptr("databaseName"),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginCreateUpdateSQLRoleAssignment

func (client *SQLResourcesClient) BeginCreateUpdateSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, createUpdateSQLRoleAssignmentParameters SQLRoleAssignmentCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLRoleAssignmentOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateSQLRoleAssignmentResponse], error)

BeginCreateUpdateSQLRoleAssignment - Creates or updates an Azure Cosmos DB SQL Role Assignment. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • roleAssignmentID - The GUID for the Role Assignment.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • createUpdateSQLRoleAssignmentParameters - The properties required to create or update a Role Assignment.
  • options - SQLResourcesClientBeginCreateUpdateSQLRoleAssignmentOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLRoleAssignment method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLRoleAssignment(ctx, "myRoleAssignmentId", "myResourceGroupName", "myAccountName", armcosmos.SQLRoleAssignmentCreateUpdateParameters{
	Properties: &armcosmos.SQLRoleAssignmentResource{
		PrincipalID:      to.Ptr("myPrincipalId"),
		RoleDefinitionID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"),
		Scope:            to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.SQLRoleAssignmentGetResults = armcosmos.SQLRoleAssignmentGetResults{
// 	Name: to.Ptr("myRoleAssignmentId"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments"),
// 	ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleAssignments/myRoleAssignmentId"),
// 	Properties: &armcosmos.SQLRoleAssignmentResource{
// 		PrincipalID: to.Ptr("myPrincipalId"),
// 		RoleDefinitionID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"),
// 		Scope: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases"),
// 	},
// }
Output:

func (*SQLResourcesClient) BeginCreateUpdateSQLRoleDefinition

func (client *SQLResourcesClient) BeginCreateUpdateSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, createUpdateSQLRoleDefinitionParameters SQLRoleDefinitionCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLRoleDefinitionOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateSQLRoleDefinitionResponse], error)

BeginCreateUpdateSQLRoleDefinition - Creates or updates an Azure Cosmos DB SQL Role Definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • roleDefinitionID - The GUID for the Role Definition.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • createUpdateSQLRoleDefinitionParameters - The properties required to create or update a Role Definition.
  • options - SQLResourcesClientBeginCreateUpdateSQLRoleDefinitionOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLRoleDefinition method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLRoleDefinition(ctx, "myRoleDefinitionId", "myResourceGroupName", "myAccountName", armcosmos.SQLRoleDefinitionCreateUpdateParameters{
	Properties: &armcosmos.SQLRoleDefinitionResource{
		Type: to.Ptr(armcosmos.RoleDefinitionTypeCustomRole),
		AssignableScopes: []*string{
			to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales"),
			to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases")},
		Permissions: []*armcosmos.Permission{
			{
				DataActions: []*string{
					to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create"),
					to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read")},
				NotDataActions: []*string{},
			}},
		RoleName: to.Ptr("myRoleName"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.SQLRoleDefinitionGetResults = armcosmos.SQLRoleDefinitionGetResults{
// 	Name: to.Ptr("myRoleDefinitionId"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions"),
// 	ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"),
// 	Properties: &armcosmos.SQLRoleDefinitionResource{
// 		Type: to.Ptr(armcosmos.RoleDefinitionTypeCustomRole),
// 		AssignableScopes: []*string{
// 			to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales"),
// 			to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases")},
// 			Permissions: []*armcosmos.Permission{
// 				{
// 					DataActions: []*string{
// 						to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create"),
// 						to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read")},
// 				}},
// 				RoleName: to.Ptr("myRoleName"),
// 			},
// 		}
Output:

func (*SQLResourcesClient) BeginCreateUpdateSQLStoredProcedure

func (client *SQLResourcesClient) BeginCreateUpdateSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, createUpdateSQLStoredProcedureParameters SQLStoredProcedureCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLStoredProcedureOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateSQLStoredProcedureResponse], error)

BeginCreateUpdateSQLStoredProcedure - Create or update an Azure Cosmos DB SQL storedProcedure If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • storedProcedureName - Cosmos DB storedProcedure name.
  • createUpdateSQLStoredProcedureParameters - The parameters to provide for the current SQL storedProcedure.
  • options - SQLResourcesClientBeginCreateUpdateSQLStoredProcedureOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLStoredProcedure method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLStoredProcedure(ctx, "rg1", "ddb1", "databaseName", "containerName", "storedProcedureName", armcosmos.SQLStoredProcedureCreateUpdateParameters{
	Properties: &armcosmos.SQLStoredProcedureCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.SQLStoredProcedureResource{
			Body: to.Ptr("body"),
			ID:   to.Ptr("storedProcedureName"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.SQLStoredProcedureGetResults = armcosmos.SQLStoredProcedureGetResults{
// 	Name: to.Ptr("storedProcedureName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlStoredProcedures"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlStoredProcedures/storedProcedureName"),
// 	Properties: &armcosmos.SQLStoredProcedureGetProperties{
// 		Resource: &armcosmos.SQLStoredProcedureGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			Body: to.Ptr("body"),
// 			ID: to.Ptr("storedProcedureName"),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginCreateUpdateSQLTrigger

func (client *SQLResourcesClient) BeginCreateUpdateSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, createUpdateSQLTriggerParameters SQLTriggerCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLTriggerOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateSQLTriggerResponse], error)

BeginCreateUpdateSQLTrigger - Create or update an Azure Cosmos DB SQL trigger If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • triggerName - Cosmos DB trigger name.
  • createUpdateSQLTriggerParameters - The parameters to provide for the current SQL trigger.
  • options - SQLResourcesClientBeginCreateUpdateSQLTriggerOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLTrigger method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlTriggerCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLTrigger(ctx, "rg1", "ddb1", "databaseName", "containerName", "triggerName", armcosmos.SQLTriggerCreateUpdateParameters{
	Properties: &armcosmos.SQLTriggerCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.SQLTriggerResource{
			Body:             to.Ptr("body"),
			ID:               to.Ptr("triggerName"),
			TriggerOperation: to.Ptr(armcosmos.TriggerOperation("triggerOperation")),
			TriggerType:      to.Ptr(armcosmos.TriggerType("triggerType")),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.SQLTriggerGetResults = armcosmos.SQLTriggerGetResults{
// 	Name: to.Ptr("triggerName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlTriggers"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlTriggers/triggerName"),
// 	Properties: &armcosmos.SQLTriggerGetProperties{
// 		Resource: &armcosmos.SQLTriggerGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			Body: to.Ptr("body"),
// 			ID: to.Ptr("triggerName"),
// 			TriggerOperation: to.Ptr(armcosmos.TriggerOperation("triggerOperation")),
// 			TriggerType: to.Ptr(armcosmos.TriggerType("triggerType")),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginCreateUpdateSQLUserDefinedFunction

func (client *SQLResourcesClient) BeginCreateUpdateSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, createUpdateSQLUserDefinedFunctionParameters SQLUserDefinedFunctionCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLUserDefinedFunctionOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateSQLUserDefinedFunctionResponse], error)

BeginCreateUpdateSQLUserDefinedFunction - Create or update an Azure Cosmos DB SQL userDefinedFunction If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • userDefinedFunctionName - Cosmos DB userDefinedFunction name.
  • createUpdateSQLUserDefinedFunctionParameters - The parameters to provide for the current SQL userDefinedFunction.
  • options - SQLResourcesClientBeginCreateUpdateSQLUserDefinedFunctionOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLUserDefinedFunction method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginCreateUpdateSQLUserDefinedFunction(ctx, "rg1", "ddb1", "databaseName", "containerName", "userDefinedFunctionName", armcosmos.SQLUserDefinedFunctionCreateUpdateParameters{
	Properties: &armcosmos.SQLUserDefinedFunctionCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.SQLUserDefinedFunctionResource{
			Body: to.Ptr("body"),
			ID:   to.Ptr("userDefinedFunctionName"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.SQLUserDefinedFunctionGetResults = armcosmos.SQLUserDefinedFunctionGetResults{
// 	Name: to.Ptr("userDefinedFunctionName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlUserDefinedFunctions"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlUserDefinedFunctions/userDefinedFunctionName"),
// 	Properties: &armcosmos.SQLUserDefinedFunctionGetProperties{
// 		Resource: &armcosmos.SQLUserDefinedFunctionGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			Body: to.Ptr("body"),
// 			ID: to.Ptr("userDefinedFunctionName"),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginDeleteSQLContainer

func (client *SQLResourcesClient) BeginDeleteSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginDeleteSQLContainerOptions) (*runtime.Poller[SQLResourcesClientDeleteSQLContainerResponse], error)

BeginDeleteSQLContainer - Deletes an existing Azure Cosmos DB SQL container. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • options - SQLResourcesClientBeginDeleteSQLContainerOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLContainer method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginDeleteSQLContainer(ctx, "rg1", "ddb1", "databaseName", "containerName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*SQLResourcesClient) BeginDeleteSQLDatabase

func (client *SQLResourcesClient) BeginDeleteSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginDeleteSQLDatabaseOptions) (*runtime.Poller[SQLResourcesClientDeleteSQLDatabaseResponse], error)

BeginDeleteSQLDatabase - Deletes an existing Azure Cosmos DB SQL database. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - SQLResourcesClientBeginDeleteSQLDatabaseOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLDatabase method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginDeleteSQLDatabase(ctx, "rg1", "ddb1", "databaseName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*SQLResourcesClient) BeginDeleteSQLRoleAssignment

func (client *SQLResourcesClient) BeginDeleteSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, options *SQLResourcesClientBeginDeleteSQLRoleAssignmentOptions) (*runtime.Poller[SQLResourcesClientDeleteSQLRoleAssignmentResponse], error)

BeginDeleteSQLRoleAssignment - Deletes an existing Azure Cosmos DB SQL Role Assignment. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • roleAssignmentID - The GUID for the Role Assignment.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - SQLResourcesClientBeginDeleteSQLRoleAssignmentOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLRoleAssignment method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleAssignmentDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginDeleteSQLRoleAssignment(ctx, "myRoleAssignmentId", "myResourceGroupName", "myAccountName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*SQLResourcesClient) BeginDeleteSQLRoleDefinition

func (client *SQLResourcesClient) BeginDeleteSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, options *SQLResourcesClientBeginDeleteSQLRoleDefinitionOptions) (*runtime.Poller[SQLResourcesClientDeleteSQLRoleDefinitionResponse], error)

BeginDeleteSQLRoleDefinition - Deletes an existing Azure Cosmos DB SQL Role Definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • roleDefinitionID - The GUID for the Role Definition.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - SQLResourcesClientBeginDeleteSQLRoleDefinitionOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLRoleDefinition method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleDefinitionDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginDeleteSQLRoleDefinition(ctx, "myRoleDefinitionId", "myResourceGroupName", "myAccountName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*SQLResourcesClient) BeginDeleteSQLStoredProcedure

func (client *SQLResourcesClient) BeginDeleteSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, options *SQLResourcesClientBeginDeleteSQLStoredProcedureOptions) (*runtime.Poller[SQLResourcesClientDeleteSQLStoredProcedureResponse], error)

BeginDeleteSQLStoredProcedure - Deletes an existing Azure Cosmos DB SQL storedProcedure. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • storedProcedureName - Cosmos DB storedProcedure name.
  • options - SQLResourcesClientBeginDeleteSQLStoredProcedureOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLStoredProcedure method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlStoredProcedureDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginDeleteSQLStoredProcedure(ctx, "rg1", "ddb1", "databaseName", "containerName", "storedProcedureName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*SQLResourcesClient) BeginDeleteSQLTrigger

func (client *SQLResourcesClient) BeginDeleteSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, options *SQLResourcesClientBeginDeleteSQLTriggerOptions) (*runtime.Poller[SQLResourcesClientDeleteSQLTriggerResponse], error)

BeginDeleteSQLTrigger - Deletes an existing Azure Cosmos DB SQL trigger. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • triggerName - Cosmos DB trigger name.
  • options - SQLResourcesClientBeginDeleteSQLTriggerOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLTrigger method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlTriggerDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginDeleteSQLTrigger(ctx, "rg1", "ddb1", "databaseName", "containerName", "triggerName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*SQLResourcesClient) BeginDeleteSQLUserDefinedFunction

func (client *SQLResourcesClient) BeginDeleteSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, options *SQLResourcesClientBeginDeleteSQLUserDefinedFunctionOptions) (*runtime.Poller[SQLResourcesClientDeleteSQLUserDefinedFunctionResponse], error)

BeginDeleteSQLUserDefinedFunction - Deletes an existing Azure Cosmos DB SQL userDefinedFunction. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • userDefinedFunctionName - Cosmos DB userDefinedFunction name.
  • options - SQLResourcesClientBeginDeleteSQLUserDefinedFunctionOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLUserDefinedFunction method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginDeleteSQLUserDefinedFunction(ctx, "rg1", "ddb1", "databaseName", "containerName", "userDefinedFunctionName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*SQLResourcesClient) BeginListSQLContainerPartitionMerge

func (client *SQLResourcesClient) BeginListSQLContainerPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (*runtime.Poller[SQLResourcesClientListSQLContainerPartitionMergeResponse], error)

BeginListSQLContainerPartitionMerge - Merges the partitions of a SQL Container If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • mergeParameters - The parameters for the merge operation.
  • options - SQLResourcesClientBeginListSQLContainerPartitionMergeOptions contains the optional parameters for the SQLResourcesClient.BeginListSQLContainerPartitionMerge method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerPartitionMerge.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginListSQLContainerPartitionMerge(ctx, "rgName", "ddb1", "databaseName", "containerName", armcosmos.MergeParameters{
	IsDryRun: to.Ptr(false),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionStorageInfoCollection = armcosmos.PhysicalPartitionStorageInfoCollection{
// 	PhysicalPartitionStorageInfoCollection: []*armcosmos.PhysicalPartitionStorageInfo{
// 		{
// 			ID: to.Ptr("0"),
// 			StorageInKB: to.Ptr[float64](333),
// 		},
// 		{
// 			ID: to.Ptr("1"),
// 			StorageInKB: to.Ptr[float64](305),
// 		},
// 		{
// 			ID: to.Ptr("177"),
// 			StorageInKB: to.Ptr[float64](368),
// 		},
// 		{
// 			ID: to.Ptr("178"),
// 			StorageInKB: to.Ptr[float64](96313),
// 		},
// 		{
// 			ID: to.Ptr("5"),
// 			StorageInKB: to.Ptr[float64](194),
// 		},
// 		{
// 			ID: to.Ptr("6"),
// 			StorageInKB: to.Ptr[float64](331),
// 	}},
// }
Output:

func (*SQLResourcesClient) BeginMigrateSQLContainerToAutoscale

func (client *SQLResourcesClient) BeginMigrateSQLContainerToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions) (*runtime.Poller[SQLResourcesClientMigrateSQLContainerToAutoscaleResponse], error)

BeginMigrateSQLContainerToAutoscale - Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • options - SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions contains the optional parameters for the SQLResourcesClient.BeginMigrateSQLContainerToAutoscale method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginMigrateSQLContainerToAutoscale(ctx, "rg1", "ddb1", "databaseName", "containerName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			AutoscaleSettings: &armcosmos.AutoscaleSettingsResource{
// 				MaxThroughput: to.Ptr[int32](4000),
// 			},
// 			MinimumThroughput: to.Ptr("4000"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginMigrateSQLContainerToManualThroughput

func (client *SQLResourcesClient) BeginMigrateSQLContainerToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginMigrateSQLContainerToManualThroughputOptions) (*runtime.Poller[SQLResourcesClientMigrateSQLContainerToManualThroughputResponse], error)

BeginMigrateSQLContainerToManualThroughput - Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • options - SQLResourcesClientBeginMigrateSQLContainerToManualThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginMigrateSQLContainerToManualThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginMigrateSQLContainerToManualThroughput(ctx, "rg1", "ddb1", "databaseName", "containerName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginMigrateSQLDatabaseToAutoscale

func (client *SQLResourcesClient) BeginMigrateSQLDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginMigrateSQLDatabaseToAutoscaleOptions) (*runtime.Poller[SQLResourcesClientMigrateSQLDatabaseToAutoscaleResponse], error)

BeginMigrateSQLDatabaseToAutoscale - Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - SQLResourcesClientBeginMigrateSQLDatabaseToAutoscaleOptions contains the optional parameters for the SQLResourcesClient.BeginMigrateSQLDatabaseToAutoscale method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginMigrateSQLDatabaseToAutoscale(ctx, "rg1", "ddb1", "databaseName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			AutoscaleSettings: &armcosmos.AutoscaleSettingsResource{
// 				MaxThroughput: to.Ptr[int32](4000),
// 			},
// 			MinimumThroughput: to.Ptr("4000"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginMigrateSQLDatabaseToManualThroughput

func (client *SQLResourcesClient) BeginMigrateSQLDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginMigrateSQLDatabaseToManualThroughputOptions) (*runtime.Poller[SQLResourcesClientMigrateSQLDatabaseToManualThroughputResponse], error)

BeginMigrateSQLDatabaseToManualThroughput - Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - SQLResourcesClientBeginMigrateSQLDatabaseToManualThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginMigrateSQLDatabaseToManualThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginMigrateSQLDatabaseToManualThroughput(ctx, "rg1", "ddb1", "databaseName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginRetrieveContinuousBackupInformation

func (client *SQLResourcesClient) BeginRetrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, location ContinuousBackupRestoreLocation, options *SQLResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*runtime.Poller[SQLResourcesClientRetrieveContinuousBackupInformationResponse], error)

BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a container resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • location - The name of the continuous backup restore location.
  • options - SQLResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the SQLResourcesClient.BeginRetrieveContinuousBackupInformation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerBackupInformation.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginRetrieveContinuousBackupInformation(ctx, "rgName", "ddb1", "databaseName", "containerName", armcosmos.ContinuousBackupRestoreLocation{
	Location: to.Ptr("North Europe"),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.BackupInformation = armcosmos.BackupInformation{
// 	ContinuousBackupInformation: &armcosmos.ContinuousBackupInformation{
// 		LatestRestorableTimestamp: to.Ptr("2021-02-05T02:40:50Z"),
// 	},
// }
Output:

func (*SQLResourcesClient) BeginSQLContainerRedistributeThroughput

func (client *SQLResourcesClient) BeginSQLContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (*runtime.Poller[SQLResourcesClientSQLContainerRedistributeThroughputResponse], error)

BeginSQLContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL container If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • redistributeThroughputParameters - The parameters to provide for redistributing throughput for the current SQL container.
  • options - SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginSQLContainerRedistributeThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginSQLContainerRedistributeThroughput(ctx, "rg1", "ddb1", "databaseName", "containerName", armcosmos.RedistributeThroughputParameters{
	Properties: &armcosmos.RedistributeThroughputProperties{
		Resource: &armcosmos.RedistributeThroughputPropertiesResource{
			SourcePhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
				{
					ID:         to.Ptr("2"),
					Throughput: to.Ptr[float64](5000),
				},
				{
					ID: to.Ptr("3"),
				}},
			TargetPhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
				{
					ID:         to.Ptr("0"),
					Throughput: to.Ptr[float64](5000),
				},
				{
					ID:         to.Ptr("1"),
					Throughput: to.Ptr[float64](5000),
				}},
			ThroughputPolicy: to.Ptr(armcosmos.ThroughputPolicyTypeCustom),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{
// 	Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{
// 		Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{
// 			PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
// 				{
// 					ID: to.Ptr("0"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("1"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("2"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("3"),
// 					Throughput: to.Ptr[float64](3000),
// 			}},
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginSQLContainerRetrieveThroughputDistribution

func (client *SQLResourcesClient) BeginSQLContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (*runtime.Poller[SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse], error)

BeginSQLContainerRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB SQL container If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • retrieveThroughputParameters - The parameters to provide for retrieving throughput distribution for the current SQL container.
  • options - SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions contains the optional parameters for the SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginSQLContainerRetrieveThroughputDistribution(ctx, "rg1", "ddb1", "databaseName", "containerName", armcosmos.RetrieveThroughputParameters{
	Properties: &armcosmos.RetrieveThroughputProperties{
		Resource: &armcosmos.RetrieveThroughputPropertiesResource{
			PhysicalPartitionIDs: []*armcosmos.PhysicalPartitionID{
				{
					ID: to.Ptr("0"),
				},
				{
					ID: to.Ptr("1"),
				}},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{
// 	Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{
// 		Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{
// 			PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
// 				{
// 					ID: to.Ptr("0"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("1"),
// 					Throughput: to.Ptr[float64](5000),
// 			}},
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginSQLDatabasePartitionMerge

func (client *SQLResourcesClient) BeginSQLDatabasePartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginSQLDatabasePartitionMergeOptions) (*runtime.Poller[SQLResourcesClientSQLDatabasePartitionMergeResponse], error)

BeginSQLDatabasePartitionMerge - Merges the partitions of a SQL database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • mergeParameters - The parameters for the merge operation.
  • options - SQLResourcesClientBeginSQLDatabasePartitionMergeOptions contains the optional parameters for the SQLResourcesClient.BeginSQLDatabasePartitionMerge method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabasePartitionMerge.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginSQLDatabasePartitionMerge(ctx, "rgName", "ddb1", "databaseName", armcosmos.MergeParameters{
	IsDryRun: to.Ptr(false),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionStorageInfoCollection = armcosmos.PhysicalPartitionStorageInfoCollection{
// 	PhysicalPartitionStorageInfoCollection: []*armcosmos.PhysicalPartitionStorageInfo{
// 		{
// 			ID: to.Ptr("0"),
// 			StorageInKB: to.Ptr[float64](333),
// 		},
// 		{
// 			ID: to.Ptr("1"),
// 			StorageInKB: to.Ptr[float64](305),
// 		},
// 		{
// 			ID: to.Ptr("177"),
// 			StorageInKB: to.Ptr[float64](368),
// 		},
// 		{
// 			ID: to.Ptr("178"),
// 			StorageInKB: to.Ptr[float64](96313),
// 		},
// 		{
// 			ID: to.Ptr("5"),
// 			StorageInKB: to.Ptr[float64](194),
// 		},
// 		{
// 			ID: to.Ptr("6"),
// 			StorageInKB: to.Ptr[float64](331),
// 	}},
// }
Output:

func (*SQLResourcesClient) BeginSQLDatabaseRedistributeThroughput

func (client *SQLResourcesClient) BeginSQLDatabaseRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions) (*runtime.Poller[SQLResourcesClientSQLDatabaseRedistributeThroughputResponse], error)

BeginSQLDatabaseRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • redistributeThroughputParameters - The parameters to provide for redistributing throughput for the current SQL database.
  • options - SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginSQLDatabaseRedistributeThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginSQLDatabaseRedistributeThroughput(ctx, "rg1", "ddb1", "databaseName", armcosmos.RedistributeThroughputParameters{
	Properties: &armcosmos.RedistributeThroughputProperties{
		Resource: &armcosmos.RedistributeThroughputPropertiesResource{
			SourcePhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
				{
					ID:         to.Ptr("2"),
					Throughput: to.Ptr[float64](5000),
				},
				{
					ID: to.Ptr("3"),
				}},
			TargetPhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
				{
					ID:         to.Ptr("0"),
					Throughput: to.Ptr[float64](5000),
				},
				{
					ID:         to.Ptr("1"),
					Throughput: to.Ptr[float64](5000),
				}},
			ThroughputPolicy: to.Ptr(armcosmos.ThroughputPolicyTypeCustom),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{
// 	Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{
// 		Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{
// 			PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
// 				{
// 					ID: to.Ptr("0"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("1"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("2"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("3"),
// 					Throughput: to.Ptr[float64](3000),
// 			}},
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginSQLDatabaseRetrieveThroughputDistribution

func (client *SQLResourcesClient) BeginSQLDatabaseRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions) (*runtime.Poller[SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse], error)

BeginSQLDatabaseRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB SQL database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • retrieveThroughputParameters - The parameters to provide for retrieving throughput distribution for the current SQL database.
  • options - SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions contains the optional parameters for the SQLResourcesClient.BeginSQLDatabaseRetrieveThroughputDistribution method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginSQLDatabaseRetrieveThroughputDistribution(ctx, "rg1", "ddb1", "databaseName", armcosmos.RetrieveThroughputParameters{
	Properties: &armcosmos.RetrieveThroughputProperties{
		Resource: &armcosmos.RetrieveThroughputPropertiesResource{
			PhysicalPartitionIDs: []*armcosmos.PhysicalPartitionID{
				{
					ID: to.Ptr("0"),
				},
				{
					ID: to.Ptr("1"),
				}},
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.PhysicalPartitionThroughputInfoResult = armcosmos.PhysicalPartitionThroughputInfoResult{
// 	Properties: &armcosmos.PhysicalPartitionThroughputInfoResultProperties{
// 		Resource: &armcosmos.PhysicalPartitionThroughputInfoResultPropertiesResource{
// 			PhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{
// 				{
// 					ID: to.Ptr("0"),
// 					Throughput: to.Ptr[float64](5000),
// 				},
// 				{
// 					ID: to.Ptr("1"),
// 					Throughput: to.Ptr[float64](5000),
// 			}},
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginUpdateSQLContainerThroughput

func (client *SQLResourcesClient) BeginUpdateSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *SQLResourcesClientBeginUpdateSQLContainerThroughputOptions) (*runtime.Poller[SQLResourcesClientUpdateSQLContainerThroughputResponse], error)

BeginUpdateSQLContainerThroughput - Update RUs per second of an Azure Cosmos DB SQL container If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • updateThroughputParameters - The parameters to provide for the RUs per second of the current SQL container.
  • options - SQLResourcesClientBeginUpdateSQLContainerThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginUpdateSQLContainerThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerThroughputUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginUpdateSQLContainerThroughput(ctx, "rg1", "ddb1", "databaseName", "containerName", armcosmos.ThroughputSettingsUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.ThroughputSettingsUpdateProperties{
		Resource: &armcosmos.ThroughputSettingsResource{
			Throughput: to.Ptr[int32](400),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) BeginUpdateSQLDatabaseThroughput

func (client *SQLResourcesClient) BeginUpdateSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *SQLResourcesClientBeginUpdateSQLDatabaseThroughputOptions) (*runtime.Poller[SQLResourcesClientUpdateSQLDatabaseThroughputResponse], error)

BeginUpdateSQLDatabaseThroughput - Update RUs per second of an Azure Cosmos DB SQL database If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • updateThroughputParameters - The parameters to provide for the RUs per second of the current SQL database.
  • options - SQLResourcesClientBeginUpdateSQLDatabaseThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginUpdateSQLDatabaseThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSQLResourcesClient().BeginUpdateSQLDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", armcosmos.ThroughputSettingsUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.ThroughputSettingsUpdateProperties{
		Resource: &armcosmos.ThroughputSettingsResource{
			Throughput: to.Ptr[int32](400),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) GetClientEncryptionKey

func (client *SQLResourcesClient) GetClientEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, options *SQLResourcesClientGetClientEncryptionKeyOptions) (SQLResourcesClientGetClientEncryptionKeyResponse, error)

GetClientEncryptionKey - Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • clientEncryptionKeyName - Cosmos DB ClientEncryptionKey name.
  • options - SQLResourcesClientGetClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.GetClientEncryptionKey method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSQLResourcesClient().GetClientEncryptionKey(ctx, "rgName", "accountName", "databaseName", "cekName", 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.ClientEncryptionKeyGetResults = armcosmos.ClientEncryptionKeyGetResults{
// 	Name: to.Ptr("cekName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"),
// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName"),
// 	Properties: &armcosmos.ClientEncryptionKeyGetProperties{
// 		Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{
// 			EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
// 			ID: to.Ptr("cekName"),
// 			KeyWrapMetadata: &armcosmos.KeyWrapMetadata{
// 				Name: to.Ptr("customerManagedKey"),
// 				Type: to.Ptr("AzureKeyVault"),
// 				Algorithm: to.Ptr("RSA-OAEP"),
// 				Value: to.Ptr("AzureKeyVault Key URL"),
// 			},
// 			WrappedDataEncryptionKey: []byte("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="),
// 			Etag: to.Ptr("00000000-0000-0000-7a1f-bc0828e801d7"),
// 			Rid: to.Ptr("tNc4AAAAAAAQkjzWAgAAAA=="),
// 			Ts: to.Ptr[float32](1626425552),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) GetSQLContainer

func (client *SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientGetSQLContainerOptions) (SQLResourcesClientGetSQLContainerResponse, error)

GetSQLContainer - Gets the SQL container under an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • options - SQLResourcesClientGetSQLContainerOptions contains the optional parameters for the SQLResourcesClient.GetSQLContainer method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSQLResourcesClient().GetSQLContainer(ctx, "rgName", "ddb1", "databaseName", "containerName", 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.SQLContainerGetResults = armcosmos.SQLContainerGetResults{
// 	Name: to.Ptr("containerName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/containers/containerName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.SQLContainerGetProperties{
// 		Options: &armcosmos.SQLContainerGetPropertiesOptions{
// 			Throughput: to.Ptr[int32](400),
// 		},
// 		Resource: &armcosmos.SQLContainerGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			ClientEncryptionPolicy: &armcosmos.ClientEncryptionPolicy{
// 				IncludedPaths: []*armcosmos.ClientEncryptionIncludedPath{
// 					{
// 						Path: to.Ptr("/path"),
// 						ClientEncryptionKeyID: to.Ptr("keyId"),
// 						EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
// 						EncryptionType: to.Ptr("Deterministic"),
// 				}},
// 				PolicyFormatVersion: to.Ptr[int32](1),
// 			},
// 			ComputedProperties: []*armcosmos.ComputedProperty{
// 				{
// 					Name: to.Ptr("cp_lowerName"),
// 					Query: to.Ptr("SELECT VALUE LOWER(c.name) FROM c"),
// 			}},
// 			ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
// 				ConflictResolutionPath: to.Ptr("/path"),
// 				Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
// 			},
// 			DefaultTTL: to.Ptr[int32](100),
// 			ID: to.Ptr("containerName"),
// 			IndexingPolicy: &armcosmos.IndexingPolicy{
// 				Automatic: to.Ptr(true),
// 				ExcludedPaths: []*armcosmos.ExcludedPath{
// 				},
// 				IncludedPaths: []*armcosmos.IncludedPath{
// 					{
// 						Path: to.Ptr("/*"),
// 						Indexes: []*armcosmos.Indexes{
// 							{
// 								DataType: to.Ptr(armcosmos.DataTypeString),
// 								Kind: to.Ptr(armcosmos.IndexKindRange),
// 								Precision: to.Ptr[int32](-1),
// 							},
// 							{
// 								DataType: to.Ptr(armcosmos.DataTypeNumber),
// 								Kind: to.Ptr(armcosmos.IndexKindRange),
// 								Precision: to.Ptr[int32](-1),
// 						}},
// 				}},
// 				IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
// 			},
// 			PartitionKey: &armcosmos.ContainerPartitionKey{
// 				Kind: to.Ptr(armcosmos.PartitionKindHash),
// 				Paths: []*string{
// 					to.Ptr("/AccountNumber")},
// 				},
// 				UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
// 					UniqueKeys: []*armcosmos.UniqueKey{
// 						{
// 							Paths: []*string{
// 								to.Ptr("/testPath")},
// 						}},
// 					},
// 				},
// 			},
// 		}
Output:

func (*SQLResourcesClient) GetSQLContainerThroughput

func (client *SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientGetSQLContainerThroughputOptions) (SQLResourcesClientGetSQLContainerThroughputResponse, error)

GetSQLContainerThroughput - Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • options - SQLResourcesClientGetSQLContainerThroughputOptions contains the optional parameters for the SQLResourcesClient.GetSQLContainerThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerThroughputGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSQLResourcesClient().GetSQLContainerThroughput(ctx, "rg1", "ddb1", "databaseName", "containerName", 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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			InstantMaximumThroughput: to.Ptr("10000"),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			SoftAllowedMaximumThroughput: to.Ptr("1000000"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) GetSQLDatabase

func (client *SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientGetSQLDatabaseOptions) (SQLResourcesClientGetSQLDatabaseResponse, error)

GetSQLDatabase - Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - SQLResourcesClientGetSQLDatabaseOptions contains the optional parameters for the SQLResourcesClient.GetSQLDatabase method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSQLResourcesClient().GetSQLDatabase(ctx, "rg1", "ddb1", "databaseName", 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.SQLDatabaseGetResults = armcosmos.SQLDatabaseGetResults{
// 	Name: to.Ptr("databaseName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.SQLDatabaseGetProperties{
// 		Resource: &armcosmos.SQLDatabaseGetPropertiesResource{
// 			Etag: to.Ptr("\"00000a00-0000-0000-0000-56672f920000\""),
// 			Rid: to.Ptr("CqNBAA=="),
// 			Ts: to.Ptr[float32](1449602962),
// 			ID: to.Ptr("databaseName"),
// 			Colls: to.Ptr("colls/"),
// 			Users: to.Ptr("users/"),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) GetSQLDatabaseThroughput

func (client *SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientGetSQLDatabaseThroughputOptions) (SQLResourcesClientGetSQLDatabaseThroughputResponse, error)

GetSQLDatabaseThroughput - Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - SQLResourcesClientGetSQLDatabaseThroughputOptions contains the optional parameters for the SQLResourcesClient.GetSQLDatabaseThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseThroughputGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSQLResourcesClient().GetSQLDatabaseThroughput(ctx, "rg1", "ddb1", "databaseName", 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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			InstantMaximumThroughput: to.Ptr("10000"),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			SoftAllowedMaximumThroughput: to.Ptr("1000000"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) GetSQLRoleAssignment

func (client *SQLResourcesClient) GetSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, options *SQLResourcesClientGetSQLRoleAssignmentOptions) (SQLResourcesClientGetSQLRoleAssignmentResponse, error)

GetSQLRoleAssignment - Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • roleAssignmentID - The GUID for the Role Assignment.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - SQLResourcesClientGetSQLRoleAssignmentOptions contains the optional parameters for the SQLResourcesClient.GetSQLRoleAssignment method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSQLResourcesClient().GetSQLRoleAssignment(ctx, "myRoleAssignmentId", "myResourceGroupName", "myAccountName", 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.SQLRoleAssignmentGetResults = armcosmos.SQLRoleAssignmentGetResults{
// 	Name: to.Ptr("myRoleAssignmentId"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments"),
// 	ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleAssignments/myRoleAssignmentId"),
// 	Properties: &armcosmos.SQLRoleAssignmentResource{
// 		PrincipalID: to.Ptr("myPrincipalId"),
// 		RoleDefinitionID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"),
// 		Scope: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases"),
// 	},
// }
Output:

func (*SQLResourcesClient) GetSQLRoleDefinition

func (client *SQLResourcesClient) GetSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, options *SQLResourcesClientGetSQLRoleDefinitionOptions) (SQLResourcesClientGetSQLRoleDefinitionResponse, error)

GetSQLRoleDefinition - Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • roleDefinitionID - The GUID for the Role Definition.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - SQLResourcesClientGetSQLRoleDefinitionOptions contains the optional parameters for the SQLResourcesClient.GetSQLRoleDefinition method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSQLResourcesClient().GetSQLRoleDefinition(ctx, "myRoleDefinitionId", "myResourceGroupName", "myAccountName", 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.SQLRoleDefinitionGetResults = armcosmos.SQLRoleDefinitionGetResults{
// 	Name: to.Ptr("myRoleDefinitionId"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions"),
// 	ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"),
// 	Properties: &armcosmos.SQLRoleDefinitionResource{
// 		Type: to.Ptr(armcosmos.RoleDefinitionTypeCustomRole),
// 		AssignableScopes: []*string{
// 			to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales"),
// 			to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases")},
// 			Permissions: []*armcosmos.Permission{
// 				{
// 					DataActions: []*string{
// 						to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create"),
// 						to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read")},
// 						NotDataActions: []*string{
// 						},
// 				}},
// 				RoleName: to.Ptr("myRoleName"),
// 			},
// 		}
Output:

func (*SQLResourcesClient) GetSQLStoredProcedure

func (client *SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, options *SQLResourcesClientGetSQLStoredProcedureOptions) (SQLResourcesClientGetSQLStoredProcedureResponse, error)

GetSQLStoredProcedure - Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • storedProcedureName - Cosmos DB storedProcedure name.
  • options - SQLResourcesClientGetSQLStoredProcedureOptions contains the optional parameters for the SQLResourcesClient.GetSQLStoredProcedure method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlStoredProcedureGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSQLResourcesClient().GetSQLStoredProcedure(ctx, "rgName", "ddb1", "databaseName", "containerName", "storedProcedureName", 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.SQLStoredProcedureGetResults = armcosmos.SQLStoredProcedureGetResults{
// 	Name: to.Ptr("storedProcedureName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlStoredProcedures"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlStoredProcedures/storedProcedureName"),
// 	Properties: &armcosmos.SQLStoredProcedureGetProperties{
// 		Resource: &armcosmos.SQLStoredProcedureGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			Body: to.Ptr("body"),
// 			ID: to.Ptr("storedProcedureName"),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) GetSQLTrigger

func (client *SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, options *SQLResourcesClientGetSQLTriggerOptions) (SQLResourcesClientGetSQLTriggerResponse, error)

GetSQLTrigger - Gets the SQL trigger under an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • triggerName - Cosmos DB trigger name.
  • options - SQLResourcesClientGetSQLTriggerOptions contains the optional parameters for the SQLResourcesClient.GetSQLTrigger method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlTriggerGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSQLResourcesClient().GetSQLTrigger(ctx, "rgName", "ddb1", "databaseName", "containerName", "triggerName", 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.SQLTriggerGetResults = armcosmos.SQLTriggerGetResults{
// 	Name: to.Ptr("triggerName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlTriggers"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlTriggers/triggerName"),
// 	Properties: &armcosmos.SQLTriggerGetProperties{
// 		Resource: &armcosmos.SQLTriggerGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			Body: to.Ptr("body"),
// 			ID: to.Ptr("triggerName"),
// 			TriggerOperation: to.Ptr(armcosmos.TriggerOperation("triggerOperation")),
// 			TriggerType: to.Ptr(armcosmos.TriggerType("triggerType")),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) GetSQLUserDefinedFunction

func (client *SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, options *SQLResourcesClientGetSQLUserDefinedFunctionOptions) (SQLResourcesClientGetSQLUserDefinedFunctionResponse, error)

GetSQLUserDefinedFunction - Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • userDefinedFunctionName - Cosmos DB userDefinedFunction name.
  • options - SQLResourcesClientGetSQLUserDefinedFunctionOptions contains the optional parameters for the SQLResourcesClient.GetSQLUserDefinedFunction method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSQLResourcesClient().GetSQLUserDefinedFunction(ctx, "rgName", "ddb1", "databaseName", "containerName", "userDefinedFunctionName", 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.SQLUserDefinedFunctionGetResults = armcosmos.SQLUserDefinedFunctionGetResults{
// 	Name: to.Ptr("userDefinedFunctionName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlUserDefinedFunctions"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlUserDefinedFunctions/userDefinedFunctionName"),
// 	Properties: &armcosmos.SQLUserDefinedFunctionGetProperties{
// 		Resource: &armcosmos.SQLUserDefinedFunctionGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			Body: to.Ptr("body"),
// 			ID: to.Ptr("userDefinedFunctionName"),
// 		},
// 	},
// }
Output:

func (*SQLResourcesClient) NewListClientEncryptionKeysPager

func (client *SQLResourcesClient) NewListClientEncryptionKeysPager(resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientListClientEncryptionKeysOptions) *runtime.Pager[SQLResourcesClientListClientEncryptionKeysResponse]

NewListClientEncryptionKeysPager - Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - SQLResourcesClientListClientEncryptionKeysOptions contains the optional parameters for the SQLResourcesClient.NewListClientEncryptionKeysPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlClientEncryptionKeysList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSQLResourcesClient().NewListClientEncryptionKeysPager("rgName", "accountName", "databaseName", 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.ClientEncryptionKeysListResult = armcosmos.ClientEncryptionKeysListResult{
	// 	Value: []*armcosmos.ClientEncryptionKeyGetResults{
	// 		{
	// 			Name: to.Ptr("cekName1"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"),
	// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName1"),
	// 			Properties: &armcosmos.ClientEncryptionKeyGetProperties{
	// 				Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{
	// 					EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
	// 					ID: to.Ptr("cekName1"),
	// 					KeyWrapMetadata: &armcosmos.KeyWrapMetadata{
	// 						Name: to.Ptr("customerManagedKey1"),
	// 						Type: to.Ptr("AzureKeyVault"),
	// 						Algorithm: to.Ptr("RSA-OAEP"),
	// 						Value: to.Ptr("AzureKeyVault Key URL for customerManagedKey1"),
	// 					},
	// 					WrappedDataEncryptionKey: []byte("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="),
	// 					Etag: to.Ptr("00000000-0000-0000-7a1f-bc0828e801d7"),
	// 					Rid: to.Ptr("nAMyAAAAAADPw1kKAgAAAA=="),
	// 					Ts: to.Ptr[float32](1626425552),
	// 				},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("cekName2"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKey"),
	// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/cekName2"),
	// 			Properties: &armcosmos.ClientEncryptionKeyGetProperties{
	// 				Resource: &armcosmos.ClientEncryptionKeyGetPropertiesResource{
	// 					EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
	// 					ID: to.Ptr("cekName2"),
	// 					KeyWrapMetadata: &armcosmos.KeyWrapMetadata{
	// 						Name: to.Ptr("customerManagedKey2"),
	// 						Type: to.Ptr("AzureKeyVault"),
	// 						Algorithm: to.Ptr("RSA-OAEP"),
	// 						Value: to.Ptr("AzureKeyVault Key URL for customerManagedKey2"),
	// 					},
	// 					WrappedDataEncryptionKey: []byte("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="),
	// 					Etag: to.Ptr("00000000-0000-0000-7a21-7788a38c01d7"),
	// 					Rid: to.Ptr("nAMyAAAAAAAWWfxHAgAAAA=="),
	// 					Ts: to.Ptr[float32](1626425631),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

func (*SQLResourcesClient) NewListSQLContainersPager

func (client *SQLResourcesClient) NewListSQLContainersPager(resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientListSQLContainersOptions) *runtime.Pager[SQLResourcesClientListSQLContainersResponse]

NewListSQLContainersPager - Lists the SQL container under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • options - SQLResourcesClientListSQLContainersOptions contains the optional parameters for the SQLResourcesClient.NewListSQLContainersPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlContainerList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSQLResourcesClient().NewListSQLContainersPager("rgName", "ddb1", "databaseName", 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.SQLContainerListResult = armcosmos.SQLContainerListResult{
	// 	Value: []*armcosmos.SQLContainerGetResults{
	// 		{
	// 			Name: to.Ptr("containerName"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/containers/containerName"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.SQLContainerGetProperties{
	// 				Resource: &armcosmos.SQLContainerGetPropertiesResource{
	// 					Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
	// 					Rid: to.Ptr("PD5DALigDgw="),
	// 					Ts: to.Ptr[float32](1459200611),
	// 					ClientEncryptionPolicy: &armcosmos.ClientEncryptionPolicy{
	// 						IncludedPaths: []*armcosmos.ClientEncryptionIncludedPath{
	// 							{
	// 								Path: to.Ptr("/path"),
	// 								ClientEncryptionKeyID: to.Ptr("keyId"),
	// 								EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
	// 								EncryptionType: to.Ptr("Deterministic"),
	// 						}},
	// 						PolicyFormatVersion: to.Ptr[int32](1),
	// 					},
	// 					ComputedProperties: []*armcosmos.ComputedProperty{
	// 						{
	// 							Name: to.Ptr("cp_lowerName"),
	// 							Query: to.Ptr("SELECT VALUE LOWER(c.name) FROM c"),
	// 					}},
	// 					ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
	// 						ConflictResolutionPath: to.Ptr("/path"),
	// 						Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
	// 					},
	// 					DefaultTTL: to.Ptr[int32](100),
	// 					ID: to.Ptr("testctn"),
	// 					IndexingPolicy: &armcosmos.IndexingPolicy{
	// 						Automatic: to.Ptr(true),
	// 						ExcludedPaths: []*armcosmos.ExcludedPath{
	// 						},
	// 						IncludedPaths: []*armcosmos.IncludedPath{
	// 							{
	// 								Path: to.Ptr("/*"),
	// 								Indexes: []*armcosmos.Indexes{
	// 									{
	// 										DataType: to.Ptr(armcosmos.DataTypeString),
	// 										Kind: to.Ptr(armcosmos.IndexKindRange),
	// 										Precision: to.Ptr[int32](-1),
	// 									},
	// 									{
	// 										DataType: to.Ptr(armcosmos.DataTypeNumber),
	// 										Kind: to.Ptr(armcosmos.IndexKindRange),
	// 										Precision: to.Ptr[int32](-1),
	// 								}},
	// 						}},
	// 						IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
	// 					},
	// 					PartitionKey: &armcosmos.ContainerPartitionKey{
	// 						Kind: to.Ptr(armcosmos.PartitionKindHash),
	// 						Paths: []*string{
	// 							to.Ptr("/AccountNumber")},
	// 						},
	// 						UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
	// 							UniqueKeys: []*armcosmos.UniqueKey{
	// 								{
	// 									Paths: []*string{
	// 										to.Ptr("/testPath")},
	// 								}},
	// 							},
	// 						},
	// 					},
	// 				},
	// 				{
	// 					Name: to.Ptr("containerName1"),
	// 					Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers"),
	// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName1"),
	// 					Location: to.Ptr("West US"),
	// 					Tags: map[string]*string{
	// 					},
	// 					Properties: &armcosmos.SQLContainerGetProperties{
	// 						Resource: &armcosmos.SQLContainerGetPropertiesResource{
	// 							Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
	// 							Rid: to.Ptr("PD5DALigDiw="),
	// 							Ts: to.Ptr[float32](1459200611),
	// 							ClientEncryptionPolicy: &armcosmos.ClientEncryptionPolicy{
	// 								IncludedPaths: []*armcosmos.ClientEncryptionIncludedPath{
	// 									{
	// 										Path: to.Ptr("/path"),
	// 										ClientEncryptionKeyID: to.Ptr("keyId"),
	// 										EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
	// 										EncryptionType: to.Ptr("Deterministic"),
	// 								}},
	// 								PolicyFormatVersion: to.Ptr[int32](1),
	// 							},
	// 							ComputedProperties: []*armcosmos.ComputedProperty{
	// 							},
	// 							ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
	// 								ConflictResolutionPath: to.Ptr("/path"),
	// 								Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
	// 							},
	// 							DefaultTTL: to.Ptr[int32](100),
	// 							ID: to.Ptr("testctn1"),
	// 							IndexingPolicy: &armcosmos.IndexingPolicy{
	// 								Automatic: to.Ptr(true),
	// 								ExcludedPaths: []*armcosmos.ExcludedPath{
	// 								},
	// 								IncludedPaths: []*armcosmos.IncludedPath{
	// 									{
	// 										Path: to.Ptr("/*"),
	// 										Indexes: []*armcosmos.Indexes{
	// 											{
	// 												DataType: to.Ptr(armcosmos.DataTypeString),
	// 												Kind: to.Ptr(armcosmos.IndexKindRange),
	// 												Precision: to.Ptr[int32](-1),
	// 											},
	// 											{
	// 												DataType: to.Ptr(armcosmos.DataTypeNumber),
	// 												Kind: to.Ptr(armcosmos.IndexKindRange),
	// 												Precision: to.Ptr[int32](-1),
	// 										}},
	// 								}},
	// 								IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
	// 							},
	// 							PartitionKey: &armcosmos.ContainerPartitionKey{
	// 								Kind: to.Ptr(armcosmos.PartitionKindMultiHash),
	// 								Paths: []*string{
	// 									to.Ptr("/AccountNumber"),
	// 									to.Ptr("/AccountLocation")},
	// 									Version: to.Ptr[int32](2),
	// 								},
	// 								UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
	// 									UniqueKeys: []*armcosmos.UniqueKey{
	// 										{
	// 											Paths: []*string{
	// 												to.Ptr("/testPath")},
	// 										}},
	// 									},
	// 								},
	// 							},
	// 						},
	// 						{
	// 							Name: to.Ptr("containerName2"),
	// 							Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers"),
	// 							ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName2"),
	// 							Location: to.Ptr("West US"),
	// 							Tags: map[string]*string{
	// 							},
	// 							Properties: &armcosmos.SQLContainerGetProperties{
	// 								Resource: &armcosmos.SQLContainerGetPropertiesResource{
	// 									Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
	// 									Rid: to.Ptr("PD5DALigDhw="),
	// 									Ts: to.Ptr[float32](1459200611),
	// 									ClientEncryptionPolicy: &armcosmos.ClientEncryptionPolicy{
	// 										IncludedPaths: []*armcosmos.ClientEncryptionIncludedPath{
	// 											{
	// 												Path: to.Ptr("/path"),
	// 												ClientEncryptionKeyID: to.Ptr("keyId"),
	// 												EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"),
	// 												EncryptionType: to.Ptr("Deterministic"),
	// 										}},
	// 										PolicyFormatVersion: to.Ptr[int32](1),
	// 									},
	// 									ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{
	// 										ConflictResolutionPath: to.Ptr("/path"),
	// 										Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins),
	// 									},
	// 									DefaultTTL: to.Ptr[int32](100),
	// 									ID: to.Ptr("testctn2"),
	// 									IndexingPolicy: &armcosmos.IndexingPolicy{
	// 										Automatic: to.Ptr(true),
	// 										ExcludedPaths: []*armcosmos.ExcludedPath{
	// 										},
	// 										IncludedPaths: []*armcosmos.IncludedPath{
	// 											{
	// 												Path: to.Ptr("/*"),
	// 												Indexes: []*armcosmos.Indexes{
	// 													{
	// 														DataType: to.Ptr(armcosmos.DataTypeString),
	// 														Kind: to.Ptr(armcosmos.IndexKindRange),
	// 														Precision: to.Ptr[int32](-1),
	// 													},
	// 													{
	// 														DataType: to.Ptr(armcosmos.DataTypeNumber),
	// 														Kind: to.Ptr(armcosmos.IndexKindRange),
	// 														Precision: to.Ptr[int32](-1),
	// 												}},
	// 										}},
	// 										IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent),
	// 									},
	// 									PartitionKey: &armcosmos.ContainerPartitionKey{
	// 										Kind: to.Ptr(armcosmos.PartitionKindHash),
	// 										Paths: []*string{
	// 											to.Ptr("/_partitionKey")},
	// 											SystemKey: to.Ptr(true),
	// 											Version: to.Ptr[int32](2),
	// 										},
	// 										UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{
	// 											UniqueKeys: []*armcosmos.UniqueKey{
	// 												{
	// 													Paths: []*string{
	// 														to.Ptr("/testPath")},
	// 												}},
	// 											},
	// 										},
	// 									},
	// 							}},
	// 						}
}
Output:

func (*SQLResourcesClient) NewListSQLDatabasesPager

func (client *SQLResourcesClient) NewListSQLDatabasesPager(resourceGroupName string, accountName string, options *SQLResourcesClientListSQLDatabasesOptions) *runtime.Pager[SQLResourcesClientListSQLDatabasesResponse]

NewListSQLDatabasesPager - Lists the SQL databases under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - SQLResourcesClientListSQLDatabasesOptions contains the optional parameters for the SQLResourcesClient.NewListSQLDatabasesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDatabaseList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSQLResourcesClient().NewListSQLDatabasesPager("rgName", "ddb1", 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.SQLDatabaseListResult = armcosmos.SQLDatabaseListResult{
	// 	Value: []*armcosmos.SQLDatabaseGetResults{
	// 		{
	// 			Name: to.Ptr("databaseName"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.SQLDatabaseGetProperties{
	// 				Resource: &armcosmos.SQLDatabaseGetPropertiesResource{
	// 					Etag: to.Ptr("\"00000a00-0000-0000-0000-56672f920000\""),
	// 					Rid: to.Ptr("CqNBAA=="),
	// 					Ts: to.Ptr[float32](1449602962),
	// 					ID: to.Ptr("databaseName"),
	// 					Colls: to.Ptr("colls/"),
	// 					Users: to.Ptr("users/"),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

func (*SQLResourcesClient) NewListSQLRoleAssignmentsPager

func (client *SQLResourcesClient) NewListSQLRoleAssignmentsPager(resourceGroupName string, accountName string, options *SQLResourcesClientListSQLRoleAssignmentsOptions) *runtime.Pager[SQLResourcesClientListSQLRoleAssignmentsResponse]

NewListSQLRoleAssignmentsPager - Retrieves the list of all Azure Cosmos DB SQL Role Assignments.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - SQLResourcesClientListSQLRoleAssignmentsOptions contains the optional parameters for the SQLResourcesClient.NewListSQLRoleAssignmentsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleAssignmentList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSQLResourcesClient().NewListSQLRoleAssignmentsPager("myResourceGroupName", "myAccountName", 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.SQLRoleAssignmentListResult = armcosmos.SQLRoleAssignmentListResult{
	// 	Value: []*armcosmos.SQLRoleAssignmentGetResults{
	// 		{
	// 			Name: to.Ptr("myRoleAssignmentId"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments"),
	// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleAssignments/myRoleAssignmentId"),
	// 			Properties: &armcosmos.SQLRoleAssignmentResource{
	// 				PrincipalID: to.Ptr("myPrincipalId"),
	// 				RoleDefinitionID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"),
	// 				Scope: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases"),
	// 			},
	// 	}},
	// }
}
Output:

func (*SQLResourcesClient) NewListSQLRoleDefinitionsPager

func (client *SQLResourcesClient) NewListSQLRoleDefinitionsPager(resourceGroupName string, accountName string, options *SQLResourcesClientListSQLRoleDefinitionsOptions) *runtime.Pager[SQLResourcesClientListSQLRoleDefinitionsResponse]

NewListSQLRoleDefinitionsPager - Retrieves the list of all Azure Cosmos DB SQL Role Definitions.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - SQLResourcesClientListSQLRoleDefinitionsOptions contains the optional parameters for the SQLResourcesClient.NewListSQLRoleDefinitionsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlRoleDefinitionList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSQLResourcesClient().NewListSQLRoleDefinitionsPager("myResourceGroupName", "myAccountName", 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.SQLRoleDefinitionListResult = armcosmos.SQLRoleDefinitionListResult{
	// 	Value: []*armcosmos.SQLRoleDefinitionGetResults{
	// 		{
	// 			Name: to.Ptr("myRoleDefinitionId"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions"),
	// 			ID: to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId"),
	// 			Properties: &armcosmos.SQLRoleDefinitionResource{
	// 				Type: to.Ptr(armcosmos.RoleDefinitionTypeCustomRole),
	// 				AssignableScopes: []*string{
	// 					to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales"),
	// 					to.Ptr("/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases")},
	// 					Permissions: []*armcosmos.Permission{
	// 						{
	// 							DataActions: []*string{
	// 								to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create"),
	// 								to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read")},
	// 								NotDataActions: []*string{
	// 								},
	// 						}},
	// 						RoleName: to.Ptr("myRoleName"),
	// 					},
	// 			}},
	// 		}
}
Output:

func (*SQLResourcesClient) NewListSQLStoredProceduresPager

func (client *SQLResourcesClient) NewListSQLStoredProceduresPager(resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientListSQLStoredProceduresOptions) *runtime.Pager[SQLResourcesClientListSQLStoredProceduresResponse]

NewListSQLStoredProceduresPager - Lists the SQL storedProcedure under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • options - SQLResourcesClientListSQLStoredProceduresOptions contains the optional parameters for the SQLResourcesClient.NewListSQLStoredProceduresPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlStoredProcedureList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSQLResourcesClient().NewListSQLStoredProceduresPager("rgName", "ddb1", "databaseName", "containerName", 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.SQLStoredProcedureListResult = armcosmos.SQLStoredProcedureListResult{
	// 	Value: []*armcosmos.SQLStoredProcedureGetResults{
	// 		{
	// 			Name: to.Ptr("testctn"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlStoredProcedures"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlStoredProcedures/storedProcedureName"),
	// 			Properties: &armcosmos.SQLStoredProcedureGetProperties{
	// 				Resource: &armcosmos.SQLStoredProcedureGetPropertiesResource{
	// 					Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
	// 					Rid: to.Ptr("PD5DALigDgw="),
	// 					Ts: to.Ptr[float32](1459200611),
	// 					Body: to.Ptr("body"),
	// 					ID: to.Ptr("testctn"),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

func (*SQLResourcesClient) NewListSQLTriggersPager

func (client *SQLResourcesClient) NewListSQLTriggersPager(resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientListSQLTriggersOptions) *runtime.Pager[SQLResourcesClientListSQLTriggersResponse]

NewListSQLTriggersPager - Lists the SQL trigger under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • options - SQLResourcesClientListSQLTriggersOptions contains the optional parameters for the SQLResourcesClient.NewListSQLTriggersPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlTriggerList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSQLResourcesClient().NewListSQLTriggersPager("rgName", "ddb1", "databaseName", "containerName", 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.SQLTriggerListResult = armcosmos.SQLTriggerListResult{
	// 	Value: []*armcosmos.SQLTriggerGetResults{
	// 		{
	// 			Name: to.Ptr("testctn"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlTriggers"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlTriggers/triggerName"),
	// 			Properties: &armcosmos.SQLTriggerGetProperties{
	// 				Resource: &armcosmos.SQLTriggerGetPropertiesResource{
	// 					Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
	// 					Rid: to.Ptr("PD5DALigDgw="),
	// 					Ts: to.Ptr[float32](1459200611),
	// 					Body: to.Ptr("body"),
	// 					ID: to.Ptr("testctn"),
	// 					TriggerOperation: to.Ptr(armcosmos.TriggerOperation("triggerOperation")),
	// 					TriggerType: to.Ptr(armcosmos.TriggerType("triggerType")),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

func (*SQLResourcesClient) NewListSQLUserDefinedFunctionsPager

func (client *SQLResourcesClient) NewListSQLUserDefinedFunctionsPager(resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientListSQLUserDefinedFunctionsOptions) *runtime.Pager[SQLResourcesClientListSQLUserDefinedFunctionsResponse]

NewListSQLUserDefinedFunctionsPager - Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • databaseName - Cosmos DB database name.
  • containerName - Cosmos DB container name.
  • options - SQLResourcesClientListSQLUserDefinedFunctionsOptions contains the optional parameters for the SQLResourcesClient.NewListSQLUserDefinedFunctionsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlUserDefinedFunctionList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSQLResourcesClient().NewListSQLUserDefinedFunctionsPager("rgName", "ddb1", "databaseName", "containerName", 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.SQLUserDefinedFunctionListResult = armcosmos.SQLUserDefinedFunctionListResult{
	// 	Value: []*armcosmos.SQLUserDefinedFunctionGetResults{
	// 		{
	// 			Name: to.Ptr("testctn"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers/sqlUserDefinedFunctions"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/sqlContainers/containerName/sqlUserDefinedFunctions/userDefinedFunctionName"),
	// 			Properties: &armcosmos.SQLUserDefinedFunctionGetProperties{
	// 				Resource: &armcosmos.SQLUserDefinedFunctionGetPropertiesResource{
	// 					Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
	// 					Rid: to.Ptr("PD5DALigDgw="),
	// 					Ts: to.Ptr[float32](1459200611),
	// 					Body: to.Ptr("body"),
	// 					ID: to.Ptr("testctn"),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions

type SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateClientEncryptionKey method.

type SQLResourcesClientBeginCreateUpdateSQLContainerOptions

type SQLResourcesClientBeginCreateUpdateSQLContainerOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginCreateUpdateSQLContainerOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLContainer method.

type SQLResourcesClientBeginCreateUpdateSQLDatabaseOptions

type SQLResourcesClientBeginCreateUpdateSQLDatabaseOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginCreateUpdateSQLDatabaseOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLDatabase method.

type SQLResourcesClientBeginCreateUpdateSQLRoleAssignmentOptions

type SQLResourcesClientBeginCreateUpdateSQLRoleAssignmentOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginCreateUpdateSQLRoleAssignmentOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLRoleAssignment method.

type SQLResourcesClientBeginCreateUpdateSQLRoleDefinitionOptions

type SQLResourcesClientBeginCreateUpdateSQLRoleDefinitionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginCreateUpdateSQLRoleDefinitionOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLRoleDefinition method.

type SQLResourcesClientBeginCreateUpdateSQLStoredProcedureOptions

type SQLResourcesClientBeginCreateUpdateSQLStoredProcedureOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginCreateUpdateSQLStoredProcedureOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLStoredProcedure method.

type SQLResourcesClientBeginCreateUpdateSQLTriggerOptions

type SQLResourcesClientBeginCreateUpdateSQLTriggerOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginCreateUpdateSQLTriggerOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLTrigger method.

type SQLResourcesClientBeginCreateUpdateSQLUserDefinedFunctionOptions

type SQLResourcesClientBeginCreateUpdateSQLUserDefinedFunctionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginCreateUpdateSQLUserDefinedFunctionOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLUserDefinedFunction method.

type SQLResourcesClientBeginDeleteSQLContainerOptions

type SQLResourcesClientBeginDeleteSQLContainerOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginDeleteSQLContainerOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLContainer method.

type SQLResourcesClientBeginDeleteSQLDatabaseOptions

type SQLResourcesClientBeginDeleteSQLDatabaseOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginDeleteSQLDatabaseOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLDatabase method.

type SQLResourcesClientBeginDeleteSQLRoleAssignmentOptions

type SQLResourcesClientBeginDeleteSQLRoleAssignmentOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginDeleteSQLRoleAssignmentOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLRoleAssignment method.

type SQLResourcesClientBeginDeleteSQLRoleDefinitionOptions

type SQLResourcesClientBeginDeleteSQLRoleDefinitionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginDeleteSQLRoleDefinitionOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLRoleDefinition method.

type SQLResourcesClientBeginDeleteSQLStoredProcedureOptions

type SQLResourcesClientBeginDeleteSQLStoredProcedureOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginDeleteSQLStoredProcedureOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLStoredProcedure method.

type SQLResourcesClientBeginDeleteSQLTriggerOptions

type SQLResourcesClientBeginDeleteSQLTriggerOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginDeleteSQLTriggerOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLTrigger method.

type SQLResourcesClientBeginDeleteSQLUserDefinedFunctionOptions

type SQLResourcesClientBeginDeleteSQLUserDefinedFunctionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginDeleteSQLUserDefinedFunctionOptions contains the optional parameters for the SQLResourcesClient.BeginDeleteSQLUserDefinedFunction method.

type SQLResourcesClientBeginListSQLContainerPartitionMergeOptions

type SQLResourcesClientBeginListSQLContainerPartitionMergeOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginListSQLContainerPartitionMergeOptions contains the optional parameters for the SQLResourcesClient.BeginListSQLContainerPartitionMerge method.

type SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions

type SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions contains the optional parameters for the SQLResourcesClient.BeginMigrateSQLContainerToAutoscale method.

type SQLResourcesClientBeginMigrateSQLContainerToManualThroughputOptions

type SQLResourcesClientBeginMigrateSQLContainerToManualThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginMigrateSQLContainerToManualThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginMigrateSQLContainerToManualThroughput method.

type SQLResourcesClientBeginMigrateSQLDatabaseToAutoscaleOptions

type SQLResourcesClientBeginMigrateSQLDatabaseToAutoscaleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginMigrateSQLDatabaseToAutoscaleOptions contains the optional parameters for the SQLResourcesClient.BeginMigrateSQLDatabaseToAutoscale method.

type SQLResourcesClientBeginMigrateSQLDatabaseToManualThroughputOptions

type SQLResourcesClientBeginMigrateSQLDatabaseToManualThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginMigrateSQLDatabaseToManualThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginMigrateSQLDatabaseToManualThroughput method.

type SQLResourcesClientBeginRetrieveContinuousBackupInformationOptions

type SQLResourcesClientBeginRetrieveContinuousBackupInformationOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the SQLResourcesClient.BeginRetrieveContinuousBackupInformation method.

type SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions

type SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginSQLContainerRedistributeThroughput method.

type SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions

type SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions contains the optional parameters for the SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution method.

type SQLResourcesClientBeginSQLDatabasePartitionMergeOptions

type SQLResourcesClientBeginSQLDatabasePartitionMergeOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginSQLDatabasePartitionMergeOptions contains the optional parameters for the SQLResourcesClient.BeginSQLDatabasePartitionMerge method.

type SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions

type SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginSQLDatabaseRedistributeThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginSQLDatabaseRedistributeThroughput method.

type SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions

type SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginSQLDatabaseRetrieveThroughputDistributionOptions contains the optional parameters for the SQLResourcesClient.BeginSQLDatabaseRetrieveThroughputDistribution method.

type SQLResourcesClientBeginUpdateSQLContainerThroughputOptions

type SQLResourcesClientBeginUpdateSQLContainerThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginUpdateSQLContainerThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginUpdateSQLContainerThroughput method.

type SQLResourcesClientBeginUpdateSQLDatabaseThroughputOptions

type SQLResourcesClientBeginUpdateSQLDatabaseThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SQLResourcesClientBeginUpdateSQLDatabaseThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginUpdateSQLDatabaseThroughput method.

type SQLResourcesClientCreateUpdateClientEncryptionKeyResponse

type SQLResourcesClientCreateUpdateClientEncryptionKeyResponse struct {
	// Client Encryption Key.
	ClientEncryptionKeyGetResults
}

SQLResourcesClientCreateUpdateClientEncryptionKeyResponse contains the response from method SQLResourcesClient.BeginCreateUpdateClientEncryptionKey.

type SQLResourcesClientCreateUpdateSQLContainerResponse

type SQLResourcesClientCreateUpdateSQLContainerResponse struct {
	// An Azure Cosmos DB container.
	SQLContainerGetResults
}

SQLResourcesClientCreateUpdateSQLContainerResponse contains the response from method SQLResourcesClient.BeginCreateUpdateSQLContainer.

type SQLResourcesClientCreateUpdateSQLDatabaseResponse

type SQLResourcesClientCreateUpdateSQLDatabaseResponse struct {
	// An Azure Cosmos DB SQL database.
	SQLDatabaseGetResults
}

SQLResourcesClientCreateUpdateSQLDatabaseResponse contains the response from method SQLResourcesClient.BeginCreateUpdateSQLDatabase.

type SQLResourcesClientCreateUpdateSQLRoleAssignmentResponse

type SQLResourcesClientCreateUpdateSQLRoleAssignmentResponse struct {
	// An Azure Cosmos DB Role Assignment
	SQLRoleAssignmentGetResults
}

SQLResourcesClientCreateUpdateSQLRoleAssignmentResponse contains the response from method SQLResourcesClient.BeginCreateUpdateSQLRoleAssignment.

type SQLResourcesClientCreateUpdateSQLRoleDefinitionResponse

type SQLResourcesClientCreateUpdateSQLRoleDefinitionResponse struct {
	// An Azure Cosmos DB SQL Role Definition.
	SQLRoleDefinitionGetResults
}

SQLResourcesClientCreateUpdateSQLRoleDefinitionResponse contains the response from method SQLResourcesClient.BeginCreateUpdateSQLRoleDefinition.

type SQLResourcesClientCreateUpdateSQLStoredProcedureResponse

type SQLResourcesClientCreateUpdateSQLStoredProcedureResponse struct {
	// An Azure Cosmos DB storedProcedure.
	SQLStoredProcedureGetResults
}

SQLResourcesClientCreateUpdateSQLStoredProcedureResponse contains the response from method SQLResourcesClient.BeginCreateUpdateSQLStoredProcedure.

type SQLResourcesClientCreateUpdateSQLTriggerResponse

type SQLResourcesClientCreateUpdateSQLTriggerResponse struct {
	// An Azure Cosmos DB trigger.
	SQLTriggerGetResults
}

SQLResourcesClientCreateUpdateSQLTriggerResponse contains the response from method SQLResourcesClient.BeginCreateUpdateSQLTrigger.

type SQLResourcesClientCreateUpdateSQLUserDefinedFunctionResponse

type SQLResourcesClientCreateUpdateSQLUserDefinedFunctionResponse struct {
	// An Azure Cosmos DB userDefinedFunction.
	SQLUserDefinedFunctionGetResults
}

SQLResourcesClientCreateUpdateSQLUserDefinedFunctionResponse contains the response from method SQLResourcesClient.BeginCreateUpdateSQLUserDefinedFunction.

type SQLResourcesClientDeleteSQLContainerResponse

type SQLResourcesClientDeleteSQLContainerResponse struct {
}

SQLResourcesClientDeleteSQLContainerResponse contains the response from method SQLResourcesClient.BeginDeleteSQLContainer.

type SQLResourcesClientDeleteSQLDatabaseResponse

type SQLResourcesClientDeleteSQLDatabaseResponse struct {
}

SQLResourcesClientDeleteSQLDatabaseResponse contains the response from method SQLResourcesClient.BeginDeleteSQLDatabase.

type SQLResourcesClientDeleteSQLRoleAssignmentResponse

type SQLResourcesClientDeleteSQLRoleAssignmentResponse struct {
}

SQLResourcesClientDeleteSQLRoleAssignmentResponse contains the response from method SQLResourcesClient.BeginDeleteSQLRoleAssignment.

type SQLResourcesClientDeleteSQLRoleDefinitionResponse

type SQLResourcesClientDeleteSQLRoleDefinitionResponse struct {
}

SQLResourcesClientDeleteSQLRoleDefinitionResponse contains the response from method SQLResourcesClient.BeginDeleteSQLRoleDefinition.

type SQLResourcesClientDeleteSQLStoredProcedureResponse

type SQLResourcesClientDeleteSQLStoredProcedureResponse struct {
}

SQLResourcesClientDeleteSQLStoredProcedureResponse contains the response from method SQLResourcesClient.BeginDeleteSQLStoredProcedure.

type SQLResourcesClientDeleteSQLTriggerResponse

type SQLResourcesClientDeleteSQLTriggerResponse struct {
}

SQLResourcesClientDeleteSQLTriggerResponse contains the response from method SQLResourcesClient.BeginDeleteSQLTrigger.

type SQLResourcesClientDeleteSQLUserDefinedFunctionResponse

type SQLResourcesClientDeleteSQLUserDefinedFunctionResponse struct {
}

SQLResourcesClientDeleteSQLUserDefinedFunctionResponse contains the response from method SQLResourcesClient.BeginDeleteSQLUserDefinedFunction.

type SQLResourcesClientGetClientEncryptionKeyOptions

type SQLResourcesClientGetClientEncryptionKeyOptions struct {
}

SQLResourcesClientGetClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.GetClientEncryptionKey method.

type SQLResourcesClientGetClientEncryptionKeyResponse

type SQLResourcesClientGetClientEncryptionKeyResponse struct {
	// Client Encryption Key.
	ClientEncryptionKeyGetResults
}

SQLResourcesClientGetClientEncryptionKeyResponse contains the response from method SQLResourcesClient.GetClientEncryptionKey.

type SQLResourcesClientGetSQLContainerOptions

type SQLResourcesClientGetSQLContainerOptions struct {
}

SQLResourcesClientGetSQLContainerOptions contains the optional parameters for the SQLResourcesClient.GetSQLContainer method.

type SQLResourcesClientGetSQLContainerResponse

type SQLResourcesClientGetSQLContainerResponse struct {
	// An Azure Cosmos DB container.
	SQLContainerGetResults
}

SQLResourcesClientGetSQLContainerResponse contains the response from method SQLResourcesClient.GetSQLContainer.

type SQLResourcesClientGetSQLContainerThroughputOptions

type SQLResourcesClientGetSQLContainerThroughputOptions struct {
}

SQLResourcesClientGetSQLContainerThroughputOptions contains the optional parameters for the SQLResourcesClient.GetSQLContainerThroughput method.

type SQLResourcesClientGetSQLContainerThroughputResponse

type SQLResourcesClientGetSQLContainerThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

SQLResourcesClientGetSQLContainerThroughputResponse contains the response from method SQLResourcesClient.GetSQLContainerThroughput.

type SQLResourcesClientGetSQLDatabaseOptions

type SQLResourcesClientGetSQLDatabaseOptions struct {
}

SQLResourcesClientGetSQLDatabaseOptions contains the optional parameters for the SQLResourcesClient.GetSQLDatabase method.

type SQLResourcesClientGetSQLDatabaseResponse

type SQLResourcesClientGetSQLDatabaseResponse struct {
	// An Azure Cosmos DB SQL database.
	SQLDatabaseGetResults
}

SQLResourcesClientGetSQLDatabaseResponse contains the response from method SQLResourcesClient.GetSQLDatabase.

type SQLResourcesClientGetSQLDatabaseThroughputOptions

type SQLResourcesClientGetSQLDatabaseThroughputOptions struct {
}

SQLResourcesClientGetSQLDatabaseThroughputOptions contains the optional parameters for the SQLResourcesClient.GetSQLDatabaseThroughput method.

type SQLResourcesClientGetSQLDatabaseThroughputResponse

type SQLResourcesClientGetSQLDatabaseThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

SQLResourcesClientGetSQLDatabaseThroughputResponse contains the response from method SQLResourcesClient.GetSQLDatabaseThroughput.

type SQLResourcesClientGetSQLRoleAssignmentOptions

type SQLResourcesClientGetSQLRoleAssignmentOptions struct {
}

SQLResourcesClientGetSQLRoleAssignmentOptions contains the optional parameters for the SQLResourcesClient.GetSQLRoleAssignment method.

type SQLResourcesClientGetSQLRoleAssignmentResponse

type SQLResourcesClientGetSQLRoleAssignmentResponse struct {
	// An Azure Cosmos DB Role Assignment
	SQLRoleAssignmentGetResults
}

SQLResourcesClientGetSQLRoleAssignmentResponse contains the response from method SQLResourcesClient.GetSQLRoleAssignment.

type SQLResourcesClientGetSQLRoleDefinitionOptions

type SQLResourcesClientGetSQLRoleDefinitionOptions struct {
}

SQLResourcesClientGetSQLRoleDefinitionOptions contains the optional parameters for the SQLResourcesClient.GetSQLRoleDefinition method.

type SQLResourcesClientGetSQLRoleDefinitionResponse

type SQLResourcesClientGetSQLRoleDefinitionResponse struct {
	// An Azure Cosmos DB SQL Role Definition.
	SQLRoleDefinitionGetResults
}

SQLResourcesClientGetSQLRoleDefinitionResponse contains the response from method SQLResourcesClient.GetSQLRoleDefinition.

type SQLResourcesClientGetSQLStoredProcedureOptions

type SQLResourcesClientGetSQLStoredProcedureOptions struct {
}

SQLResourcesClientGetSQLStoredProcedureOptions contains the optional parameters for the SQLResourcesClient.GetSQLStoredProcedure method.

type SQLResourcesClientGetSQLStoredProcedureResponse

type SQLResourcesClientGetSQLStoredProcedureResponse struct {
	// An Azure Cosmos DB storedProcedure.
	SQLStoredProcedureGetResults
}

SQLResourcesClientGetSQLStoredProcedureResponse contains the response from method SQLResourcesClient.GetSQLStoredProcedure.

type SQLResourcesClientGetSQLTriggerOptions

type SQLResourcesClientGetSQLTriggerOptions struct {
}

SQLResourcesClientGetSQLTriggerOptions contains the optional parameters for the SQLResourcesClient.GetSQLTrigger method.

type SQLResourcesClientGetSQLTriggerResponse

type SQLResourcesClientGetSQLTriggerResponse struct {
	// An Azure Cosmos DB trigger.
	SQLTriggerGetResults
}

SQLResourcesClientGetSQLTriggerResponse contains the response from method SQLResourcesClient.GetSQLTrigger.

type SQLResourcesClientGetSQLUserDefinedFunctionOptions

type SQLResourcesClientGetSQLUserDefinedFunctionOptions struct {
}

SQLResourcesClientGetSQLUserDefinedFunctionOptions contains the optional parameters for the SQLResourcesClient.GetSQLUserDefinedFunction method.

type SQLResourcesClientGetSQLUserDefinedFunctionResponse

type SQLResourcesClientGetSQLUserDefinedFunctionResponse struct {
	// An Azure Cosmos DB userDefinedFunction.
	SQLUserDefinedFunctionGetResults
}

SQLResourcesClientGetSQLUserDefinedFunctionResponse contains the response from method SQLResourcesClient.GetSQLUserDefinedFunction.

type SQLResourcesClientListClientEncryptionKeysOptions

type SQLResourcesClientListClientEncryptionKeysOptions struct {
}

SQLResourcesClientListClientEncryptionKeysOptions contains the optional parameters for the SQLResourcesClient.NewListClientEncryptionKeysPager method.

type SQLResourcesClientListClientEncryptionKeysResponse

type SQLResourcesClientListClientEncryptionKeysResponse struct {
	// The List operation response, that contains the client encryption keys and their properties.
	ClientEncryptionKeysListResult
}

SQLResourcesClientListClientEncryptionKeysResponse contains the response from method SQLResourcesClient.NewListClientEncryptionKeysPager.

type SQLResourcesClientListSQLContainerPartitionMergeResponse

type SQLResourcesClientListSQLContainerPartitionMergeResponse struct {
	// List of physical partitions and their properties returned by a merge operation.
	PhysicalPartitionStorageInfoCollection
}

SQLResourcesClientListSQLContainerPartitionMergeResponse contains the response from method SQLResourcesClient.BeginListSQLContainerPartitionMerge.

type SQLResourcesClientListSQLContainersOptions

type SQLResourcesClientListSQLContainersOptions struct {
}

SQLResourcesClientListSQLContainersOptions contains the optional parameters for the SQLResourcesClient.NewListSQLContainersPager method.

type SQLResourcesClientListSQLContainersResponse

type SQLResourcesClientListSQLContainersResponse struct {
	// The List operation response, that contains the containers and their properties.
	SQLContainerListResult
}

SQLResourcesClientListSQLContainersResponse contains the response from method SQLResourcesClient.NewListSQLContainersPager.

type SQLResourcesClientListSQLDatabasesOptions

type SQLResourcesClientListSQLDatabasesOptions struct {
}

SQLResourcesClientListSQLDatabasesOptions contains the optional parameters for the SQLResourcesClient.NewListSQLDatabasesPager method.

type SQLResourcesClientListSQLDatabasesResponse

type SQLResourcesClientListSQLDatabasesResponse struct {
	// The List operation response, that contains the SQL databases and their properties.
	SQLDatabaseListResult
}

SQLResourcesClientListSQLDatabasesResponse contains the response from method SQLResourcesClient.NewListSQLDatabasesPager.

type SQLResourcesClientListSQLRoleAssignmentsOptions

type SQLResourcesClientListSQLRoleAssignmentsOptions struct {
}

SQLResourcesClientListSQLRoleAssignmentsOptions contains the optional parameters for the SQLResourcesClient.NewListSQLRoleAssignmentsPager method.

type SQLResourcesClientListSQLRoleAssignmentsResponse

type SQLResourcesClientListSQLRoleAssignmentsResponse struct {
	// The relevant Role Assignments.
	SQLRoleAssignmentListResult
}

SQLResourcesClientListSQLRoleAssignmentsResponse contains the response from method SQLResourcesClient.NewListSQLRoleAssignmentsPager.

type SQLResourcesClientListSQLRoleDefinitionsOptions

type SQLResourcesClientListSQLRoleDefinitionsOptions struct {
}

SQLResourcesClientListSQLRoleDefinitionsOptions contains the optional parameters for the SQLResourcesClient.NewListSQLRoleDefinitionsPager method.

type SQLResourcesClientListSQLRoleDefinitionsResponse

type SQLResourcesClientListSQLRoleDefinitionsResponse struct {
	// The relevant Role Definitions.
	SQLRoleDefinitionListResult
}

SQLResourcesClientListSQLRoleDefinitionsResponse contains the response from method SQLResourcesClient.NewListSQLRoleDefinitionsPager.

type SQLResourcesClientListSQLStoredProceduresOptions

type SQLResourcesClientListSQLStoredProceduresOptions struct {
}

SQLResourcesClientListSQLStoredProceduresOptions contains the optional parameters for the SQLResourcesClient.NewListSQLStoredProceduresPager method.

type SQLResourcesClientListSQLStoredProceduresResponse

type SQLResourcesClientListSQLStoredProceduresResponse struct {
	// The List operation response, that contains the storedProcedures and their properties.
	SQLStoredProcedureListResult
}

SQLResourcesClientListSQLStoredProceduresResponse contains the response from method SQLResourcesClient.NewListSQLStoredProceduresPager.

type SQLResourcesClientListSQLTriggersOptions

type SQLResourcesClientListSQLTriggersOptions struct {
}

SQLResourcesClientListSQLTriggersOptions contains the optional parameters for the SQLResourcesClient.NewListSQLTriggersPager method.

type SQLResourcesClientListSQLTriggersResponse

type SQLResourcesClientListSQLTriggersResponse struct {
	// The List operation response, that contains the triggers and their properties.
	SQLTriggerListResult
}

SQLResourcesClientListSQLTriggersResponse contains the response from method SQLResourcesClient.NewListSQLTriggersPager.

type SQLResourcesClientListSQLUserDefinedFunctionsOptions

type SQLResourcesClientListSQLUserDefinedFunctionsOptions struct {
}

SQLResourcesClientListSQLUserDefinedFunctionsOptions contains the optional parameters for the SQLResourcesClient.NewListSQLUserDefinedFunctionsPager method.

type SQLResourcesClientListSQLUserDefinedFunctionsResponse

type SQLResourcesClientListSQLUserDefinedFunctionsResponse struct {
	// The List operation response, that contains the userDefinedFunctions and their properties.
	SQLUserDefinedFunctionListResult
}

SQLResourcesClientListSQLUserDefinedFunctionsResponse contains the response from method SQLResourcesClient.NewListSQLUserDefinedFunctionsPager.

type SQLResourcesClientMigrateSQLContainerToAutoscaleResponse

type SQLResourcesClientMigrateSQLContainerToAutoscaleResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

SQLResourcesClientMigrateSQLContainerToAutoscaleResponse contains the response from method SQLResourcesClient.BeginMigrateSQLContainerToAutoscale.

type SQLResourcesClientMigrateSQLContainerToManualThroughputResponse

type SQLResourcesClientMigrateSQLContainerToManualThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

SQLResourcesClientMigrateSQLContainerToManualThroughputResponse contains the response from method SQLResourcesClient.BeginMigrateSQLContainerToManualThroughput.

type SQLResourcesClientMigrateSQLDatabaseToAutoscaleResponse

type SQLResourcesClientMigrateSQLDatabaseToAutoscaleResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

SQLResourcesClientMigrateSQLDatabaseToAutoscaleResponse contains the response from method SQLResourcesClient.BeginMigrateSQLDatabaseToAutoscale.

type SQLResourcesClientMigrateSQLDatabaseToManualThroughputResponse

type SQLResourcesClientMigrateSQLDatabaseToManualThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

SQLResourcesClientMigrateSQLDatabaseToManualThroughputResponse contains the response from method SQLResourcesClient.BeginMigrateSQLDatabaseToManualThroughput.

type SQLResourcesClientRetrieveContinuousBackupInformationResponse

type SQLResourcesClientRetrieveContinuousBackupInformationResponse struct {
	// Backup information of a resource.
	BackupInformation
}

SQLResourcesClientRetrieveContinuousBackupInformationResponse contains the response from method SQLResourcesClient.BeginRetrieveContinuousBackupInformation.

type SQLResourcesClientSQLContainerRedistributeThroughputResponse

type SQLResourcesClientSQLContainerRedistributeThroughputResponse struct {
	// An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.
	PhysicalPartitionThroughputInfoResult
}

SQLResourcesClientSQLContainerRedistributeThroughputResponse contains the response from method SQLResourcesClient.BeginSQLContainerRedistributeThroughput.

type SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse

type SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse struct {
	// An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.
	PhysicalPartitionThroughputInfoResult
}

SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse contains the response from method SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution.

type SQLResourcesClientSQLDatabasePartitionMergeResponse

type SQLResourcesClientSQLDatabasePartitionMergeResponse struct {
	// List of physical partitions and their properties returned by a merge operation.
	PhysicalPartitionStorageInfoCollection
}

SQLResourcesClientSQLDatabasePartitionMergeResponse contains the response from method SQLResourcesClient.BeginSQLDatabasePartitionMerge.

type SQLResourcesClientSQLDatabaseRedistributeThroughputResponse

type SQLResourcesClientSQLDatabaseRedistributeThroughputResponse struct {
	// An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.
	PhysicalPartitionThroughputInfoResult
}

SQLResourcesClientSQLDatabaseRedistributeThroughputResponse contains the response from method SQLResourcesClient.BeginSQLDatabaseRedistributeThroughput.

type SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse

type SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse struct {
	// An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.
	PhysicalPartitionThroughputInfoResult
}

SQLResourcesClientSQLDatabaseRetrieveThroughputDistributionResponse contains the response from method SQLResourcesClient.BeginSQLDatabaseRetrieveThroughputDistribution.

type SQLResourcesClientUpdateSQLContainerThroughputResponse

type SQLResourcesClientUpdateSQLContainerThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

SQLResourcesClientUpdateSQLContainerThroughputResponse contains the response from method SQLResourcesClient.BeginUpdateSQLContainerThroughput.

type SQLResourcesClientUpdateSQLDatabaseThroughputResponse

type SQLResourcesClientUpdateSQLDatabaseThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

SQLResourcesClientUpdateSQLDatabaseThroughputResponse contains the response from method SQLResourcesClient.BeginUpdateSQLDatabaseThroughput.

type SQLRoleAssignmentCreateUpdateParameters

type SQLRoleAssignmentCreateUpdateParameters struct {
	// Properties to create and update an Azure Cosmos DB SQL Role Assignment.
	Properties *SQLRoleAssignmentResource
}

SQLRoleAssignmentCreateUpdateParameters - Parameters to create and update an Azure Cosmos DB SQL Role Assignment.

func (SQLRoleAssignmentCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLRoleAssignmentCreateUpdateParameters.

func (*SQLRoleAssignmentCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLRoleAssignmentCreateUpdateParameters.

type SQLRoleAssignmentGetResults

type SQLRoleAssignmentGetResults struct {
	// Properties related to the Role Assignment.
	Properties *SQLRoleAssignmentResource

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLRoleAssignmentGetResults - An Azure Cosmos DB Role Assignment

func (SQLRoleAssignmentGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLRoleAssignmentGetResults.

func (*SQLRoleAssignmentGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLRoleAssignmentGetResults.

type SQLRoleAssignmentListResult

type SQLRoleAssignmentListResult struct {
	// READ-ONLY; List of Role Assignments and their properties
	Value []*SQLRoleAssignmentGetResults
}

SQLRoleAssignmentListResult - The relevant Role Assignments.

func (SQLRoleAssignmentListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLRoleAssignmentListResult.

func (*SQLRoleAssignmentListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLRoleAssignmentListResult.

type SQLRoleAssignmentResource

type SQLRoleAssignmentResource struct {
	// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role
	// Assignment. Tenant ID for the principal is inferred using the tenant
	// associated with the subscription.
	PrincipalID *string

	// The unique identifier for the associated Role Definition.
	RoleDefinitionID *string

	// The data plane resource path for which access is being granted through this Role Assignment.
	Scope *string
}

SQLRoleAssignmentResource - Azure Cosmos DB SQL Role Assignment resource object.

func (SQLRoleAssignmentResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLRoleAssignmentResource.

func (*SQLRoleAssignmentResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLRoleAssignmentResource.

type SQLRoleDefinitionCreateUpdateParameters

type SQLRoleDefinitionCreateUpdateParameters struct {
	// Properties to create and update an Azure Cosmos DB SQL Role Definition.
	Properties *SQLRoleDefinitionResource
}

SQLRoleDefinitionCreateUpdateParameters - Parameters to create and update an Azure Cosmos DB SQL Role Definition.

func (SQLRoleDefinitionCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLRoleDefinitionCreateUpdateParameters.

func (*SQLRoleDefinitionCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLRoleDefinitionCreateUpdateParameters.

type SQLRoleDefinitionGetResults

type SQLRoleDefinitionGetResults struct {
	// Properties related to the Role Definition.
	Properties *SQLRoleDefinitionResource

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLRoleDefinitionGetResults - An Azure Cosmos DB SQL Role Definition.

func (SQLRoleDefinitionGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLRoleDefinitionGetResults.

func (*SQLRoleDefinitionGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLRoleDefinitionGetResults.

type SQLRoleDefinitionListResult

type SQLRoleDefinitionListResult struct {
	// READ-ONLY; List of Role Definitions and their properties.
	Value []*SQLRoleDefinitionGetResults
}

SQLRoleDefinitionListResult - The relevant Role Definitions.

func (SQLRoleDefinitionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLRoleDefinitionListResult.

func (*SQLRoleDefinitionListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLRoleDefinitionListResult.

type SQLRoleDefinitionResource

type SQLRoleDefinitionResource struct {
	// A set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will
	// allow application of this Role Definition on the entire database account or any
	// underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable
	// as assignable Scopes. Note that resources referenced in assignable Scopes need
	// not exist.
	AssignableScopes []*string

	// The set of operations allowed through this Role Definition.
	Permissions []*Permission

	// A user-friendly name for the Role Definition. Must be unique for the database account.
	RoleName *string

	// Indicates whether the Role Definition was built-in or user created.
	Type *RoleDefinitionType
}

SQLRoleDefinitionResource - Azure Cosmos DB SQL Role Definition resource object.

func (SQLRoleDefinitionResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLRoleDefinitionResource.

func (*SQLRoleDefinitionResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLRoleDefinitionResource.

type SQLStoredProcedureCreateUpdateParameters

type SQLStoredProcedureCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB storedProcedure.
	Properties *SQLStoredProcedureCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLStoredProcedureCreateUpdateParameters - Parameters to create and update Cosmos DB storedProcedure.

func (SQLStoredProcedureCreateUpdateParameters) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type SQLStoredProcedureCreateUpdateParameters.

func (*SQLStoredProcedureCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLStoredProcedureCreateUpdateParameters.

type SQLStoredProcedureCreateUpdateProperties

type SQLStoredProcedureCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a storedProcedure
	Resource *SQLStoredProcedureResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

SQLStoredProcedureCreateUpdateProperties - Properties to create and update Azure Cosmos DB storedProcedure.

func (SQLStoredProcedureCreateUpdateProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type SQLStoredProcedureCreateUpdateProperties.

func (*SQLStoredProcedureCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLStoredProcedureCreateUpdateProperties.

type SQLStoredProcedureGetProperties

type SQLStoredProcedureGetProperties struct {
	Resource *SQLStoredProcedureGetPropertiesResource
}

SQLStoredProcedureGetProperties - The properties of an Azure Cosmos DB StoredProcedure

func (SQLStoredProcedureGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLStoredProcedureGetProperties.

func (*SQLStoredProcedureGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLStoredProcedureGetProperties.

type SQLStoredProcedureGetPropertiesResource

type SQLStoredProcedureGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB SQL storedProcedure
	ID *string

	// Body of the Stored Procedure
	Body *string

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (SQLStoredProcedureGetPropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLStoredProcedureGetPropertiesResource.

func (*SQLStoredProcedureGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLStoredProcedureGetPropertiesResource.

type SQLStoredProcedureGetResults

type SQLStoredProcedureGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB storedProcedure
	Properties *SQLStoredProcedureGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLStoredProcedureGetResults - An Azure Cosmos DB storedProcedure.

func (SQLStoredProcedureGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLStoredProcedureGetResults.

func (*SQLStoredProcedureGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLStoredProcedureGetResults.

type SQLStoredProcedureListResult

type SQLStoredProcedureListResult struct {
	// READ-ONLY; List of storedProcedures and their properties.
	Value []*SQLStoredProcedureGetResults
}

SQLStoredProcedureListResult - The List operation response, that contains the storedProcedures and their properties.

func (SQLStoredProcedureListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLStoredProcedureListResult.

func (*SQLStoredProcedureListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLStoredProcedureListResult.

type SQLStoredProcedureResource

type SQLStoredProcedureResource struct {
	// REQUIRED; Name of the Cosmos DB SQL storedProcedure
	ID *string

	// Body of the Stored Procedure
	Body *string
}

SQLStoredProcedureResource - Cosmos DB SQL storedProcedure resource object

func (SQLStoredProcedureResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLStoredProcedureResource.

func (*SQLStoredProcedureResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLStoredProcedureResource.

type SQLTriggerCreateUpdateParameters

type SQLTriggerCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB trigger.
	Properties *SQLTriggerCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLTriggerCreateUpdateParameters - Parameters to create and update Cosmos DB trigger.

func (SQLTriggerCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLTriggerCreateUpdateParameters.

func (*SQLTriggerCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLTriggerCreateUpdateParameters.

type SQLTriggerCreateUpdateProperties

type SQLTriggerCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a trigger
	Resource *SQLTriggerResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

SQLTriggerCreateUpdateProperties - Properties to create and update Azure Cosmos DB trigger.

func (SQLTriggerCreateUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLTriggerCreateUpdateProperties.

func (*SQLTriggerCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLTriggerCreateUpdateProperties.

type SQLTriggerGetProperties

type SQLTriggerGetProperties struct {
	Resource *SQLTriggerGetPropertiesResource
}

SQLTriggerGetProperties - The properties of an Azure Cosmos DB trigger

func (SQLTriggerGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLTriggerGetProperties.

func (*SQLTriggerGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLTriggerGetProperties.

type SQLTriggerGetPropertiesResource

type SQLTriggerGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB SQL trigger
	ID *string

	// Body of the Trigger
	Body *string

	// The operation the trigger is associated with
	TriggerOperation *TriggerOperation

	// Type of the Trigger
	TriggerType *TriggerType

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (SQLTriggerGetPropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLTriggerGetPropertiesResource.

func (*SQLTriggerGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLTriggerGetPropertiesResource.

type SQLTriggerGetResults

type SQLTriggerGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB trigger
	Properties *SQLTriggerGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLTriggerGetResults - An Azure Cosmos DB trigger.

func (SQLTriggerGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLTriggerGetResults.

func (*SQLTriggerGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLTriggerGetResults.

type SQLTriggerListResult

type SQLTriggerListResult struct {
	// READ-ONLY; List of triggers and their properties.
	Value []*SQLTriggerGetResults
}

SQLTriggerListResult - The List operation response, that contains the triggers and their properties.

func (SQLTriggerListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLTriggerListResult.

func (*SQLTriggerListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLTriggerListResult.

type SQLTriggerResource

type SQLTriggerResource struct {
	// REQUIRED; Name of the Cosmos DB SQL trigger
	ID *string

	// Body of the Trigger
	Body *string

	// The operation the trigger is associated with
	TriggerOperation *TriggerOperation

	// Type of the Trigger
	TriggerType *TriggerType
}

SQLTriggerResource - Cosmos DB SQL trigger resource object

func (SQLTriggerResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLTriggerResource.

func (*SQLTriggerResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLTriggerResource.

type SQLUserDefinedFunctionCreateUpdateParameters

type SQLUserDefinedFunctionCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB userDefinedFunction.
	Properties *SQLUserDefinedFunctionCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLUserDefinedFunctionCreateUpdateParameters - Parameters to create and update Cosmos DB userDefinedFunction.

func (SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type SQLUserDefinedFunctionCreateUpdateParameters.

func (*SQLUserDefinedFunctionCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLUserDefinedFunctionCreateUpdateParameters.

type SQLUserDefinedFunctionCreateUpdateProperties

type SQLUserDefinedFunctionCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a userDefinedFunction
	Resource *SQLUserDefinedFunctionResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

SQLUserDefinedFunctionCreateUpdateProperties - Properties to create and update Azure Cosmos DB userDefinedFunction.

func (SQLUserDefinedFunctionCreateUpdateProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type SQLUserDefinedFunctionCreateUpdateProperties.

func (*SQLUserDefinedFunctionCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLUserDefinedFunctionCreateUpdateProperties.

type SQLUserDefinedFunctionGetProperties

type SQLUserDefinedFunctionGetProperties struct {
	Resource *SQLUserDefinedFunctionGetPropertiesResource
}

SQLUserDefinedFunctionGetProperties - The properties of an Azure Cosmos DB userDefinedFunction

func (SQLUserDefinedFunctionGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLUserDefinedFunctionGetProperties.

func (*SQLUserDefinedFunctionGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLUserDefinedFunctionGetProperties.

type SQLUserDefinedFunctionGetPropertiesResource

type SQLUserDefinedFunctionGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB SQL userDefinedFunction
	ID *string

	// Body of the User Defined Function
	Body *string

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (SQLUserDefinedFunctionGetPropertiesResource) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type SQLUserDefinedFunctionGetPropertiesResource.

func (*SQLUserDefinedFunctionGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLUserDefinedFunctionGetPropertiesResource.

type SQLUserDefinedFunctionGetResults

type SQLUserDefinedFunctionGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB userDefinedFunction
	Properties *SQLUserDefinedFunctionGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

SQLUserDefinedFunctionGetResults - An Azure Cosmos DB userDefinedFunction.

func (SQLUserDefinedFunctionGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLUserDefinedFunctionGetResults.

func (*SQLUserDefinedFunctionGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLUserDefinedFunctionGetResults.

type SQLUserDefinedFunctionListResult

type SQLUserDefinedFunctionListResult struct {
	// READ-ONLY; List of userDefinedFunctions and their properties.
	Value []*SQLUserDefinedFunctionGetResults
}

SQLUserDefinedFunctionListResult - The List operation response, that contains the userDefinedFunctions and their properties.

func (SQLUserDefinedFunctionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLUserDefinedFunctionListResult.

func (*SQLUserDefinedFunctionListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLUserDefinedFunctionListResult.

type SQLUserDefinedFunctionResource

type SQLUserDefinedFunctionResource struct {
	// REQUIRED; Name of the Cosmos DB SQL userDefinedFunction
	ID *string

	// Body of the User Defined Function
	Body *string
}

SQLUserDefinedFunctionResource - Cosmos DB SQL userDefinedFunction resource object

func (SQLUserDefinedFunctionResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLUserDefinedFunctionResource.

func (*SQLUserDefinedFunctionResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLUserDefinedFunctionResource.

type ScheduledEventStrategy

type ScheduledEventStrategy string

ScheduledEventStrategy - How the nodes in the cluster react to scheduled events

const (
	ScheduledEventStrategyIgnore     ScheduledEventStrategy = "Ignore"
	ScheduledEventStrategyStopAny    ScheduledEventStrategy = "StopAny"
	ScheduledEventStrategyStopByRack ScheduledEventStrategy = "StopByRack"
)

func PossibleScheduledEventStrategyValues

func PossibleScheduledEventStrategyValues() []ScheduledEventStrategy

PossibleScheduledEventStrategyValues returns the possible values for the ScheduledEventStrategy const type.

type SeedNode

type SeedNode struct {
	// IP address of this seed node.
	IPAddress *string
}

func (SeedNode) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SeedNode.

func (*SeedNode) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SeedNode.

type ServerVersion

type ServerVersion string

ServerVersion - Describes the ServerVersion of an a MongoDB account.

const (
	ServerVersionFour0  ServerVersion = "4.0"
	ServerVersionFour2  ServerVersion = "4.2"
	ServerVersionThree2 ServerVersion = "3.2"
	ServerVersionThree6 ServerVersion = "3.6"
)

func PossibleServerVersionValues

func PossibleServerVersionValues() []ServerVersion

PossibleServerVersionValues returns the possible values for the ServerVersion const type.

type ServiceClient

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

ServiceClient contains the methods for the Service group. Don't use this type directly, use NewServiceClient() instead.

func NewServiceClient

func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceClient, error)

NewServiceClient creates a new instance of ServiceClient with the specified values.

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

func (*ServiceClient) BeginCreate

func (client *ServiceClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResourceCreateUpdateParameters, options *ServiceClientBeginCreateOptions) (*runtime.Poller[ServiceClientCreateResponse], error)

BeginCreate - Creates a service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • serviceName - Cosmos DB service name.
  • createUpdateParameters - The Service resource parameters.
  • options - ServiceClientBeginCreateOptions contains the optional parameters for the ServiceClient.BeginCreate method.
Example (DataTransferServiceCreate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDataTransferServiceCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServiceClient().BeginCreate(ctx, "rg1", "ddb1", "DataTransfer", armcosmos.ServiceResourceCreateUpdateParameters{
	Properties: &armcosmos.ServiceResourceCreateUpdateProperties{
		InstanceCount: to.Ptr[int32](1),
		InstanceSize:  to.Ptr(armcosmos.ServiceSizeCosmosD4S),
		ServiceType:   to.Ptr(armcosmos.ServiceTypeDataTransfer),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ServiceResource = armcosmos.ServiceResource{
// 	Name: to.Ptr("DataTransfer"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/DataTransfer"),
// 	Properties: &armcosmos.DataTransferServiceResourceProperties{
// 		CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()),
// 		InstanceCount: to.Ptr[int32](1),
// 		InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S),
// 		ServiceType: to.Ptr(armcosmos.ServiceTypeDataTransfer),
// 		Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		Locations: []*armcosmos.DataTransferRegionalServiceResource{
// 			{
// 				Name: to.Ptr("DataTransfer-westus2"),
// 				Location: to.Ptr("West US 2"),
// 				Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		}},
// 	},
// }
Output:

Example (GraphApiComputeServiceCreate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServiceClient().BeginCreate(ctx, "rg1", "ddb1", "GraphAPICompute", armcosmos.ServiceResourceCreateUpdateParameters{
	Properties: &armcosmos.ServiceResourceCreateUpdateProperties{
		InstanceCount: to.Ptr[int32](1),
		InstanceSize:  to.Ptr(armcosmos.ServiceSizeCosmosD4S),
		ServiceType:   to.Ptr(armcosmos.ServiceTypeGraphAPICompute),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ServiceResource = armcosmos.ServiceResource{
// 	Name: to.Ptr("GraphAPICompute"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/GraphAPICompute"),
// 	Properties: &armcosmos.GraphAPIComputeServiceResourceProperties{
// 		CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()),
// 		InstanceCount: to.Ptr[int32](1),
// 		InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S),
// 		ServiceType: to.Ptr(armcosmos.ServiceTypeGraphAPICompute),
// 		Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		GraphAPIComputeEndpoint: to.Ptr("https://graphAPICompute.gremlin.cosmos.windows-int.net/"),
// 		Locations: []*armcosmos.GraphAPIComputeRegionalServiceResource{
// 			{
// 				Name: to.Ptr("GraphAPICompute-westus2"),
// 				Location: to.Ptr("West US 2"),
// 				Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 				GraphAPIComputeEndpoint: to.Ptr("https://graphAPICompute-westus.gremlin.cosmos.windows-int.net/"),
// 		}},
// 	},
// }
Output:

Example (MaterializedViewsBuilderServiceCreate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServiceClient().BeginCreate(ctx, "rg1", "ddb1", "MaterializedViewsBuilder", armcosmos.ServiceResourceCreateUpdateParameters{
	Properties: &armcosmos.ServiceResourceCreateUpdateProperties{
		InstanceCount: to.Ptr[int32](1),
		InstanceSize:  to.Ptr(armcosmos.ServiceSizeCosmosD4S),
		ServiceType:   to.Ptr(armcosmos.ServiceTypeMaterializedViewsBuilder),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ServiceResource = armcosmos.ServiceResource{
// 	Name: to.Ptr("MaterializedViewsBuilder"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/MaterializedViewsBuilder"),
// 	Properties: &armcosmos.MaterializedViewsBuilderServiceResourceProperties{
// 		CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()),
// 		InstanceCount: to.Ptr[int32](1),
// 		InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S),
// 		ServiceType: to.Ptr(armcosmos.ServiceTypeMaterializedViewsBuilder),
// 		Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		Locations: []*armcosmos.MaterializedViewsBuilderRegionalServiceResource{
// 			{
// 				Name: to.Ptr("MaterializedViewsBuilder-westus2"),
// 				Location: to.Ptr("West US 2"),
// 				Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		}},
// 	},
// }
Output:

Example (SqlDedicatedGatewayServiceCreate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServiceClient().BeginCreate(ctx, "rg1", "ddb1", "SqlDedicatedGateway", armcosmos.ServiceResourceCreateUpdateParameters{
	Properties: &armcosmos.ServiceResourceCreateUpdateProperties{
		InstanceCount: to.Ptr[int32](1),
		InstanceSize:  to.Ptr(armcosmos.ServiceSizeCosmosD4S),
		ServiceType:   to.Ptr(armcosmos.ServiceTypeSQLDedicatedGateway),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ServiceResource = armcosmos.ServiceResource{
// 	Name: to.Ptr("SqlDedicatedGateway"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/SqlDedicatedGateway"),
// 	Properties: &armcosmos.SQLDedicatedGatewayServiceResourceProperties{
// 		CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()),
// 		InstanceCount: to.Ptr[int32](1),
// 		InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S),
// 		ServiceType: to.Ptr(armcosmos.ServiceTypeSQLDedicatedGateway),
// 		Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		Locations: []*armcosmos.SQLDedicatedGatewayRegionalServiceResource{
// 			{
// 				Name: to.Ptr("SqlDedicatedGateway-westus2"),
// 				Location: to.Ptr("West US 2"),
// 				Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 				SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"),
// 		}},
// 		SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/"),
// 	},
// }
Output:

func (*ServiceClient) BeginDelete

func (client *ServiceClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, serviceName string, options *ServiceClientBeginDeleteOptions) (*runtime.Poller[ServiceClientDeleteResponse], error)

BeginDelete - Deletes service with the given serviceName. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • serviceName - Cosmos DB service name.
  • options - ServiceClientBeginDeleteOptions contains the optional parameters for the ServiceClient.BeginDelete method.
Example (DataTransferServiceDelete)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDataTransferServiceDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServiceClient().BeginDelete(ctx, "rg1", "ddb1", "DataTransfer", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

Example (GraphApiComputeServiceDelete)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServiceClient().BeginDelete(ctx, "rg1", "ddb1", "GraphAPICompute", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

Example (MaterializedViewsBuilderServiceDelete)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServiceClient().BeginDelete(ctx, "rg1", "ddb1", "MaterializedViewsBuilder", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

Example (SqlDedicatedGatewayServiceDelete)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServiceClient().BeginDelete(ctx, "rg1", "ddb1", "SqlDedicatedGateway", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*ServiceClient) Get

func (client *ServiceClient) Get(ctx context.Context, resourceGroupName string, accountName string, serviceName string, options *ServiceClientGetOptions) (ServiceClientGetResponse, error)

Get - Gets the status of service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • serviceName - Cosmos DB service name.
  • options - ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method.
Example (DataTransferServiceGet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBDataTransferServiceGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServiceClient().Get(ctx, "rg1", "ddb1", "DataTransfer", 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.ServiceResource = armcosmos.ServiceResource{
// 	Name: to.Ptr("DataTransfer"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/DataTransfer"),
// 	Properties: &armcosmos.DataTransferServiceResourceProperties{
// 		CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()),
// 		InstanceCount: to.Ptr[int32](1),
// 		InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S),
// 		ServiceType: to.Ptr(armcosmos.ServiceTypeDataTransfer),
// 		Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		Locations: []*armcosmos.DataTransferRegionalServiceResource{
// 			{
// 				Name: to.Ptr("DataTransfer-westus2"),
// 				Location: to.Ptr("West US 2"),
// 				Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		}},
// 	},
// }
Output:

Example (GraphApiComputeServiceGet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServiceClient().Get(ctx, "rg1", "ddb1", "GraphAPICompute", 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.ServiceResource = armcosmos.ServiceResource{
// 	Name: to.Ptr("GraphAPICompute"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/GraphAPICompute"),
// 	Properties: &armcosmos.GraphAPIComputeServiceResourceProperties{
// 		CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()),
// 		InstanceCount: to.Ptr[int32](1),
// 		InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S),
// 		ServiceType: to.Ptr(armcosmos.ServiceTypeGraphAPICompute),
// 		Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		GraphAPIComputeEndpoint: to.Ptr("https://graphAPICompute.gremlin.cosmos.windows-int.net/"),
// 		Locations: []*armcosmos.GraphAPIComputeRegionalServiceResource{
// 			{
// 				Name: to.Ptr("GraphAPICompute-westus2"),
// 				Location: to.Ptr("West US 2"),
// 				Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 				GraphAPIComputeEndpoint: to.Ptr("https://graphAPICompute-westus.gremlin.cosmos.windows-int.net/"),
// 		}},
// 	},
// }
Output:

Example (MaterializedViewsBuilderServiceGet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServiceClient().Get(ctx, "rg1", "ddb1", "MaterializedViewsBuilder", 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.ServiceResource = armcosmos.ServiceResource{
// 	Name: to.Ptr("MaterializedViewsBuilder"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/MaterializedViewsBuilder"),
// 	Properties: &armcosmos.MaterializedViewsBuilderServiceResourceProperties{
// 		CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()),
// 		InstanceCount: to.Ptr[int32](1),
// 		InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S),
// 		ServiceType: to.Ptr(armcosmos.ServiceTypeMaterializedViewsBuilder),
// 		Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		Locations: []*armcosmos.MaterializedViewsBuilderRegionalServiceResource{
// 			{
// 				Name: to.Ptr("MaterializedViewsBuilder-westus2"),
// 				Location: to.Ptr("West US 2"),
// 				Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		}},
// 	},
// }
Output:

Example (SqlDedicatedGatewayServiceGet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServiceClient().Get(ctx, "rg1", "ddb1", "SqlDedicatedGateway", 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.ServiceResource = armcosmos.ServiceResource{
// 	Name: to.Ptr("SqlDedicatedGateway"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/SqlDedicatedGateway"),
// 	Properties: &armcosmos.SQLDedicatedGatewayServiceResourceProperties{
// 		CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()),
// 		InstanceCount: to.Ptr[int32](1),
// 		InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S),
// 		ServiceType: to.Ptr(armcosmos.ServiceTypeSQLDedicatedGateway),
// 		Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 		Locations: []*armcosmos.SQLDedicatedGatewayRegionalServiceResource{
// 			{
// 				Name: to.Ptr("SqlDedicatedGateway-westus2"),
// 				Location: to.Ptr("West US 2"),
// 				Status: to.Ptr(armcosmos.ServiceStatusRunning),
// 				SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"),
// 		}},
// 		SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/"),
// 	},
// }
Output:

func (*ServiceClient) NewListPager

func (client *ServiceClient) NewListPager(resourceGroupName string, accountName string, options *ServiceClientListOptions) *runtime.Pager[ServiceClientListResponse]

NewListPager - Gets the status of service.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - ServiceClientListOptions contains the optional parameters for the ServiceClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBServicesList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewServiceClient().NewListPager("rg1", "ddb1", 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.ServiceResourceListResult = armcosmos.ServiceResourceListResult{
	// 	Value: []*armcosmos.ServiceResource{
	// 		{
	// 			Name: to.Ptr("sqlDedicatedGateway"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/services"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services/sqlDedicatedGateway"),
	// 			Properties: &armcosmos.SQLDedicatedGatewayServiceResourceProperties{
	// 				CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-25T12:56:05.462Z"); return t}()),
	// 				InstanceCount: to.Ptr[int32](1),
	// 				InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S),
	// 				ServiceType: to.Ptr(armcosmos.ServiceTypeSQLDedicatedGateway),
	// 				Status: to.Ptr(armcosmos.ServiceStatusRunning),
	// 				Locations: []*armcosmos.SQLDedicatedGatewayRegionalServiceResource{
	// 					{
	// 						Name: to.Ptr("sqlDedicatedGateway-westus2"),
	// 						Location: to.Ptr("West US 2"),
	// 						Status: to.Ptr(armcosmos.ServiceStatusRunning),
	// 						SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"),
	// 				}},
	// 				SQLDedicatedGatewayEndpoint: to.Ptr("https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/"),
	// 			},
	// 	}},
	// }
}
Output:

type ServiceClientBeginCreateOptions

type ServiceClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ServiceClientBeginCreateOptions contains the optional parameters for the ServiceClient.BeginCreate method.

type ServiceClientBeginDeleteOptions

type ServiceClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ServiceClientBeginDeleteOptions contains the optional parameters for the ServiceClient.BeginDelete method.

type ServiceClientCreateResponse

type ServiceClientCreateResponse struct {
	// Properties for the database account.
	ServiceResource
}

ServiceClientCreateResponse contains the response from method ServiceClient.BeginCreate.

type ServiceClientDeleteResponse

type ServiceClientDeleteResponse struct {
}

ServiceClientDeleteResponse contains the response from method ServiceClient.BeginDelete.

type ServiceClientGetOptions

type ServiceClientGetOptions struct {
}

ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method.

type ServiceClientGetResponse

type ServiceClientGetResponse struct {
	// Properties for the database account.
	ServiceResource
}

ServiceClientGetResponse contains the response from method ServiceClient.Get.

type ServiceClientListOptions

type ServiceClientListOptions struct {
}

ServiceClientListOptions contains the optional parameters for the ServiceClient.NewListPager method.

type ServiceClientListResponse

type ServiceClientListResponse struct {
	// The List operation response, that contains the Service Resource and their properties.
	ServiceResourceListResult
}

ServiceClientListResponse contains the response from method ServiceClient.NewListPager.

type ServiceResource

type ServiceResource struct {
	// Services response resource.
	Properties ServiceResourcePropertiesClassification

	// READ-ONLY; The unique resource identifier of the database account.
	ID *string

	// READ-ONLY; The name of the database account.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

ServiceResource - Properties for the database account.

func (ServiceResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServiceResource.

func (*ServiceResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResource.

type ServiceResourceCreateUpdateParameters

type ServiceResourceCreateUpdateParameters struct {
	// Properties in ServiceResourceCreateUpdateParameters.
	Properties *ServiceResourceCreateUpdateProperties
}

ServiceResourceCreateUpdateParameters - Parameters for Create or Update Request for ServiceResource

func (ServiceResourceCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServiceResourceCreateUpdateParameters.

func (*ServiceResourceCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceCreateUpdateParameters.

type ServiceResourceCreateUpdateProperties

type ServiceResourceCreateUpdateProperties struct {
	// Instance count for the service.
	InstanceCount *int32

	// Instance type for the service.
	InstanceSize *ServiceSize

	// ServiceType for the service.
	ServiceType *ServiceType
}

ServiceResourceCreateUpdateProperties - Properties in ServiceResourceCreateUpdateParameters.

func (ServiceResourceCreateUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServiceResourceCreateUpdateProperties.

func (*ServiceResourceCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceCreateUpdateProperties.

type ServiceResourceListResult

type ServiceResourceListResult struct {
	// READ-ONLY; List of Service Resource and their properties.
	Value []*ServiceResource
}

ServiceResourceListResult - The List operation response, that contains the Service Resource and their properties.

func (ServiceResourceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServiceResourceListResult.

func (*ServiceResourceListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceListResult.

type ServiceResourceProperties

type ServiceResourceProperties struct {
	// REQUIRED; ServiceType for the service.
	ServiceType *ServiceType

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

	// Instance count for the service.
	InstanceCount *int32

	// Instance type for the service.
	InstanceSize *ServiceSize

	// READ-ONLY; Time of the last state change (ISO-8601 format).
	CreationTime *time.Time

	// READ-ONLY; Describes the status of a service.
	Status *ServiceStatus
}

ServiceResourceProperties - Services response resource.

func (*ServiceResourceProperties) GetServiceResourceProperties

func (s *ServiceResourceProperties) GetServiceResourceProperties() *ServiceResourceProperties

GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type ServiceResourceProperties.

func (ServiceResourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServiceResourceProperties.

func (*ServiceResourceProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceProperties.

type ServiceResourcePropertiesClassification

type ServiceResourcePropertiesClassification interface {
	// GetServiceResourceProperties returns the ServiceResourceProperties content of the underlying type.
	GetServiceResourceProperties() *ServiceResourceProperties
}

ServiceResourcePropertiesClassification provides polymorphic access to related types. Call the interface's GetServiceResourceProperties() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *DataTransferServiceResourceProperties, *GraphAPIComputeServiceResourceProperties, *MaterializedViewsBuilderServiceResourceProperties, - *SQLDedicatedGatewayServiceResourceProperties, *ServiceResourceProperties

type ServiceSize

type ServiceSize string

ServiceSize - Instance type for the service.

const (
	ServiceSizeCosmosD16S ServiceSize = "Cosmos.D16s"
	ServiceSizeCosmosD4S  ServiceSize = "Cosmos.D4s"
	ServiceSizeCosmosD8S  ServiceSize = "Cosmos.D8s"
)

func PossibleServiceSizeValues

func PossibleServiceSizeValues() []ServiceSize

PossibleServiceSizeValues returns the possible values for the ServiceSize const type.

type ServiceStatus

type ServiceStatus string

ServiceStatus - Describes the status of a service.

const (
	ServiceStatusCreating ServiceStatus = "Creating"
	ServiceStatusDeleting ServiceStatus = "Deleting"
	ServiceStatusError    ServiceStatus = "Error"
	ServiceStatusRunning  ServiceStatus = "Running"
	ServiceStatusStopped  ServiceStatus = "Stopped"
	ServiceStatusUpdating ServiceStatus = "Updating"
)

func PossibleServiceStatusValues

func PossibleServiceStatusValues() []ServiceStatus

PossibleServiceStatusValues returns the possible values for the ServiceStatus const type.

type ServiceType

type ServiceType string

ServiceType - ServiceType for the service.

const (
	ServiceTypeDataTransfer             ServiceType = "DataTransfer"
	ServiceTypeGraphAPICompute          ServiceType = "GraphAPICompute"
	ServiceTypeMaterializedViewsBuilder ServiceType = "MaterializedViewsBuilder"
	ServiceTypeSQLDedicatedGateway      ServiceType = "SqlDedicatedGateway"
)

func PossibleServiceTypeValues

func PossibleServiceTypeValues() []ServiceType

PossibleServiceTypeValues returns the possible values for the ServiceType const type.

type SpatialSpec

type SpatialSpec struct {
	// The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
	Path *string

	// List of path's spatial type
	Types []*SpatialType
}

func (SpatialSpec) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SpatialSpec.

func (*SpatialSpec) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SpatialSpec.

type SpatialType

type SpatialType string

SpatialType - Indicates the spatial type of index.

const (
	SpatialTypeLineString   SpatialType = "LineString"
	SpatialTypeMultiPolygon SpatialType = "MultiPolygon"
	SpatialTypePoint        SpatialType = "Point"
	SpatialTypePolygon      SpatialType = "Polygon"
)

func PossibleSpatialTypeValues

func PossibleSpatialTypeValues() []SpatialType

PossibleSpatialTypeValues returns the possible values for the SpatialType const type.

type Status

type Status string

Status - Enum to indicate current buildout status of the region.

const (
	StatusCanceled        Status = "Canceled"
	StatusDeleting        Status = "Deleting"
	StatusFailed          Status = "Failed"
	StatusInitializing    Status = "Initializing"
	StatusInternallyReady Status = "InternallyReady"
	StatusOnline          Status = "Online"
	StatusSucceeded       Status = "Succeeded"
	StatusUninitialized   Status = "Uninitialized"
	StatusUpdating        Status = "Updating"
)

func PossibleStatusValues

func PossibleStatusValues() []Status

PossibleStatusValues returns the possible values for the Status const type.

type SystemData

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

	// The identity that created the resource.
	CreatedBy *string

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

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

	// The identity that last modified the resource.
	LastModifiedBy *string

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

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

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 TableCreateUpdateParameters

type TableCreateUpdateParameters struct {
	// REQUIRED; Properties to create and update Azure Cosmos DB Table.
	Properties *TableCreateUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

TableCreateUpdateParameters - Parameters to create and update Cosmos DB Table.

func (TableCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TableCreateUpdateParameters.

func (*TableCreateUpdateParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TableCreateUpdateParameters.

type TableCreateUpdateProperties

type TableCreateUpdateProperties struct {
	// REQUIRED; The standard JSON format of a Table
	Resource *TableResource

	// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
	Options *CreateUpdateOptions
}

TableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Table.

func (TableCreateUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TableCreateUpdateProperties.

func (*TableCreateUpdateProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TableCreateUpdateProperties.

type TableGetProperties

type TableGetProperties struct {
	Options  *TableGetPropertiesOptions
	Resource *TableGetPropertiesResource
}

TableGetProperties - The properties of an Azure Cosmos Table

func (TableGetProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TableGetProperties.

func (*TableGetProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TableGetProperties.

type TableGetPropertiesOptions

type TableGetPropertiesOptions struct {
	// Specifies the Autoscale settings.
	AutoscaleSettings *AutoscaleSettings

	// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer
	// details.
	Throughput *int32
}

func (TableGetPropertiesOptions) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TableGetPropertiesOptions.

func (*TableGetPropertiesOptions) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TableGetPropertiesOptions.

type TableGetPropertiesResource

type TableGetPropertiesResource struct {
	// REQUIRED; Name of the Cosmos DB table
	ID *string

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (TableGetPropertiesResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TableGetPropertiesResource.

func (*TableGetPropertiesResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TableGetPropertiesResource.

type TableGetResults

type TableGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB Table
	Properties *TableGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

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

	// READ-ONLY; The type of Azure resource.
	Type *string
}

TableGetResults - An Azure Cosmos DB Table.

func (TableGetResults) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TableGetResults.

func (*TableGetResults) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TableGetResults.

type TableListResult

type TableListResult struct {
	// READ-ONLY; List of Table and their properties.
	Value []*TableGetResults
}

TableListResult - The List operation response, that contains the Table and their properties.

func (TableListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TableListResult.

func (*TableListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TableListResult.

type TableResource

type TableResource struct {
	// REQUIRED; Name of the Cosmos DB table
	ID *string

	// Enum to indicate the mode of resource creation.
	CreateMode *CreateMode

	// Parameters to indicate the information about the restore
	RestoreParameters *ResourceRestoreParameters
}

TableResource - Cosmos DB table resource object

func (TableResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TableResource.

func (*TableResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TableResource.

type TableResourcesClient

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

TableResourcesClient contains the methods for the TableResources group. Don't use this type directly, use NewTableResourcesClient() instead.

func NewTableResourcesClient

func NewTableResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TableResourcesClient, error)

NewTableResourcesClient creates a new instance of TableResourcesClient with the specified values.

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

func (*TableResourcesClient) BeginCreateUpdateTable

func (client *TableResourcesClient) BeginCreateUpdateTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, createUpdateTableParameters TableCreateUpdateParameters, options *TableResourcesClientBeginCreateUpdateTableOptions) (*runtime.Poller[TableResourcesClientCreateUpdateTableResponse], error)

BeginCreateUpdateTable - Create or update an Azure Cosmos DB Table If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • tableName - Cosmos DB table name.
  • createUpdateTableParameters - The parameters to provide for the current Table.
  • options - TableResourcesClientBeginCreateUpdateTableOptions contains the optional parameters for the TableResourcesClient.BeginCreateUpdateTable method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableCreateUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewTableResourcesClient().BeginCreateUpdateTable(ctx, "rg1", "ddb1", "tableName", armcosmos.TableCreateUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.TableCreateUpdateProperties{
		Options: &armcosmos.CreateUpdateOptions{},
		Resource: &armcosmos.TableResource{
			ID: to.Ptr("tableName"),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.TableGetResults = armcosmos.TableGetResults{
// 	Name: to.Ptr("tableName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/tables"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/tables/tableName"),
// 	Location: to.Ptr("West US"),
// 	Properties: &armcosmos.TableGetProperties{
// 		Resource: &armcosmos.TableGetPropertiesResource{
// 			ID: to.Ptr("tableName"),
// 		},
// 	},
// }
Output:

func (*TableResourcesClient) BeginDeleteTable

func (client *TableResourcesClient) BeginDeleteTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientBeginDeleteTableOptions) (*runtime.Poller[TableResourcesClientDeleteTableResponse], error)

BeginDeleteTable - Deletes an existing Azure Cosmos DB Table. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • tableName - Cosmos DB table name.
  • options - TableResourcesClientBeginDeleteTableOptions contains the optional parameters for the TableResourcesClient.BeginDeleteTable method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewTableResourcesClient().BeginDeleteTable(ctx, "rg1", "ddb1", "tableName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*TableResourcesClient) BeginMigrateTableToAutoscale

func (client *TableResourcesClient) BeginMigrateTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientBeginMigrateTableToAutoscaleOptions) (*runtime.Poller[TableResourcesClientMigrateTableToAutoscaleResponse], error)

BeginMigrateTableToAutoscale - Migrate an Azure Cosmos DB Table from manual throughput to autoscale If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • tableName - Cosmos DB table name.
  • options - TableResourcesClientBeginMigrateTableToAutoscaleOptions contains the optional parameters for the TableResourcesClient.BeginMigrateTableToAutoscale method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableMigrateToAutoscale.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewTableResourcesClient().BeginMigrateTableToAutoscale(ctx, "rg1", "ddb1", "tableName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			AutoscaleSettings: &armcosmos.AutoscaleSettingsResource{
// 				MaxThroughput: to.Ptr[int32](4000),
// 			},
// 			MinimumThroughput: to.Ptr("4000"),
// 			OfferReplacePending: to.Ptr("false"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*TableResourcesClient) BeginMigrateTableToManualThroughput

BeginMigrateTableToManualThroughput - Migrate an Azure Cosmos DB Table from autoscale to manual throughput If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • tableName - Cosmos DB table name.
  • options - TableResourcesClientBeginMigrateTableToManualThroughputOptions contains the optional parameters for the TableResourcesClient.BeginMigrateTableToManualThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableMigrateToManualThroughput.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewTableResourcesClient().BeginMigrateTableToManualThroughput(ctx, "rg1", "ddb1", "tableName", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*TableResourcesClient) BeginRetrieveContinuousBackupInformation

BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a table. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • tableName - Cosmos DB table name.
  • location - The name of the continuous backup restore location.
  • options - TableResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the TableResourcesClient.BeginRetrieveContinuousBackupInformation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableBackupInformation.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewTableResourcesClient().BeginRetrieveContinuousBackupInformation(ctx, "rgName", "ddb1", "tableName1", armcosmos.ContinuousBackupRestoreLocation{
	Location: to.Ptr("North Europe"),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.BackupInformation = armcosmos.BackupInformation{
// 	ContinuousBackupInformation: &armcosmos.ContinuousBackupInformation{
// 		LatestRestorableTimestamp: to.Ptr("2021-02-05T02:40:50Z"),
// 	},
// }
Output:

func (*TableResourcesClient) BeginUpdateTableThroughput

func (client *TableResourcesClient) BeginUpdateTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *TableResourcesClientBeginUpdateTableThroughputOptions) (*runtime.Poller[TableResourcesClientUpdateTableThroughputResponse], error)

BeginUpdateTableThroughput - Update RUs per second of an Azure Cosmos DB Table If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • tableName - Cosmos DB table name.
  • updateThroughputParameters - The parameters to provide for the RUs per second of the current Table.
  • options - TableResourcesClientBeginUpdateTableThroughputOptions contains the optional parameters for the TableResourcesClient.BeginUpdateTableThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableThroughputUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewTableResourcesClient().BeginUpdateTableThroughput(ctx, "rg1", "ddb1", "tableName", armcosmos.ThroughputSettingsUpdateParameters{
	Location: to.Ptr("West US"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.ThroughputSettingsUpdateProperties{
		Resource: &armcosmos.ThroughputSettingsResource{
			Throughput: to.Ptr[int32](400),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/tables/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/tables/tableName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*TableResourcesClient) GetTable

func (client *TableResourcesClient) GetTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientGetTableOptions) (TableResourcesClientGetTableResponse, error)

GetTable - Gets the Tables under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • tableName - Cosmos DB table name.
  • options - TableResourcesClientGetTableOptions contains the optional parameters for the TableResourcesClient.GetTable method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewTableResourcesClient().GetTable(ctx, "rg1", "ddb1", "tableName", 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.TableGetResults = armcosmos.TableGetResults{
// 	Name: to.Ptr("tableName"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/tables"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/tables/tableName"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.TableGetProperties{
// 		Resource: &armcosmos.TableGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			ID: to.Ptr("tableName"),
// 		},
// 	},
// }
Output:

func (*TableResourcesClient) GetTableThroughput

func (client *TableResourcesClient) GetTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientGetTableThroughputOptions) (TableResourcesClientGetTableThroughputResponse, error)

GetTableThroughput - Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • tableName - Cosmos DB table name.
  • options - TableResourcesClientGetTableThroughputOptions contains the optional parameters for the TableResourcesClient.GetTableThroughput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableThroughputGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewTableResourcesClient().GetTableThroughput(ctx, "rg1", "ddb1", "tableName", 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.ThroughputSettingsGetResults = armcosmos.ThroughputSettingsGetResults{
// 	Name: to.Ptr("default"),
// 	Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/tables/throughputSettings"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/tables/tableName/throughputSettings/default"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 	},
// 	Properties: &armcosmos.ThroughputSettingsGetProperties{
// 		Resource: &armcosmos.ThroughputSettingsGetPropertiesResource{
// 			Etag: to.Ptr("\"00005900-0000-0000-0000-56f9a2630000\""),
// 			Rid: to.Ptr("PD5DALigDgw="),
// 			Ts: to.Ptr[float32](1459200611),
// 			InstantMaximumThroughput: to.Ptr("10000"),
// 			MinimumThroughput: to.Ptr("400"),
// 			OfferReplacePending: to.Ptr("true"),
// 			SoftAllowedMaximumThroughput: to.Ptr("1000000"),
// 			Throughput: to.Ptr[int32](400),
// 		},
// 	},
// }
Output:

func (*TableResourcesClient) NewListTablesPager

func (client *TableResourcesClient) NewListTablesPager(resourceGroupName string, accountName string, options *TableResourcesClientListTablesOptions) *runtime.Pager[TableResourcesClientListTablesResponse]

NewListTablesPager - Lists the Tables under an existing Azure Cosmos DB database account.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • accountName - Cosmos DB database account name.
  • options - TableResourcesClientListTablesOptions contains the optional parameters for the TableResourcesClient.NewListTablesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/CosmosDBTableList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewTableResourcesClient().NewListTablesPager("rgName", "ddb1", 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.TableListResult = armcosmos.TableListResult{
	// 	Value: []*armcosmos.TableGetResults{
	// 		{
	// 			Name: to.Ptr("tableName"),
	// 			Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/tables"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/tables/tableName"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 			},
	// 			Properties: &armcosmos.TableGetProperties{
	// 				Resource: &armcosmos.TableGetPropertiesResource{
	// 					ID: to.Ptr("tableName"),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type TableResourcesClientBeginCreateUpdateTableOptions

type TableResourcesClientBeginCreateUpdateTableOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TableResourcesClientBeginCreateUpdateTableOptions contains the optional parameters for the TableResourcesClient.BeginCreateUpdateTable method.

type TableResourcesClientBeginDeleteTableOptions

type TableResourcesClientBeginDeleteTableOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TableResourcesClientBeginDeleteTableOptions contains the optional parameters for the TableResourcesClient.BeginDeleteTable method.

type TableResourcesClientBeginMigrateTableToAutoscaleOptions

type TableResourcesClientBeginMigrateTableToAutoscaleOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TableResourcesClientBeginMigrateTableToAutoscaleOptions contains the optional parameters for the TableResourcesClient.BeginMigrateTableToAutoscale method.

type TableResourcesClientBeginMigrateTableToManualThroughputOptions

type TableResourcesClientBeginMigrateTableToManualThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TableResourcesClientBeginMigrateTableToManualThroughputOptions contains the optional parameters for the TableResourcesClient.BeginMigrateTableToManualThroughput method.

type TableResourcesClientBeginRetrieveContinuousBackupInformationOptions

type TableResourcesClientBeginRetrieveContinuousBackupInformationOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TableResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the TableResourcesClient.BeginRetrieveContinuousBackupInformation method.

type TableResourcesClientBeginUpdateTableThroughputOptions

type TableResourcesClientBeginUpdateTableThroughputOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TableResourcesClientBeginUpdateTableThroughputOptions contains the optional parameters for the TableResourcesClient.BeginUpdateTableThroughput method.

type TableResourcesClientCreateUpdateTableResponse

type TableResourcesClientCreateUpdateTableResponse struct {
	// An Azure Cosmos DB Table.
	TableGetResults
}

TableResourcesClientCreateUpdateTableResponse contains the response from method TableResourcesClient.BeginCreateUpdateTable.

type TableResourcesClientDeleteTableResponse

type TableResourcesClientDeleteTableResponse struct {
}

TableResourcesClientDeleteTableResponse contains the response from method TableResourcesClient.BeginDeleteTable.

type TableResourcesClientGetTableOptions

type TableResourcesClientGetTableOptions struct {
}

TableResourcesClientGetTableOptions contains the optional parameters for the TableResourcesClient.GetTable method.

type TableResourcesClientGetTableResponse

type TableResourcesClientGetTableResponse struct {
	// An Azure Cosmos DB Table.
	TableGetResults
}

TableResourcesClientGetTableResponse contains the response from method TableResourcesClient.GetTable.

type TableResourcesClientGetTableThroughputOptions

type TableResourcesClientGetTableThroughputOptions struct {
}

TableResourcesClientGetTableThroughputOptions contains the optional parameters for the TableResourcesClient.GetTableThroughput method.

type TableResourcesClientGetTableThroughputResponse

type TableResourcesClientGetTableThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

TableResourcesClientGetTableThroughputResponse contains the response from method TableResourcesClient.GetTableThroughput.

type TableResourcesClientListTablesOptions

type TableResourcesClientListTablesOptions struct {
}

TableResourcesClientListTablesOptions contains the optional parameters for the TableResourcesClient.NewListTablesPager method.

type TableResourcesClientListTablesResponse

type TableResourcesClientListTablesResponse struct {
	// The List operation response, that contains the Table and their properties.
	TableListResult
}

TableResourcesClientListTablesResponse contains the response from method TableResourcesClient.NewListTablesPager.

type TableResourcesClientMigrateTableToAutoscaleResponse

type TableResourcesClientMigrateTableToAutoscaleResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

TableResourcesClientMigrateTableToAutoscaleResponse contains the response from method TableResourcesClient.BeginMigrateTableToAutoscale.

type TableResourcesClientMigrateTableToManualThroughputResponse

type TableResourcesClientMigrateTableToManualThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

TableResourcesClientMigrateTableToManualThroughputResponse contains the response from method TableResourcesClient.BeginMigrateTableToManualThroughput.

type TableResourcesClientRetrieveContinuousBackupInformationResponse

type TableResourcesClientRetrieveContinuousBackupInformationResponse struct {
	// Backup information of a resource.
	BackupInformation
}

TableResourcesClientRetrieveContinuousBackupInformationResponse contains the response from method TableResourcesClient.BeginRetrieveContinuousBackupInformation.

type TableResourcesClientUpdateTableThroughputResponse

type TableResourcesClientUpdateTableThroughputResponse struct {
	// An Azure Cosmos DB resource throughput.
	ThroughputSettingsGetResults
}

TableResourcesClientUpdateTableThroughputResponse contains the response from method TableResourcesClient.BeginUpdateTableThroughput.

type ThroughputPolicyResource

type ThroughputPolicyResource struct {
	// Represents the percentage by which throughput can increase every time throughput policy kicks in.
	IncrementPercent *int32

	// Determines whether the ThroughputPolicy is active or not
	IsEnabled *bool
}

ThroughputPolicyResource - Cosmos DB resource throughput policy

func (ThroughputPolicyResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ThroughputPolicyResource.

func (*ThroughputPolicyResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputPolicyResource.

type ThroughputPolicyType

type ThroughputPolicyType string

ThroughputPolicyType - ThroughputPolicy to apply for throughput redistribution

const (
	ThroughputPolicyTypeCustom ThroughputPolicyType = "custom"
	ThroughputPolicyTypeEqual  ThroughputPolicyType = "equal"
	ThroughputPolicyTypeNone   ThroughputPolicyType = "none"
)

func PossibleThroughputPolicyTypeValues

func PossibleThroughputPolicyTypeValues() []ThroughputPolicyType

PossibleThroughputPolicyTypeValues returns the possible values for the ThroughputPolicyType const type.

type ThroughputPoolAccountClient

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

ThroughputPoolAccountClient contains the methods for the ThroughputPoolAccount group. Don't use this type directly, use NewThroughputPoolAccountClient() instead.

func NewThroughputPoolAccountClient

func NewThroughputPoolAccountClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ThroughputPoolAccountClient, error)

NewThroughputPoolAccountClient creates a new instance of ThroughputPoolAccountClient with the specified values.

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

func (*ThroughputPoolAccountClient) BeginCreate

func (client *ThroughputPoolAccountClient) BeginCreate(ctx context.Context, resourceGroupName string, throughputPoolName string, throughputPoolAccountName string, body ThroughputPoolAccountResource, options *ThroughputPoolAccountClientBeginCreateOptions) (*runtime.Poller[ThroughputPoolAccountClientCreateResponse], error)

BeginCreate - Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • throughputPoolName - Cosmos DB Throughput Pool name.
  • throughputPoolAccountName - Cosmos DB global database account in a Throughput Pool
  • body - The parameters to provide for the current ThroughputPoolAccount.
  • options - ThroughputPoolAccountClientBeginCreateOptions contains the optional parameters for the ThroughputPoolAccountClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewThroughputPoolAccountClient().BeginCreate(ctx, "rg1", "tp1", "db1", armcosmos.ThroughputPoolAccountResource{
	Properties: &armcosmos.ThroughputPoolAccountProperties{
		AccountLocation:           to.Ptr("West US"),
		AccountResourceIdentifier: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputPoolAccountResource = armcosmos.ThroughputPoolAccountResource{
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1/throughputPoolAccounts/db1"),
// 	Properties: &armcosmos.ThroughputPoolAccountProperties{
// 		AccountInstanceID: to.Ptr("{instance-id1}"),
// 		AccountLocation: to.Ptr("west us"),
// 		AccountResourceIdentifier: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/db1"),
// 		ProvisioningState: to.Ptr(armcosmos.StatusSucceeded),
// 	},
// }
Output:

func (*ThroughputPoolAccountClient) BeginDelete

func (client *ThroughputPoolAccountClient) BeginDelete(ctx context.Context, resourceGroupName string, throughputPoolName string, throughputPoolAccountName string, options *ThroughputPoolAccountClientBeginDeleteOptions) (*runtime.Poller[ThroughputPoolAccountClientDeleteResponse], error)

BeginDelete - Removes an existing Azure Cosmos DB database account from a throughput pool. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • throughputPoolName - Cosmos DB Throughput Pool name.
  • throughputPoolAccountName - Cosmos DB global database account in a Throughput Pool
  • options - ThroughputPoolAccountClientBeginDeleteOptions contains the optional parameters for the ThroughputPoolAccountClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewThroughputPoolAccountClient().BeginDelete(ctx, "rgName", "tp1", "db1", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*ThroughputPoolAccountClient) Get

func (client *ThroughputPoolAccountClient) Get(ctx context.Context, resourceGroupName string, throughputPoolName string, throughputPoolAccountName string, options *ThroughputPoolAccountClientGetOptions) (ThroughputPoolAccountClientGetResponse, error)

Get - Retrieves the properties of an existing Azure Cosmos DB Throughput Pool If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • throughputPoolName - Cosmos DB Throughput Pool name.
  • throughputPoolAccountName - Cosmos DB global database account in a Throughput Pool
  • options - ThroughputPoolAccountClientGetOptions contains the optional parameters for the ThroughputPoolAccountClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewThroughputPoolAccountClient().Get(ctx, "rgName", "tp1", "db1", 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.ThroughputPoolAccountResource = armcosmos.ThroughputPoolAccountResource{
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1/throughputPoolAccounts/db1"),
// 	Properties: &armcosmos.ThroughputPoolAccountProperties{
// 		AccountInstanceID: to.Ptr("{instance-id}"),
// 		AccountLocation: to.Ptr("west us"),
// 		AccountResourceIdentifier: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/db1"),
// 		ProvisioningState: to.Ptr(armcosmos.StatusSucceeded),
// 	},
// }
Output:

type ThroughputPoolAccountClientBeginCreateOptions

type ThroughputPoolAccountClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ThroughputPoolAccountClientBeginCreateOptions contains the optional parameters for the ThroughputPoolAccountClient.BeginCreate method.

type ThroughputPoolAccountClientBeginDeleteOptions

type ThroughputPoolAccountClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ThroughputPoolAccountClientBeginDeleteOptions contains the optional parameters for the ThroughputPoolAccountClient.BeginDelete method.

type ThroughputPoolAccountClientCreateResponse

type ThroughputPoolAccountClientCreateResponse struct {
	// An Azure Cosmos DB Throughputpool Account
	ThroughputPoolAccountResource
}

ThroughputPoolAccountClientCreateResponse contains the response from method ThroughputPoolAccountClient.BeginCreate.

type ThroughputPoolAccountClientDeleteResponse

type ThroughputPoolAccountClientDeleteResponse struct {
}

ThroughputPoolAccountClientDeleteResponse contains the response from method ThroughputPoolAccountClient.BeginDelete.

type ThroughputPoolAccountClientGetOptions

type ThroughputPoolAccountClientGetOptions struct {
}

ThroughputPoolAccountClientGetOptions contains the optional parameters for the ThroughputPoolAccountClient.Get method.

type ThroughputPoolAccountClientGetResponse

type ThroughputPoolAccountClientGetResponse struct {
	// An Azure Cosmos DB Throughputpool Account
	ThroughputPoolAccountResource
}

ThroughputPoolAccountClientGetResponse contains the response from method ThroughputPoolAccountClient.Get.

type ThroughputPoolAccountCreateParameters

type ThroughputPoolAccountCreateParameters struct {
	// Properties to update Azure Cosmos DB throughput pool.
	Properties *ThroughputPoolAccountCreateProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string
}

ThroughputPoolAccountCreateParameters - Parameters for creating a Azure Cosmos DB throughput pool account.

func (ThroughputPoolAccountCreateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ThroughputPoolAccountCreateParameters.

func (*ThroughputPoolAccountCreateParameters) UnmarshalJSON

func (t *ThroughputPoolAccountCreateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputPoolAccountCreateParameters.

type ThroughputPoolAccountCreateProperties

type ThroughputPoolAccountCreateProperties struct {
	// The location of global database account in the throughputPool.
	AccountLocation *string

	// The resource identifier of global database account in the throughputPool.
	AccountResourceIdentifier *string
}

ThroughputPoolAccountCreateProperties - Properties to update Azure Cosmos DB throughput pool.

func (ThroughputPoolAccountCreateProperties) MarshalJSON

func (t ThroughputPoolAccountCreateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputPoolAccountCreateProperties.

func (*ThroughputPoolAccountCreateProperties) UnmarshalJSON

func (t *ThroughputPoolAccountCreateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputPoolAccountCreateProperties.

type ThroughputPoolAccountProperties

type ThroughputPoolAccountProperties struct {
	// The location of global database account in the throughputPool.
	AccountLocation *string

	// The resource identifier of global database account in the throughputPool.
	AccountResourceIdentifier *string

	// A provisioning state of the ThroughputPool Account.
	ProvisioningState *Status

	// READ-ONLY; The instance id of global database account in the throughputPool.
	AccountInstanceID *string
}

ThroughputPoolAccountProperties - An Azure Cosmos DB Global Database Account which is part of a Throughputpool.

func (ThroughputPoolAccountProperties) MarshalJSON

func (t ThroughputPoolAccountProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputPoolAccountProperties.

func (*ThroughputPoolAccountProperties) UnmarshalJSON

func (t *ThroughputPoolAccountProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputPoolAccountProperties.

type ThroughputPoolAccountResource

type ThroughputPoolAccountResource struct {
	// An Azure Cosmos DB Global Database Account which is part of a Throughputpool.
	Properties *ThroughputPoolAccountProperties

	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ThroughputPoolAccountResource - An Azure Cosmos DB Throughputpool Account

func (ThroughputPoolAccountResource) MarshalJSON

func (t ThroughputPoolAccountResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputPoolAccountResource.

func (*ThroughputPoolAccountResource) UnmarshalJSON

func (t *ThroughputPoolAccountResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputPoolAccountResource.

type ThroughputPoolAccountsClient

type ThroughputPoolAccountsClient struct {
	// contains filtered or unexported fields
}

ThroughputPoolAccountsClient contains the methods for the ThroughputPoolAccounts group. Don't use this type directly, use NewThroughputPoolAccountsClient() instead.

func NewThroughputPoolAccountsClient

func NewThroughputPoolAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ThroughputPoolAccountsClient, error)

NewThroughputPoolAccountsClient creates a new instance of ThroughputPoolAccountsClient with the specified values.

  • subscriptionID - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ThroughputPoolAccountsClient) NewListPager

NewListPager - Lists all the Azure Cosmos DB accounts available under the subscription.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • throughputPoolName - Cosmos DB Throughput Pool name.
  • options - ThroughputPoolAccountsClientListOptions contains the optional parameters for the ThroughputPoolAccountsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewThroughputPoolAccountsClient().NewListPager("rgName", "tp1", 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.ThroughputPoolAccountsListResult = armcosmos.ThroughputPoolAccountsListResult{
	// 	Value: []*armcosmos.ThroughputPoolAccountResource{
	// 		{
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1/throughputPoolAccounts/db1"),
	// 			Properties: &armcosmos.ThroughputPoolAccountProperties{
	// 				AccountInstanceID: to.Ptr("{instance-id1}"),
	// 				AccountLocation: to.Ptr("west us"),
	// 				AccountResourceIdentifier: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/db1"),
	// 			},
	// 		},
	// 		{
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1/throughputPoolAccounts/db2"),
	// 			Properties: &armcosmos.ThroughputPoolAccountProperties{
	// 				AccountInstanceID: to.Ptr("{instance-id2}"),
	// 				AccountLocation: to.Ptr("west us"),
	// 				AccountResourceIdentifier: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/db2"),
	// 			},
	// 	}},
	// }
}
Output:

type ThroughputPoolAccountsClientListOptions

type ThroughputPoolAccountsClientListOptions struct {
}

ThroughputPoolAccountsClientListOptions contains the optional parameters for the ThroughputPoolAccountsClient.NewListPager method.

type ThroughputPoolAccountsClientListResponse

type ThroughputPoolAccountsClientListResponse struct {
	// The List operation response, that contains the global database accounts and their properties.
	ThroughputPoolAccountsListResult
}

ThroughputPoolAccountsClientListResponse contains the response from method ThroughputPoolAccountsClient.NewListPager.

type ThroughputPoolAccountsListResult

type ThroughputPoolAccountsListResult struct {
	// READ-ONLY; The link used to get the next page of results.
	NextLink *string

	// READ-ONLY; List of global database accounts in a throughput pool and their properties.
	Value []*ThroughputPoolAccountResource
}

ThroughputPoolAccountsListResult - The List operation response, that contains the global database accounts and their properties.

func (ThroughputPoolAccountsListResult) MarshalJSON

func (t ThroughputPoolAccountsListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputPoolAccountsListResult.

func (*ThroughputPoolAccountsListResult) UnmarshalJSON

func (t *ThroughputPoolAccountsListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputPoolAccountsListResult.

type ThroughputPoolClient

type ThroughputPoolClient struct {
	// contains filtered or unexported fields
}

ThroughputPoolClient contains the methods for the ThroughputPool group. Don't use this type directly, use NewThroughputPoolClient() instead.

func NewThroughputPoolClient

func NewThroughputPoolClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ThroughputPoolClient, error)

NewThroughputPoolClient creates a new instance of ThroughputPoolClient with the specified values.

  • subscriptionID - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ThroughputPoolClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • throughputPoolName - Cosmos DB Throughput Pool name.
  • body - The parameters to provide for the current ThroughputPool.
  • options - ThroughputPoolClientBeginCreateOrUpdateOptions contains the optional parameters for the ThroughputPoolClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewThroughputPoolClient().BeginCreateOrUpdate(ctx, "rg1", "tp1", armcosmos.ThroughputPoolResource{
	Location: to.Ptr("westus2"),
	Tags:     map[string]*string{},
	Properties: &armcosmos.ThroughputPoolProperties{
		MaxThroughput: to.Ptr[int32](10000),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputPoolResource = armcosmos.ThroughputPoolResource{
// 	Name: to.Ptr("tp1"),
// 	Type: to.Ptr("/Microsoft.DocumentDB/throughputPools"),
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1"),
// 	Location: to.Ptr("westus2"),
// 	Tags: map[string]*string{
// 		"additionalProp1": to.Ptr("string"),
// 		"additionalProp2": to.Ptr("string"),
// 		"additionalProp3": to.Ptr("string"),
// 	},
// 	Properties: &armcosmos.ThroughputPoolProperties{
// 		MaxThroughput: to.Ptr[int32](10000),
// 		ProvisioningState: to.Ptr(armcosmos.StatusSucceeded),
// 	},
// }
Output:

func (*ThroughputPoolClient) BeginDelete

func (client *ThroughputPoolClient) BeginDelete(ctx context.Context, resourceGroupName string, throughputPoolName string, options *ThroughputPoolClientBeginDeleteOptions) (*runtime.Poller[ThroughputPoolClientDeleteResponse], error)

BeginDelete - Deletes an existing Azure Cosmos DB Throughput Pool. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • throughputPoolName - Cosmos DB Throughput Pool name.
  • options - ThroughputPoolClientBeginDeleteOptions contains the optional parameters for the ThroughputPoolClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewThroughputPoolClient().BeginDelete(ctx, "rgName", "tp1", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
Output:

func (*ThroughputPoolClient) BeginUpdate

func (client *ThroughputPoolClient) BeginUpdate(ctx context.Context, resourceGroupName string, throughputPoolName string, options *ThroughputPoolClientBeginUpdateOptions) (*runtime.Poller[ThroughputPoolClientUpdateResponse], error)

BeginUpdate - Updates the properties of an existing Azure Cosmos DB Throughput Pool. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • throughputPoolName - Cosmos DB Throughput Pool name.
  • options - ThroughputPoolClientBeginUpdateOptions contains the optional parameters for the ThroughputPoolClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewThroughputPoolClient().BeginUpdate(ctx, "rg1", "tp1", &armcosmos.ThroughputPoolClientBeginUpdateOptions{Body: &armcosmos.ThroughputPoolUpdate{
	Properties: &armcosmos.ThroughputPoolProperties{
		MaxThroughput: to.Ptr[int32](10000),
	},
},
})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %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.ThroughputPoolResource = armcosmos.ThroughputPoolResource{
// 	Name: to.Ptr("tp1"),
// 	Type: to.Ptr("/Microsoft.DocumentDB/throughputPools"),
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1"),
// 	Location: to.Ptr("westus2"),
// 	Tags: map[string]*string{
// 		"additionalProp1": to.Ptr("string"),
// 		"additionalProp2": to.Ptr("string"),
// 		"additionalProp3": to.Ptr("string"),
// 	},
// 	Properties: &armcosmos.ThroughputPoolProperties{
// 		MaxThroughput: to.Ptr[int32](10000),
// 		ProvisioningState: to.Ptr(armcosmos.StatusSucceeded),
// 	},
// }
Output:

func (*ThroughputPoolClient) Get

func (client *ThroughputPoolClient) Get(ctx context.Context, resourceGroupName string, throughputPoolName string, options *ThroughputPoolClientGetOptions) (ThroughputPoolClientGetResponse, error)

Get - Retrieves the properties of an existing Azure Cosmos DB Throughput Pool If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • throughputPoolName - Cosmos DB Throughput Pool name.
  • options - ThroughputPoolClientGetOptions contains the optional parameters for the ThroughputPoolClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewThroughputPoolClient().Get(ctx, "rgName", "tp1", 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.ThroughputPoolResource = armcosmos.ThroughputPoolResource{
// 	Name: to.Ptr("tp1"),
// 	Type: to.Ptr("/Microsoft.DocumentDB/throughputPools"),
// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1"),
// 	Location: to.Ptr("west us"),
// 	Tags: map[string]*string{
// 		"additionalProp1": to.Ptr("string"),
// 		"additionalProp2": to.Ptr("string"),
// 		"additionalProp3": to.Ptr("string"),
// 	},
// 	Properties: &armcosmos.ThroughputPoolProperties{
// 		MaxThroughput: to.Ptr[int32](10000),
// 	},
// }
Output:

type ThroughputPoolClientBeginCreateOrUpdateOptions

type ThroughputPoolClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ThroughputPoolClientBeginCreateOrUpdateOptions contains the optional parameters for the ThroughputPoolClient.BeginCreateOrUpdate method.

type ThroughputPoolClientBeginDeleteOptions

type ThroughputPoolClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ThroughputPoolClientBeginDeleteOptions contains the optional parameters for the ThroughputPoolClient.BeginDelete method.

type ThroughputPoolClientBeginUpdateOptions

type ThroughputPoolClientBeginUpdateOptions struct {
	// The parameters to provide for the current Throughput Pool.
	Body *ThroughputPoolUpdate

	// Resumes the LRO from the provided token.
	ResumeToken string
}

ThroughputPoolClientBeginUpdateOptions contains the optional parameters for the ThroughputPoolClient.BeginUpdate method.

type ThroughputPoolClientCreateOrUpdateResponse

type ThroughputPoolClientCreateOrUpdateResponse struct {
	// An Azure Cosmos DB Throughputpool.
	ThroughputPoolResource
}

ThroughputPoolClientCreateOrUpdateResponse contains the response from method ThroughputPoolClient.BeginCreateOrUpdate.

type ThroughputPoolClientDeleteResponse

type ThroughputPoolClientDeleteResponse struct {
}

ThroughputPoolClientDeleteResponse contains the response from method ThroughputPoolClient.BeginDelete.

type ThroughputPoolClientGetOptions

type ThroughputPoolClientGetOptions struct {
}

ThroughputPoolClientGetOptions contains the optional parameters for the ThroughputPoolClient.Get method.

type ThroughputPoolClientGetResponse

type ThroughputPoolClientGetResponse struct {
	// An Azure Cosmos DB Throughputpool.
	ThroughputPoolResource
}

ThroughputPoolClientGetResponse contains the response from method ThroughputPoolClient.Get.

type ThroughputPoolClientUpdateResponse

type ThroughputPoolClientUpdateResponse struct {
	// An Azure Cosmos DB Throughputpool.
	ThroughputPoolResource
}

ThroughputPoolClientUpdateResponse contains the response from method ThroughputPoolClient.BeginUpdate.

type ThroughputPoolProperties

type ThroughputPoolProperties struct {
	// Value for throughput to be shared among CosmosDB resources in the pool.
	MaxThroughput *int32

	// A provisioning state of the ThroughputPool.
	ProvisioningState *Status
}

ThroughputPoolProperties - Properties to update Azure Cosmos DB throughput pool.

func (ThroughputPoolProperties) MarshalJSON

func (t ThroughputPoolProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputPoolProperties.

func (*ThroughputPoolProperties) UnmarshalJSON

func (t *ThroughputPoolProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputPoolProperties.

type ThroughputPoolResource

type ThroughputPoolResource struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// Properties to update Azure Cosmos DB throughput pool.
	Properties *ThroughputPoolProperties

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ThroughputPoolResource - An Azure Cosmos DB Throughputpool.

func (ThroughputPoolResource) MarshalJSON

func (t ThroughputPoolResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputPoolResource.

func (*ThroughputPoolResource) UnmarshalJSON

func (t *ThroughputPoolResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputPoolResource.

type ThroughputPoolUpdate

type ThroughputPoolUpdate struct {
	// Properties of the throughput pool.
	Properties *ThroughputPoolProperties
}

ThroughputPoolUpdate - Represents a throughput pool resource for updates.

func (ThroughputPoolUpdate) MarshalJSON

func (t ThroughputPoolUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputPoolUpdate.

func (*ThroughputPoolUpdate) UnmarshalJSON

func (t *ThroughputPoolUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputPoolUpdate.

type ThroughputPoolsClient

type ThroughputPoolsClient struct {
	// contains filtered or unexported fields
}

ThroughputPoolsClient contains the methods for the ThroughputPools group. Don't use this type directly, use NewThroughputPoolsClient() instead.

func NewThroughputPoolsClient

func NewThroughputPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ThroughputPoolsClient, error)

NewThroughputPoolsClient creates a new instance of ThroughputPoolsClient with the specified values.

  • subscriptionID - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ThroughputPoolsClient) NewListByResourceGroupPager

NewListByResourceGroupPager - List all the ThroughputPools in a given resource group.

Generated from API version 2024-02-15-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ThroughputPoolsClientListByResourceGroupOptions contains the optional parameters for the ThroughputPoolsClient.NewListByResourceGroupPager method.

func (*ThroughputPoolsClient) NewListPager

NewListPager - Lists all the Azure Cosmos DB Throughput Pools available under the subscription.

Generated from API version 2024-02-15-preview

  • options - ThroughputPoolsClientListOptions contains the optional parameters for the ThroughputPoolsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/examples/throughputPool/CosmosDBThroughputPoolList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewThroughputPoolsClient().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.ThroughputPoolsListResult = armcosmos.ThroughputPoolsListResult{
	// 	Value: []*armcosmos.ThroughputPoolResource{
	// 		{
	// 			Name: to.Ptr("tp1"),
	// 			Type: to.Ptr("/Microsoft.DocumentDB/throughputPools"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp1"),
	// 			Location: to.Ptr("west us"),
	// 			Tags: map[string]*string{
	// 				"additionalProp1": to.Ptr("string"),
	// 				"additionalProp2": to.Ptr("string"),
	// 				"additionalProp3": to.Ptr("string"),
	// 			},
	// 			Properties: &armcosmos.ThroughputPoolProperties{
	// 				MaxThroughput: to.Ptr[int32](10000),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("tp2"),
	// 			Type: to.Ptr("/Microsoft.DocumentDB/throughputPools"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rg1/providers/Microsoft.DocumentDB/throughputPools/tp2"),
	// 			Location: to.Ptr("west us"),
	// 			Tags: map[string]*string{
	// 				"additionalProp1": to.Ptr("string"),
	// 				"additionalProp2": to.Ptr("string"),
	// 				"additionalProp3": to.Ptr("string"),
	// 			},
	// 			Properties: &armcosmos.ThroughputPoolProperties{
	// 				MaxThroughput: to.Ptr[int32](10000),
	// 			},
	// 	}},
	// }
}
Output:

type ThroughputPoolsClientListByResourceGroupOptions

type ThroughputPoolsClientListByResourceGroupOptions struct {
}

ThroughputPoolsClientListByResourceGroupOptions contains the optional parameters for the ThroughputPoolsClient.NewListByResourceGroupPager method.

type ThroughputPoolsClientListByResourceGroupResponse

type ThroughputPoolsClientListByResourceGroupResponse struct {
	// The List operation response, that contains the throughput pools and their properties.
	ThroughputPoolsListResult
}

ThroughputPoolsClientListByResourceGroupResponse contains the response from method ThroughputPoolsClient.NewListByResourceGroupPager.

type ThroughputPoolsClientListOptions

type ThroughputPoolsClientListOptions struct {
}

ThroughputPoolsClientListOptions contains the optional parameters for the ThroughputPoolsClient.NewListPager method.

type ThroughputPoolsClientListResponse

type ThroughputPoolsClientListResponse struct {
	// The List operation response, that contains the throughput pools and their properties.
	ThroughputPoolsListResult
}

ThroughputPoolsClientListResponse contains the response from method ThroughputPoolsClient.NewListPager.

type ThroughputPoolsListResult

type ThroughputPoolsListResult struct {
	// READ-ONLY; The link used to get the next page of results.
	NextLink *string

	// READ-ONLY; List of throughput pools and their properties.
	Value []*ThroughputPoolResource
}

ThroughputPoolsListResult - The List operation response, that contains the throughput pools and their properties.

func (ThroughputPoolsListResult) MarshalJSON

func (t ThroughputPoolsListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputPoolsListResult.

func (*ThroughputPoolsListResult) UnmarshalJSON

func (t *ThroughputPoolsListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputPoolsListResult.

type ThroughputSettingsGetProperties

type ThroughputSettingsGetProperties struct {
	Resource *ThroughputSettingsGetPropertiesResource
}

ThroughputSettingsGetProperties - The properties of an Azure Cosmos DB resource throughput

func (ThroughputSettingsGetProperties) MarshalJSON

func (t ThroughputSettingsGetProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputSettingsGetProperties.

func (*ThroughputSettingsGetProperties) UnmarshalJSON

func (t *ThroughputSettingsGetProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputSettingsGetProperties.

type ThroughputSettingsGetPropertiesResource

type ThroughputSettingsGetPropertiesResource struct {
	// Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both.
	AutoscaleSettings *AutoscaleSettingsResource

	// Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both.
	Throughput *int32

	// READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string

	// READ-ONLY; The offer throughput value to instantly scale up without triggering splits
	InstantMaximumThroughput *string

	// READ-ONLY; The minimum throughput of the resource
	MinimumThroughput *string

	// READ-ONLY; The throughput replace is pending
	OfferReplacePending *string

	// READ-ONLY; A system generated property. A unique identifier.
	Rid *string

	// READ-ONLY; The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified
	SoftAllowedMaximumThroughput *string

	// READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
	Ts *float32
}

func (ThroughputSettingsGetPropertiesResource) MarshalJSON

func (t ThroughputSettingsGetPropertiesResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputSettingsGetPropertiesResource.

func (*ThroughputSettingsGetPropertiesResource) UnmarshalJSON

func (t *ThroughputSettingsGetPropertiesResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputSettingsGetPropertiesResource.

type ThroughputSettingsGetResults

type ThroughputSettingsGetResults struct {
	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// The properties of an Azure Cosmos DB resource throughput
	Properties *ThroughputSettingsGetProperties

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

	// READ-ONLY; The name of the ARM resource.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

ThroughputSettingsGetResults - An Azure Cosmos DB resource throughput.

func (ThroughputSettingsGetResults) MarshalJSON

func (t ThroughputSettingsGetResults) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputSettingsGetResults.

func (*ThroughputSettingsGetResults) UnmarshalJSON

func (t *ThroughputSettingsGetResults) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputSettingsGetResults.

type ThroughputSettingsResource

type ThroughputSettingsResource struct {
	// Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both.
	AutoscaleSettings *AutoscaleSettingsResource

	// Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both.
	Throughput *int32

	// READ-ONLY; The offer throughput value to instantly scale up without triggering splits
	InstantMaximumThroughput *string

	// READ-ONLY; The minimum throughput of the resource
	MinimumThroughput *string

	// READ-ONLY; The throughput replace is pending
	OfferReplacePending *string

	// READ-ONLY; The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified
	SoftAllowedMaximumThroughput *string
}

ThroughputSettingsResource - Cosmos DB resource throughput object. Either throughput is required or autoscaleSettings is required, but not both.

func (ThroughputSettingsResource) MarshalJSON

func (t ThroughputSettingsResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputSettingsResource.

func (*ThroughputSettingsResource) UnmarshalJSON

func (t *ThroughputSettingsResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputSettingsResource.

type ThroughputSettingsUpdateParameters

type ThroughputSettingsUpdateParameters struct {
	// REQUIRED; Properties to update Azure Cosmos DB resource throughput.
	Properties *ThroughputSettingsUpdateProperties

	// Identity for the resource.
	Identity *ManagedServiceIdentity

	// The location of the resource group to which the resource belongs.
	Location *string

	// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource
	// (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example,
	// the default experience for a template type is set with "defaultExperience":
	// "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
	Tags map[string]*string

	// READ-ONLY; The unique resource identifier of the ARM resource.
	ID *string

	// READ-ONLY; The name of the ARM resource.
	Name *string

	// READ-ONLY; The type of Azure resource.
	Type *string
}

ThroughputSettingsUpdateParameters - Parameters to update Cosmos DB resource throughput.

func (ThroughputSettingsUpdateParameters) MarshalJSON

func (t ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputSettingsUpdateParameters.

func (*ThroughputSettingsUpdateParameters) UnmarshalJSON

func (t *ThroughputSettingsUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputSettingsUpdateParameters.

type ThroughputSettingsUpdateProperties

type ThroughputSettingsUpdateProperties struct {
	// REQUIRED; The standard JSON format of a resource throughput
	Resource *ThroughputSettingsResource
}

ThroughputSettingsUpdateProperties - Properties to update Azure Cosmos DB resource throughput.

func (ThroughputSettingsUpdateProperties) MarshalJSON

func (t ThroughputSettingsUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ThroughputSettingsUpdateProperties.

func (*ThroughputSettingsUpdateProperties) UnmarshalJSON

func (t *ThroughputSettingsUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ThroughputSettingsUpdateProperties.

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. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'

func (TrackedResource) MarshalJSON

func (t TrackedResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

func (*TrackedResource) UnmarshalJSON

func (t *TrackedResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

type TriggerOperation

type TriggerOperation string

TriggerOperation - The operation the trigger is associated with

const (
	TriggerOperationAll     TriggerOperation = "All"
	TriggerOperationCreate  TriggerOperation = "Create"
	TriggerOperationDelete  TriggerOperation = "Delete"
	TriggerOperationReplace TriggerOperation = "Replace"
	TriggerOperationUpdate  TriggerOperation = "Update"
)

func PossibleTriggerOperationValues

func PossibleTriggerOperationValues() []TriggerOperation

PossibleTriggerOperationValues returns the possible values for the TriggerOperation const type.

type TriggerType

type TriggerType string

TriggerType - Type of the Trigger

const (
	TriggerTypePost TriggerType = "Post"
	TriggerTypePre  TriggerType = "Pre"
)

func PossibleTriggerTypeValues

func PossibleTriggerTypeValues() []TriggerType

PossibleTriggerTypeValues returns the possible values for the TriggerType const type.

type Type

type Type string

Type - Type of the connection string

const (
	TypeCassandra                  Type = "Cassandra"
	TypeCassandraConnectorMetadata Type = "CassandraConnectorMetadata"
	TypeGremlin                    Type = "Gremlin"
	TypeGremlinV2                  Type = "GremlinV2"
	TypeMongoDB                    Type = "MongoDB"
	TypeSQL                        Type = "Sql"
	TypeSQLDedicatedGateway        Type = "SqlDedicatedGateway"
	TypeTable                      Type = "Table"
	TypeUndefined                  Type = "Undefined"
)

func PossibleTypeValues

func PossibleTypeValues() []Type

PossibleTypeValues returns the possible values for the Type const type.

type UniqueKey

type UniqueKey struct {
	// List of paths must be unique for each document in the Azure Cosmos DB service
	Paths []*string
}

UniqueKey - The unique key on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.

func (UniqueKey) MarshalJSON

func (u UniqueKey) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UniqueKey.

func (*UniqueKey) UnmarshalJSON

func (u *UniqueKey) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UniqueKey.

type UniqueKeyPolicy

type UniqueKeyPolicy struct {
	// List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.
	UniqueKeys []*UniqueKey
}

UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service.

func (UniqueKeyPolicy) MarshalJSON

func (u UniqueKeyPolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UniqueKeyPolicy.

func (*UniqueKeyPolicy) UnmarshalJSON

func (u *UniqueKeyPolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UniqueKeyPolicy.

type UnitType

type UnitType string

UnitType - The unit of the metric.

const (
	UnitTypeBytes          UnitType = "Bytes"
	UnitTypeBytesPerSecond UnitType = "BytesPerSecond"
	UnitTypeCount          UnitType = "Count"
	UnitTypeCountPerSecond UnitType = "CountPerSecond"
	UnitTypeMilliseconds   UnitType = "Milliseconds"
	UnitTypePercent        UnitType = "Percent"
	UnitTypeSeconds        UnitType = "Seconds"
)

func PossibleUnitTypeValues

func PossibleUnitTypeValues() []UnitType

PossibleUnitTypeValues returns the possible values for the UnitType const type.

type Usage

type Usage struct {
	// READ-ONLY; Current value for this metric
	CurrentValue *int64

	// READ-ONLY; Maximum value for this metric
	Limit *int64

	// READ-ONLY; The name information for the metric.
	Name *MetricName

	// READ-ONLY; The quota period used to summarize the usage values.
	QuotaPeriod *string

	// READ-ONLY; The unit of the metric.
	Unit *UnitType
}

Usage - The usage data for a usage request.

func (Usage) MarshalJSON

func (u Usage) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Usage.

func (*Usage) UnmarshalJSON

func (u *Usage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Usage.

type UsagesResult

type UsagesResult struct {
	// READ-ONLY; The list of usages for the database. A usage is a point in time metric
	Value []*Usage
}

UsagesResult - The response to a list usage request.

func (UsagesResult) MarshalJSON

func (u UsagesResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UsagesResult.

func (*UsagesResult) UnmarshalJSON

func (u *UsagesResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UsagesResult.

type VirtualNetworkRule

type VirtualNetworkRule struct {
	// Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
	ID *string

	// Create firewall rule before the virtual network has vnet service endpoint enabled.
	IgnoreMissingVNetServiceEndpoint *bool
}

VirtualNetworkRule - Virtual Network ACL Rule object

func (VirtualNetworkRule) MarshalJSON

func (v VirtualNetworkRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule.

func (*VirtualNetworkRule) UnmarshalJSON

func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL