Documentation ¶
Index ¶
- type ClientFactory
- func (c *ClientFactory) NewClustersClient() *ClustersClient
- func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient
- func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient
- func (c *ClientFactory) NewOperationsClient() *OperationsClient
- func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient
- func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient
- func (c *ClientFactory) NewRolesClient() *RolesClient
- func (c *ClientFactory) NewServersClient() *ServersClient
- type Cluster
- type ClusterConfigurationListResult
- type ClusterForUpdate
- type ClusterListResult
- type ClusterProperties
- type ClusterPropertiesForUpdate
- type ClusterServer
- type ClusterServerListResult
- type ClusterServerProperties
- type ClustersClient
- func (client *ClustersClient) BeginCreate(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[ClustersClientCreateResponse], error)
- func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[ClustersClientDeleteResponse], error)
- func (client *ClustersClient) BeginPromoteReadReplica(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[ClustersClientPromoteReadReplicaResponse], error)
- func (client *ClustersClient) BeginRestart(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[ClustersClientRestartResponse], error)
- func (client *ClustersClient) BeginStart(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[ClustersClientStartResponse], error)
- func (client *ClustersClient) BeginStop(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[ClustersClientStopResponse], error)
- func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[ClustersClientUpdateResponse], error)
- func (client *ClustersClient) CheckNameAvailability(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest, ...) (ClustersClientCheckNameAvailabilityResponse, error)
- func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, ...) (ClustersClientGetResponse, error)
- func (client *ClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *ClustersClientListByResourceGroupOptions) *runtime.Pager[ClustersClientListByResourceGroupResponse]
- func (client *ClustersClient) NewListPager(options *ClustersClientListOptions) *runtime.Pager[ClustersClientListResponse]
- type ClustersClientBeginCreateOptions
- type ClustersClientBeginDeleteOptions
- type ClustersClientBeginPromoteReadReplicaOptions
- type ClustersClientBeginRestartOptions
- type ClustersClientBeginStartOptions
- type ClustersClientBeginStopOptions
- type ClustersClientBeginUpdateOptions
- type ClustersClientCheckNameAvailabilityOptions
- type ClustersClientCheckNameAvailabilityResponse
- type ClustersClientCreateResponse
- type ClustersClientDeleteResponse
- type ClustersClientGetOptions
- type ClustersClientGetResponse
- type ClustersClientListByResourceGroupOptions
- type ClustersClientListByResourceGroupResponse
- type ClustersClientListOptions
- type ClustersClientListResponse
- type ClustersClientPromoteReadReplicaResponse
- type ClustersClientRestartResponse
- type ClustersClientStartResponse
- type ClustersClientStopResponse
- type ClustersClientUpdateResponse
- type Configuration
- type ConfigurationDataType
- type ConfigurationProperties
- type ConfigurationsClient
- func (client *ConfigurationsClient) BeginUpdateOnCoordinator(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[ConfigurationsClientUpdateOnCoordinatorResponse], error)
- func (client *ConfigurationsClient) BeginUpdateOnNode(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[ConfigurationsClientUpdateOnNodeResponse], error)
- func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, ...) (ConfigurationsClientGetResponse, error)
- func (client *ConfigurationsClient) GetCoordinator(ctx context.Context, resourceGroupName string, clusterName string, ...) (ConfigurationsClientGetCoordinatorResponse, error)
- func (client *ConfigurationsClient) GetNode(ctx context.Context, resourceGroupName string, clusterName string, ...) (ConfigurationsClientGetNodeResponse, error)
- func (client *ConfigurationsClient) NewListByClusterPager(resourceGroupName string, clusterName string, ...) *runtime.Pager[ConfigurationsClientListByClusterResponse]
- func (client *ConfigurationsClient) NewListByServerPager(resourceGroupName string, clusterName string, serverName string, ...) *runtime.Pager[ConfigurationsClientListByServerResponse]
- type ConfigurationsClientBeginUpdateOnCoordinatorOptions
- type ConfigurationsClientBeginUpdateOnNodeOptions
- type ConfigurationsClientGetCoordinatorOptions
- type ConfigurationsClientGetCoordinatorResponse
- type ConfigurationsClientGetNodeOptions
- type ConfigurationsClientGetNodeResponse
- type ConfigurationsClientGetOptions
- type ConfigurationsClientGetResponse
- type ConfigurationsClientListByClusterOptions
- type ConfigurationsClientListByClusterResponse
- type ConfigurationsClientListByServerOptions
- type ConfigurationsClientListByServerResponse
- type ConfigurationsClientUpdateOnCoordinatorResponse
- type ConfigurationsClientUpdateOnNodeResponse
- type CreatedByType
- type FirewallRule
- type FirewallRuleListResult
- type FirewallRuleProperties
- type FirewallRulesClient
- func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[FirewallRulesClientCreateOrUpdateResponse], error)
- func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[FirewallRulesClientDeleteResponse], error)
- func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, ...) (FirewallRulesClientGetResponse, error)
- func (client *FirewallRulesClient) NewListByClusterPager(resourceGroupName string, clusterName string, ...) *runtime.Pager[FirewallRulesClientListByClusterResponse]
- type FirewallRulesClientBeginCreateOrUpdateOptions
- type FirewallRulesClientBeginDeleteOptions
- type FirewallRulesClientCreateOrUpdateResponse
- type FirewallRulesClientDeleteResponse
- type FirewallRulesClientGetOptions
- type FirewallRulesClientGetResponse
- type FirewallRulesClientListByClusterOptions
- type FirewallRulesClientListByClusterResponse
- type MaintenanceWindow
- type NameAvailability
- type NameAvailabilityRequest
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationOrigin
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type PrivateEndpoint
- type PrivateEndpointConnection
- type PrivateEndpointConnectionListResult
- type PrivateEndpointConnectionProperties
- type PrivateEndpointConnectionProvisioningState
- type PrivateEndpointConnectionSimpleProperties
- type PrivateEndpointConnectionsClient
- func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error)
- func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)
- func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, ...) (PrivateEndpointConnectionsClientGetResponse, error)
- func (client *PrivateEndpointConnectionsClient) NewListByClusterPager(resourceGroupName string, clusterName string, ...) *runtime.Pager[PrivateEndpointConnectionsClientListByClusterResponse]
- type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions
- type PrivateEndpointConnectionsClientBeginDeleteOptions
- type PrivateEndpointConnectionsClientCreateOrUpdateResponse
- type PrivateEndpointConnectionsClientDeleteResponse
- type PrivateEndpointConnectionsClientGetOptions
- type PrivateEndpointConnectionsClientGetResponse
- type PrivateEndpointConnectionsClientListByClusterOptions
- type PrivateEndpointConnectionsClientListByClusterResponse
- type PrivateEndpointProperty
- type PrivateEndpointServiceConnectionStatus
- type PrivateLinkResource
- type PrivateLinkResourceListResult
- type PrivateLinkResourceProperties
- type PrivateLinkResourcesClient
- func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, ...) (PrivateLinkResourcesClientGetResponse, error)
- func (client *PrivateLinkResourcesClient) NewListByClusterPager(resourceGroupName string, clusterName string, ...) *runtime.Pager[PrivateLinkResourcesClientListByClusterResponse]
- type PrivateLinkResourcesClientGetOptions
- type PrivateLinkResourcesClientGetResponse
- type PrivateLinkResourcesClientListByClusterOptions
- type PrivateLinkResourcesClientListByClusterResponse
- type PrivateLinkServiceConnectionState
- type ProvisioningState
- type Role
- type RoleListResult
- type RoleProperties
- type RolesClient
- func (client *RolesClient) BeginCreate(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[RolesClientCreateResponse], error)
- func (client *RolesClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, ...) (*runtime.Poller[RolesClientDeleteResponse], error)
- func (client *RolesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, ...) (RolesClientGetResponse, error)
- func (client *RolesClient) NewListByClusterPager(resourceGroupName string, clusterName string, ...) *runtime.Pager[RolesClientListByClusterResponse]
- type RolesClientBeginCreateOptions
- type RolesClientBeginDeleteOptions
- type RolesClientCreateResponse
- type RolesClientDeleteResponse
- type RolesClientGetOptions
- type RolesClientGetResponse
- type RolesClientListByClusterOptions
- type RolesClientListByClusterResponse
- type ServerConfiguration
- type ServerConfigurationListResult
- type ServerConfigurationProperties
- type ServerNameItem
- type ServerRole
- type ServerRoleGroupConfiguration
- type ServersClient
- type ServersClientGetOptions
- type ServersClientGetResponse
- type ServersClientListByClusterOptions
- type ServersClientListByClusterResponse
- type SimplePrivateEndpointConnection
- type SystemData
Examples ¶
- ClustersClient.BeginCreate (CreateANewCluster)
- ClustersClient.BeginCreate (CreateANewClusterAsAPointInTimeRestore)
- ClustersClient.BeginCreate (CreateANewClusterAsAReadReplica)
- ClustersClient.BeginDelete
- ClustersClient.BeginPromoteReadReplica
- ClustersClient.BeginRestart
- ClustersClient.BeginStart
- ClustersClient.BeginStop
- ClustersClient.BeginUpdate (ScaleComputeUpOrDown)
- ClustersClient.BeginUpdate (ScaleOutAddNewWorkerNodes)
- ClustersClient.BeginUpdate (ScaleUpStorage)
- ClustersClient.BeginUpdate (UpdateMultipleConfigurationSettingsOfTheCluster)
- ClustersClient.BeginUpdate (UpdateOrDefineMaintenanceWindow)
- ClustersClient.CheckNameAvailability
- ClustersClient.Get
- ClustersClient.NewListByResourceGroupPager
- ClustersClient.NewListPager
- ConfigurationsClient.BeginUpdateOnCoordinator
- ConfigurationsClient.BeginUpdateOnNode
- ConfigurationsClient.Get
- ConfigurationsClient.GetCoordinator
- ConfigurationsClient.GetNode
- ConfigurationsClient.NewListByClusterPager
- ConfigurationsClient.NewListByServerPager
- FirewallRulesClient.BeginCreateOrUpdate
- FirewallRulesClient.BeginDelete
- FirewallRulesClient.Get
- FirewallRulesClient.NewListByClusterPager
- OperationsClient.NewListPager
- PrivateEndpointConnectionsClient.BeginCreateOrUpdate
- PrivateEndpointConnectionsClient.BeginDelete
- PrivateEndpointConnectionsClient.Get
- PrivateEndpointConnectionsClient.NewListByClusterPager
- PrivateLinkResourcesClient.Get
- PrivateLinkResourcesClient.NewListByClusterPager
- RolesClient.BeginCreate
- RolesClient.BeginDelete
- RolesClient.Get
- RolesClient.NewListByClusterPager
- ServersClient.Get
- ServersClient.NewListByClusterPager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewClustersClient ¶
func (c *ClientFactory) NewClustersClient() *ClustersClient
func (*ClientFactory) NewConfigurationsClient ¶
func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient
func (*ClientFactory) NewFirewallRulesClient ¶
func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient
func (*ClientFactory) NewOperationsClient ¶
func (c *ClientFactory) NewOperationsClient() *OperationsClient
func (*ClientFactory) NewPrivateEndpointConnectionsClient ¶
func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient
func (*ClientFactory) NewPrivateLinkResourcesClient ¶
func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient
func (*ClientFactory) NewRolesClient ¶
func (c *ClientFactory) NewRolesClient() *RolesClient
func (*ClientFactory) NewServersClient ¶
func (c *ClientFactory) NewServersClient() *ServersClient
type Cluster ¶
type Cluster struct { // REQUIRED; The geo-location where the resource lives Location *string // Properties of the cluster. Properties *ClusterProperties // 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 }
Cluster - Represents a cluster.
func (Cluster) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Cluster.
func (*Cluster) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Cluster.
type ClusterConfigurationListResult ¶
type ClusterConfigurationListResult struct { // The list of cluster configurations. Value []*Configuration // READ-ONLY; Link to retrieve next page of results. NextLink *string }
ClusterConfigurationListResult - A list of cluster configurations.
func (ClusterConfigurationListResult) MarshalJSON ¶
func (c ClusterConfigurationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ClusterConfigurationListResult.
func (*ClusterConfigurationListResult) UnmarshalJSON ¶
func (c *ClusterConfigurationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ClusterConfigurationListResult.
type ClusterForUpdate ¶
type ClusterForUpdate struct { // Properties of the cluster. Properties *ClusterPropertiesForUpdate // Application-specific metadata in the form of key-value pairs. Tags map[string]*string }
ClusterForUpdate - Represents a cluster for update.
func (ClusterForUpdate) MarshalJSON ¶
func (c ClusterForUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ClusterForUpdate.
func (*ClusterForUpdate) UnmarshalJSON ¶
func (c *ClusterForUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ClusterForUpdate.
type ClusterListResult ¶
type ClusterListResult struct { // The list of clusters Value []*Cluster // READ-ONLY; The link used to get the next page of cluster list. NextLink *string }
ClusterListResult - A list of clusters.
func (ClusterListResult) MarshalJSON ¶
func (c ClusterListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ClusterListResult.
func (*ClusterListResult) UnmarshalJSON ¶
func (c *ClusterListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ClusterListResult.
type ClusterProperties ¶
type ClusterProperties struct { // The password of the administrator login. Required for creation. AdministratorLoginPassword *string // The Citus extension version on all cluster servers. CitusVersion *string // If public access is enabled on coordinator. CoordinatorEnablePublicIPAccess *bool // The edition of a coordinator server (default: GeneralPurpose). Required for creation. CoordinatorServerEdition *string // The storage of a server in MB. Required for creation. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute // for more information. CoordinatorStorageQuotaInMb *int32 // The vCores count of a server (max: 96). Required for creation. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute // for more information. CoordinatorVCores *int32 // If high availability (HA) is enabled or not for the cluster. EnableHa *bool // If shards on coordinator is enabled or not for the cluster. EnableShardsOnCoordinator *bool // Maintenance window of a cluster. MaintenanceWindow *MaintenanceWindow // Worker node count of the cluster. When node count is 0, it represents a single node configuration with the ability to create // distributed tables on that node. 2 or more worker nodes represent // multi-node configuration. Node count value cannot be 1. Required for creation. NodeCount *int32 // If public access is enabled on worker nodes. NodeEnablePublicIPAccess *bool // The edition of a node server (default: MemoryOptimized). NodeServerEdition *string // The storage in MB on each worker node. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for // more information. NodeStorageQuotaInMb *int32 // The compute in vCores on each worker node (max: 104). See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute // for more information. NodeVCores *int32 // Date and time in UTC (ISO8601 format) for cluster restore. PointInTimeUTC *time.Time // The major PostgreSQL version on all cluster servers. PostgresqlVersion *string // Preferred primary availability zone (AZ) for all cluster servers. PreferredPrimaryZone *string // The Azure region of source cluster for read replica clusters. SourceLocation *string // The resource id of source cluster for read replica clusters. SourceResourceID *string // READ-ONLY; The administrator's login name of the servers in the cluster. AdministratorLogin *string // READ-ONLY; The earliest restore point time (ISO8601 format) for the cluster. EarliestRestoreTime *time.Time // READ-ONLY; The private endpoint connections for a cluster. PrivateEndpointConnections []*SimplePrivateEndpointConnection // READ-ONLY; Provisioning state of the cluster ProvisioningState *string // READ-ONLY; The array of read replica clusters. ReadReplicas []*string // READ-ONLY; The list of server names in the cluster ServerNames []*ServerNameItem // READ-ONLY; A state of a cluster/server that is visible to user. State *string }
ClusterProperties - Properties of the cluster.
func (ClusterProperties) MarshalJSON ¶
func (c ClusterProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ClusterProperties.
func (*ClusterProperties) UnmarshalJSON ¶
func (c *ClusterProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ClusterProperties.
type ClusterPropertiesForUpdate ¶
type ClusterPropertiesForUpdate struct { // The password of the administrator login. Each cluster is created with pre-defined administrative role called ‘citus’. AdministratorLoginPassword *string // The Citus extension version on all cluster servers. CitusVersion *string // If public access is enabled on coordinator. CoordinatorEnablePublicIPAccess *bool // The edition of the coordinator (default: GeneralPurpose). CoordinatorServerEdition *string // The storage of the coordinator in MB. CoordinatorStorageQuotaInMb *int32 // The vCores count of the coordinator (max: 96). CoordinatorVCores *int32 // If high availability (HA) is enabled or not for the cluster. EnableHa *bool // If shards on coordinator is enabled or not for the cluster. EnableShardsOnCoordinator *bool // Maintenance window of a cluster. MaintenanceWindow *MaintenanceWindow // Worker node count of the cluster. When node count is 0, it represents a single node configuration with the ability to create // distributed tables on that node. 2 or more worker nodes represent // multi-node configuration. Node count value cannot be 1. NodeCount *int32 // The edition of a node (default: MemoryOptimized). NodeServerEdition *string // The storage in MB on each worker node. NodeStorageQuotaInMb *int32 // The compute in vCores on each worker node (max: 104). NodeVCores *int32 // The major PostgreSQL version on all cluster servers. PostgresqlVersion *string // Preferred primary availability zone (AZ) for all cluster servers. PreferredPrimaryZone *string // READ-ONLY; If public access is enabled on worker nodes. NodeEnablePublicIPAccess *bool }
ClusterPropertiesForUpdate - The properties used to update a cluster.
func (ClusterPropertiesForUpdate) MarshalJSON ¶
func (c ClusterPropertiesForUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ClusterPropertiesForUpdate.
func (*ClusterPropertiesForUpdate) UnmarshalJSON ¶
func (c *ClusterPropertiesForUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPropertiesForUpdate.
type ClusterServer ¶
type ClusterServer struct { // The properties of a server in a cluster. Properties *ClusterServerProperties // 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 }
ClusterServer - Represents a server in a cluster.
func (ClusterServer) MarshalJSON ¶
func (c ClusterServer) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ClusterServer.
func (*ClusterServer) UnmarshalJSON ¶
func (c *ClusterServer) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ClusterServer.
type ClusterServerListResult ¶
type ClusterServerListResult struct { // The list of servers in a cluster. Value []*ClusterServer }
ClusterServerListResult - A list of servers in a cluster.
func (ClusterServerListResult) MarshalJSON ¶
func (c ClusterServerListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ClusterServerListResult.
func (*ClusterServerListResult) UnmarshalJSON ¶
func (c *ClusterServerListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ClusterServerListResult.
type ClusterServerProperties ¶
type ClusterServerProperties struct { // Availability Zone information of the server. AvailabilityZone *string // The Citus extension version of server. CitusVersion *string // If high availability (HA) is enabled or not for the server. EnableHa *bool // The major PostgreSQL version of server. PostgresqlVersion *string // The role of server in the cluster. Role *ServerRole // The edition of a server. ServerEdition *string // The storage of a server in MB. StorageQuotaInMb *int32 // The vCores count of a server. VCores *int32 // READ-ONLY; The administrator's login name of the servers in the cluster. AdministratorLogin *string // READ-ONLY; If public access is enabled on server. EnablePublicIPAccess *bool // READ-ONLY; The fully qualified domain name of a server. FullyQualifiedDomainName *string // READ-ONLY; A state of HA feature for the cluster. HaState *string // READ-ONLY; If server database is set to read-only by system maintenance depending on high disk space usage. IsReadOnly *bool // READ-ONLY; A state of a cluster/server that is visible to user. State *string }
ClusterServerProperties - The properties of a server in cluster.
func (ClusterServerProperties) MarshalJSON ¶
func (c ClusterServerProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ClusterServerProperties.
func (*ClusterServerProperties) UnmarshalJSON ¶
func (c *ClusterServerProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ClusterServerProperties.
type ClustersClient ¶
type ClustersClient struct {
// contains filtered or unexported fields
}
ClustersClient contains the methods for the Clusters group. Don't use this type directly, use NewClustersClient() instead.
func NewClustersClient ¶
func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClustersClient, error)
NewClustersClient creates a new instance of ClustersClient with the specified values.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClustersClient) BeginCreate ¶
func (client *ClustersClient) BeginCreate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginCreateOptions) (*runtime.Poller[ClustersClientCreateResponse], error)
BeginCreate - Creates a new cluster with servers. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- parameters - The required parameters for creating or updating a cluster.
- options - ClustersClientBeginCreateOptions contains the optional parameters for the ClustersClient.BeginCreate method.
Example (CreateANewCluster) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "TestGroup", "testcluster", armcosmosforpostgresql.Cluster{ Location: to.Ptr("westus"), Tags: map[string]*string{}, Properties: &armcosmosforpostgresql.ClusterProperties{ AdministratorLoginPassword: to.Ptr("password"), CitusVersion: to.Ptr("11.1"), CoordinatorEnablePublicIPAccess: to.Ptr(true), CoordinatorServerEdition: to.Ptr("GeneralPurpose"), CoordinatorStorageQuotaInMb: to.Ptr[int32](524288), CoordinatorVCores: to.Ptr[int32](4), EnableHa: to.Ptr(true), EnableShardsOnCoordinator: to.Ptr(false), NodeCount: to.Ptr[int32](3), NodeEnablePublicIPAccess: to.Ptr(false), NodeServerEdition: to.Ptr("MemoryOptimized"), NodeStorageQuotaInMb: to.Ptr[int32](524288), NodeVCores: to.Ptr[int32](8), PostgresqlVersion: to.Ptr("15"), PreferredPrimaryZone: 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.Cluster = armcosmosforpostgresql.Cluster{ // Name: to.Ptr("testcluster"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](524288), // CoordinatorVCores: to.Ptr[int32](4), // EnableHa: to.Ptr(true), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](3), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](524288), // NodeVCores: to.Ptr[int32](8), // PostgresqlVersion: to.Ptr("15"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // }, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster-c"), // FullyQualifiedDomainName: to.Ptr("c.testcluster.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster-w0"), // FullyQualifiedDomainName: to.Ptr("w0.testcluster.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster-w2"), // FullyQualifiedDomainName: to.Ptr("w0.testcluster.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster-w3"), // FullyQualifiedDomainName: to.Ptr("w0.testcluster.postgres.database.azure.com"), // }}, // State: to.Ptr("Provisioning"), // }, // } }
Output:
Example (CreateANewClusterAsAPointInTimeRestore) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreatePITR.json
package main import ( "context" "log" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "TestGroup", "testcluster", armcosmosforpostgresql.Cluster{ Location: to.Ptr("westus"), Properties: &armcosmosforpostgresql.ClusterProperties{ PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T00:00:37.467Z"); return t }()), SourceLocation: to.Ptr("westus"), SourceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/source-cluster"), }, }, 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.Cluster = armcosmosforpostgresql.Cluster{ // Name: to.Ptr("testcluster"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("westus"), // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](524288), // CoordinatorVCores: to.Ptr[int32](4), // EnableHa: to.Ptr(true), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](1), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](524288), // NodeVCores: to.Ptr[int32](8), // PostgresqlVersion: to.Ptr("15"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // }, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster-c"), // FullyQualifiedDomainName: to.Ptr("c.testcluster.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster-w0"), // FullyQualifiedDomainName: to.Ptr("w0.testcluster.postgres.database.azure.com"), // }}, // SourceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/source-cluster"), // State: to.Ptr("Provisioning"), // }, // } }
Output:
Example (CreateANewClusterAsAReadReplica) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreateReadReplica.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "TestGroup", "testcluster", armcosmosforpostgresql.Cluster{ Location: to.Ptr("westus"), Properties: &armcosmosforpostgresql.ClusterProperties{ SourceLocation: to.Ptr("westus"), SourceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/sourcecluster"), }, }, 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.Cluster = armcosmosforpostgresql.Cluster{ // Name: to.Ptr("testcluster"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("westus"), // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](524288), // CoordinatorVCores: to.Ptr[int32](4), // EnableHa: to.Ptr(true), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](1), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](524288), // NodeVCores: to.Ptr[int32](8), // PostgresqlVersion: to.Ptr("15"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // }, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster-c"), // FullyQualifiedDomainName: to.Ptr("c.testcluster.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster-w0"), // FullyQualifiedDomainName: to.Ptr("w0.testcluster.postgres.database.azure.com"), // }}, // SourceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/sourcecluster"), // State: to.Ptr("Provisioning"), // }, // } }
Output:
func (*ClustersClient) BeginDelete ¶
func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*runtime.Poller[ClustersClientDeleteResponse], error)
BeginDelete - Deletes a cluster together with servers in it. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginDelete(ctx, "TestGroup", "testcluster", 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 (*ClustersClient) BeginPromoteReadReplica ¶
func (client *ClustersClient) BeginPromoteReadReplica(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginPromoteReadReplicaOptions) (*runtime.Poller[ClustersClientPromoteReadReplicaResponse], error)
BeginPromoteReadReplica - Promotes read replica cluster to an independent read-write cluster. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - ClustersClientBeginPromoteReadReplicaOptions contains the optional parameters for the ClustersClient.BeginPromoteReadReplica method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterPromoteReadReplica.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginPromoteReadReplica(ctx, "TestGroup", "testcluster1", 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 (*ClustersClient) BeginRestart ¶
func (client *ClustersClient) BeginRestart(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginRestartOptions) (*runtime.Poller[ClustersClientRestartResponse], error)
BeginRestart - Restarts all nodes in the cluster. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - ClustersClientBeginRestartOptions contains the optional parameters for the ClustersClient.BeginRestart method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterRestart.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginRestart(ctx, "TestGroup", "testcluster1", 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 (*ClustersClient) BeginStart ¶
func (client *ClustersClient) BeginStart(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginStartOptions) (*runtime.Poller[ClustersClientStartResponse], error)
BeginStart - Starts stopped compute on all cluster nodes. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - ClustersClientBeginStartOptions contains the optional parameters for the ClustersClient.BeginStart method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterStart.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginStart(ctx, "TestGroup", "testcluster1", 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 (*ClustersClient) BeginStop ¶
func (client *ClustersClient) BeginStop(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginStopOptions) (*runtime.Poller[ClustersClientStopResponse], error)
BeginStop - Stops compute on all cluster nodes. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - ClustersClientBeginStopOptions contains the optional parameters for the ClustersClient.BeginStop method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterStop.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginStop(ctx, "TestGroup", "testcluster1", 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 (*ClustersClient) BeginUpdate ¶
func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterForUpdate, options *ClustersClientBeginUpdateOptions) (*runtime.Poller[ClustersClientUpdateResponse], error)
BeginUpdate - Updates an existing cluster. The request body can contain one or several properties from the cluster definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- parameters - The parameters for updating a cluster.
- options - ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method.
Example (ScaleComputeUpOrDown) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterScaleCompute.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "TestGroup", "testcluster", armcosmosforpostgresql.ClusterForUpdate{ Properties: &armcosmosforpostgresql.ClusterPropertiesForUpdate{ NodeVCores: to.Ptr[int32](16), }, }, 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.Cluster = armcosmosforpostgresql.Cluster{ // Name: to.Ptr("testcluster"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("westus"), // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](2097152), // CoordinatorVCores: to.Ptr[int32](16), // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableHa: to.Ptr(false), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](3), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](2097152), // NodeVCores: to.Ptr[int32](16), // PostgresqlVersion: to.Ptr("14"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // }, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster1-c"), // FullyQualifiedDomainName: to.Ptr("testcluster1-c.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w0"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w1"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w1.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w2"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w2.postgres.database.azure.com"), // }}, // State: to.Ptr("Ready"), // }, // } }
Output:
Example (ScaleOutAddNewWorkerNodes) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterAddNode.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "TestGroup", "testcluster", armcosmosforpostgresql.ClusterForUpdate{ Properties: &armcosmosforpostgresql.ClusterPropertiesForUpdate{ NodeCount: to.Ptr[int32](2), }, }, 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.Cluster = armcosmosforpostgresql.Cluster{ // Name: to.Ptr("testcluster"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("westus"), // Properties: &armcosmosforpostgresql.ClusterProperties{ // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](524288), // CoordinatorVCores: to.Ptr[int32](4), // EnableHa: to.Ptr(true), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](2), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](524288), // NodeVCores: to.Ptr[int32](8), // PostgresqlVersion: to.Ptr("15"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // }, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster-c"), // FullyQualifiedDomainName: to.Ptr("c.testcluster.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster-w0"), // FullyQualifiedDomainName: to.Ptr("w0.testcluster.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster-w1"), // FullyQualifiedDomainName: to.Ptr("w1.testcluster.postgres.database.azure.com"), // }}, // State: to.Ptr("Provisioning"), // }, // } }
Output:
Example (ScaleUpStorage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterScaleStorage.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "TestGroup", "testcluster", armcosmosforpostgresql.ClusterForUpdate{ Properties: &armcosmosforpostgresql.ClusterPropertiesForUpdate{ NodeStorageQuotaInMb: to.Ptr[int32](2097152), }, }, 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.Cluster = armcosmosforpostgresql.Cluster{ // Name: to.Ptr("testcluster"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("westus"), // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](2097152), // CoordinatorVCores: to.Ptr[int32](16), // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableHa: to.Ptr(false), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](3), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](2097152), // NodeVCores: to.Ptr[int32](16), // PostgresqlVersion: to.Ptr("14"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // }, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster1-c"), // FullyQualifiedDomainName: to.Ptr("testcluster1-c.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w0"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w1"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w1.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w2"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w2.postgres.database.azure.com"), // }}, // State: to.Ptr("Ready"), // }, // } }
Output:
Example (UpdateMultipleConfigurationSettingsOfTheCluster) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "TestGroup", "testcluster", armcosmosforpostgresql.ClusterForUpdate{ Properties: &armcosmosforpostgresql.ClusterPropertiesForUpdate{ AdministratorLoginPassword: to.Ptr("newpassword"), CoordinatorVCores: to.Ptr[int32](16), NodeCount: to.Ptr[int32](4), NodeVCores: to.Ptr[int32](16), }, }, 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.Cluster = armcosmosforpostgresql.Cluster{ // Name: to.Ptr("testcluster1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster1"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "additionalProp1": to.Ptr("string"), // "additionalProp2": to.Ptr("string"), // "additionalProp3": to.Ptr("string"), // }, // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](2097152), // CoordinatorVCores: to.Ptr[int32](16), // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableHa: to.Ptr(false), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](4), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](2097152), // NodeVCores: to.Ptr[int32](16), // PostgresqlVersion: to.Ptr("14"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSQL/serverGroupsv2/testreadreplica-01"), // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSQL/serverGroupsv2/testreadreplica-02")}, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster1-c"), // FullyQualifiedDomainName: to.Ptr("testcluster1-c.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w0"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w1"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w1.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w2"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w2.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w3"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w2.postgres.database.azure.com"), // }}, // State: to.Ptr("Ready"), // }, // } }
Output:
Example (UpdateOrDefineMaintenanceWindow) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterUpdateMaintenanceWindow.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "TestGroup", "testcluster", armcosmosforpostgresql.ClusterForUpdate{ Properties: &armcosmosforpostgresql.ClusterPropertiesForUpdate{ MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ CustomWindow: to.Ptr("Enabled"), DayOfWeek: to.Ptr[int32](0), StartHour: to.Ptr[int32](8), StartMinute: to.Ptr[int32](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.Cluster = armcosmosforpostgresql.Cluster{ // Name: to.Ptr("testcluster"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("westus"), // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](2097152), // CoordinatorVCores: to.Ptr[int32](16), // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableHa: to.Ptr(false), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Enabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](8), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](2), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](2097152), // NodeVCores: to.Ptr[int32](16), // PostgresqlVersion: to.Ptr("14"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // }, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster1-c"), // FullyQualifiedDomainName: to.Ptr("testcluster1-c.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w0"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w1"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w1.postgres.database.azure.com"), // }}, // State: to.Ptr("Ready"), // }, // } }
Output:
func (*ClustersClient) CheckNameAvailability ¶
func (client *ClustersClient) CheckNameAvailability(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest, options *ClustersClientCheckNameAvailabilityOptions) (ClustersClientCheckNameAvailabilityResponse, error)
CheckNameAvailability - Checks availability of a cluster name. Cluster names should be globally unique; at least 3 characters and at most 40 characters long; they must only contain lowercase letters, numbers, and hyphens; and must not start or end with a hyphen. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- nameAvailabilityRequest - The required parameters for checking if cluster name is available.
- options - ClustersClientCheckNameAvailabilityOptions contains the optional parameters for the ClustersClient.CheckNameAvailability method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/CheckNameAvailability.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewClustersClient().CheckNameAvailability(ctx, armcosmosforpostgresql.NameAvailabilityRequest{ Name: to.Ptr("name1"), Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), }, 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.NameAvailability = armcosmosforpostgresql.NameAvailability{ // Name: to.Ptr("name1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // Message: to.Ptr(""), // NameAvailable: to.Ptr(true), // } }
Output:
func (*ClustersClient) Get ¶
func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientGetOptions) (ClustersClientGetResponse, error)
Get - Gets information about a cluster such as compute and storage configuration and cluster lifecycle metadata such as cluster creation date and time. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewClustersClient().Get(ctx, "TestGroup", "testcluster1", 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.Cluster = armcosmosforpostgresql.Cluster{ // Name: to.Ptr("testcluster1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster1"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp1": to.Ptr("string"), // "additionalProp2": to.Ptr("string"), // "additionalProp3": to.Ptr("string"), // }, // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](2097152), // CoordinatorVCores: to.Ptr[int32](4), // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableHa: to.Ptr(false), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](2), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](2097152), // NodeVCores: to.Ptr[int32](8), // PostgresqlVersion: to.Ptr("14"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSQL/serverGroupsv2/testreadreplica-01"), // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSQL/serverGroupsv2/testreadreplica-02")}, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster1-c"), // FullyQualifiedDomainName: to.Ptr("testcluster1-c.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w0"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w1"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w1.postgres.database.azure.com"), // }}, // State: to.Ptr("Ready"), // }, // } }
Output:
func (*ClustersClient) NewListByResourceGroupPager ¶
func (client *ClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *ClustersClientListByResourceGroupOptions) *runtime.Pager[ClustersClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all clusters in a resource group.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterListByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewClustersClient().NewListByResourceGroupPager("TestGroup", 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.ClusterListResult = armcosmosforpostgresql.ClusterListResult{ // Value: []*armcosmosforpostgresql.Cluster{ // { // Name: to.Ptr("testcluster1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster1"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp1": to.Ptr("string"), // }, // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](2097152), // CoordinatorVCores: to.Ptr[int32](4), // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableHa: to.Ptr(false), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](3), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](2097152), // NodeVCores: to.Ptr[int32](8), // PostgresqlVersion: to.Ptr("14"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSQL/serverGroupsv2/testreadreplica-01"), // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSQL/serverGroupsv2/testreadreplica-02")}, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster1-c"), // FullyQualifiedDomainName: to.Ptr("testcluster1-c.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w0"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w1"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w1.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w2"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w2.postgres.database.azure.com"), // }}, // State: to.Ptr("Ready"), // }, // }, // { // Name: to.Ptr("testcluster2"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster2"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp1": to.Ptr("string"), // }, // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](524288), // CoordinatorVCores: to.Ptr[int32](4), // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-15T00:01:32.317Z"); return t}()), // EnableHa: to.Ptr(true), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](2), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](524288), // NodeVCores: to.Ptr[int32](8), // PostgresqlVersion: to.Ptr("15"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // }, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster2-c"), // FullyQualifiedDomainName: to.Ptr("testcluster2-c.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster2-w0"), // FullyQualifiedDomainName: to.Ptr("testcluster2-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster2-w1"), // FullyQualifiedDomainName: to.Ptr("testcluster2-w1.postgres.database.azure.com"), // }}, // State: to.Ptr("Ready"), // }, // }}, // } } }
Output:
func (*ClustersClient) NewListPager ¶
func (client *ClustersClient) NewListPager(options *ClustersClientListOptions) *runtime.Pager[ClustersClientListResponse]
NewListPager - Lists all clusters in a subscription.
Generated from API version 2022-11-08
- options - ClustersClientListOptions contains the optional parameters for the ClustersClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewClustersClient().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.ClusterListResult = armcosmosforpostgresql.ClusterListResult{ // Value: []*armcosmosforpostgresql.Cluster{ // { // Name: to.Ptr("testcluster1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster1"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp1": to.Ptr("string"), // }, // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](2097152), // CoordinatorVCores: to.Ptr[int32](4), // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableHa: to.Ptr(false), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](2), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](2097152), // NodeVCores: to.Ptr[int32](8), // PostgresqlVersion: to.Ptr("14"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSQL/serverGroupsv2/testreadreplica-01"), // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSQL/serverGroupsv2/testreadreplica-02")}, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster1-c"), // FullyQualifiedDomainName: to.Ptr("testcluster1-c.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w0"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster1-w1"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w1.postgres.database.azure.com"), // }}, // State: to.Ptr("Ready"), // }, // }, // { // Name: to.Ptr("testcluster2"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup2/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster2"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp1": to.Ptr("string"), // }, // Properties: &armcosmosforpostgresql.ClusterProperties{ // AdministratorLogin: to.Ptr("citus"), // CitusVersion: to.Ptr("11.1"), // CoordinatorEnablePublicIPAccess: to.Ptr(true), // CoordinatorServerEdition: to.Ptr("GeneralPurpose"), // CoordinatorStorageQuotaInMb: to.Ptr[int32](524288), // CoordinatorVCores: to.Ptr[int32](4), // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-15T00:01:32.317Z"); return t}()), // EnableHa: to.Ptr(true), // EnableShardsOnCoordinator: to.Ptr(false), // MaintenanceWindow: &armcosmosforpostgresql.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // NodeCount: to.Ptr[int32](1), // NodeEnablePublicIPAccess: to.Ptr(false), // NodeServerEdition: to.Ptr("MemoryOptimized"), // NodeStorageQuotaInMb: to.Ptr[int32](524288), // NodeVCores: to.Ptr[int32](8), // PostgresqlVersion: to.Ptr("15"), // PreferredPrimaryZone: to.Ptr("1"), // PrivateEndpointConnections: []*armcosmosforpostgresql.SimplePrivateEndpointConnection{ // }, // ProvisioningState: to.Ptr("Succeeded"), // ReadReplicas: []*string{ // }, // ServerNames: []*armcosmosforpostgresql.ServerNameItem{ // { // Name: to.Ptr("testcluster2-c"), // FullyQualifiedDomainName: to.Ptr("testcluster2-c.postgres.database.azure.com"), // }, // { // Name: to.Ptr("testcluster2-w0"), // FullyQualifiedDomainName: to.Ptr("testcluster2-w0.postgres.database.azure.com"), // }}, // State: to.Ptr("Ready"), // }, // }}, // } } }
Output:
type ClustersClientBeginCreateOptions ¶
type ClustersClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ClustersClientBeginCreateOptions contains the optional parameters for the ClustersClient.BeginCreate method.
type ClustersClientBeginDeleteOptions ¶
type ClustersClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method.
type ClustersClientBeginPromoteReadReplicaOptions ¶
type ClustersClientBeginPromoteReadReplicaOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ClustersClientBeginPromoteReadReplicaOptions contains the optional parameters for the ClustersClient.BeginPromoteReadReplica method.
type ClustersClientBeginRestartOptions ¶
type ClustersClientBeginRestartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ClustersClientBeginRestartOptions contains the optional parameters for the ClustersClient.BeginRestart method.
type ClustersClientBeginStartOptions ¶
type ClustersClientBeginStartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ClustersClientBeginStartOptions contains the optional parameters for the ClustersClient.BeginStart method.
type ClustersClientBeginStopOptions ¶
type ClustersClientBeginStopOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ClustersClientBeginStopOptions contains the optional parameters for the ClustersClient.BeginStop method.
type ClustersClientBeginUpdateOptions ¶
type ClustersClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method.
type ClustersClientCheckNameAvailabilityOptions ¶
type ClustersClientCheckNameAvailabilityOptions struct { }
ClustersClientCheckNameAvailabilityOptions contains the optional parameters for the ClustersClient.CheckNameAvailability method.
type ClustersClientCheckNameAvailabilityResponse ¶
type ClustersClientCheckNameAvailabilityResponse struct {
NameAvailability
}
ClustersClientCheckNameAvailabilityResponse contains the response from method ClustersClient.CheckNameAvailability.
type ClustersClientCreateResponse ¶
type ClustersClientCreateResponse struct {
Cluster
}
ClustersClientCreateResponse contains the response from method ClustersClient.BeginCreate.
type ClustersClientDeleteResponse ¶
type ClustersClientDeleteResponse struct { }
ClustersClientDeleteResponse contains the response from method ClustersClient.BeginDelete.
type ClustersClientGetOptions ¶
type ClustersClientGetOptions struct { }
ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method.
type ClustersClientGetResponse ¶
type ClustersClientGetResponse struct {
Cluster
}
ClustersClientGetResponse contains the response from method ClustersClient.Get.
type ClustersClientListByResourceGroupOptions ¶
type ClustersClientListByResourceGroupOptions struct { }
ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager method.
type ClustersClientListByResourceGroupResponse ¶
type ClustersClientListByResourceGroupResponse struct {
ClusterListResult
}
ClustersClientListByResourceGroupResponse contains the response from method ClustersClient.NewListByResourceGroupPager.
type ClustersClientListOptions ¶
type ClustersClientListOptions struct { }
ClustersClientListOptions contains the optional parameters for the ClustersClient.NewListPager method.
type ClustersClientListResponse ¶
type ClustersClientListResponse struct {
ClusterListResult
}
ClustersClientListResponse contains the response from method ClustersClient.NewListPager.
type ClustersClientPromoteReadReplicaResponse ¶
type ClustersClientPromoteReadReplicaResponse struct { }
ClustersClientPromoteReadReplicaResponse contains the response from method ClustersClient.BeginPromoteReadReplica.
type ClustersClientRestartResponse ¶
type ClustersClientRestartResponse struct { }
ClustersClientRestartResponse contains the response from method ClustersClient.BeginRestart.
type ClustersClientStartResponse ¶
type ClustersClientStartResponse struct { }
ClustersClientStartResponse contains the response from method ClustersClient.BeginStart.
type ClustersClientStopResponse ¶
type ClustersClientStopResponse struct { }
ClustersClientStopResponse contains the response from method ClustersClient.BeginStop.
type ClustersClientUpdateResponse ¶
type ClustersClientUpdateResponse struct {
Cluster
}
ClustersClientUpdateResponse contains the response from method ClustersClient.BeginUpdate.
type Configuration ¶
type Configuration struct { // The properties of configuration. Properties *ConfigurationProperties // 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 }
Configuration - Represents configuration details for coordinator and node.
func (Configuration) MarshalJSON ¶
func (c Configuration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Configuration.
func (*Configuration) UnmarshalJSON ¶
func (c *Configuration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Configuration.
type ConfigurationDataType ¶
type ConfigurationDataType string
ConfigurationDataType - Data type of the configuration.
const ( ConfigurationDataTypeBoolean ConfigurationDataType = "Boolean" ConfigurationDataTypeEnumeration ConfigurationDataType = "Enumeration" ConfigurationDataTypeInteger ConfigurationDataType = "Integer" ConfigurationDataTypeNumeric ConfigurationDataType = "Numeric" )
func PossibleConfigurationDataTypeValues ¶
func PossibleConfigurationDataTypeValues() []ConfigurationDataType
PossibleConfigurationDataTypeValues returns the possible values for the ConfigurationDataType const type.
type ConfigurationProperties ¶
type ConfigurationProperties struct { // REQUIRED; The list of server role group configuration values. ServerRoleGroupConfigurations []*ServerRoleGroupConfiguration // If configuration change requires restart. RequiresRestart *bool // READ-ONLY; Allowed values of the configuration. AllowedValues *string // READ-ONLY; Data type of the configuration. DataType *ConfigurationDataType // READ-ONLY; Description of the configuration. Description *string // READ-ONLY; Provisioning state of the configuration ProvisioningState *ProvisioningState }
ConfigurationProperties - The properties of configuration.
func (ConfigurationProperties) MarshalJSON ¶
func (c ConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ConfigurationProperties.
func (*ConfigurationProperties) UnmarshalJSON ¶
func (c *ConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProperties.
type ConfigurationsClient ¶
type ConfigurationsClient struct {
// contains filtered or unexported fields
}
ConfigurationsClient contains the methods for the Configurations group. Don't use this type directly, use NewConfigurationsClient() instead.
func NewConfigurationsClient ¶
func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationsClient, error)
NewConfigurationsClient creates a new instance of ConfigurationsClient with the specified values.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ConfigurationsClient) BeginUpdateOnCoordinator ¶
func (client *ConfigurationsClient) BeginUpdateOnCoordinator(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, parameters ServerConfiguration, options *ConfigurationsClientBeginUpdateOnCoordinatorOptions) (*runtime.Poller[ConfigurationsClientUpdateOnCoordinatorResponse], error)
BeginUpdateOnCoordinator - Updates configuration of coordinator in a cluster If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- configurationName - The name of the cluster configuration.
- parameters - The required parameters for updating a cluster configuration.
- options - ConfigurationsClientBeginUpdateOnCoordinatorOptions contains the optional parameters for the ConfigurationsClient.BeginUpdateOnCoordinator method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ConfigurationUpdateCoordinator.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewConfigurationsClient().BeginUpdateOnCoordinator(ctx, "TestResourceGroup", "testcluster", "array_nulls", armcosmosforpostgresql.ServerConfiguration{ Properties: &armcosmosforpostgresql.ServerConfigurationProperties{ Value: to.Ptr("on"), }, }, 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.ServerConfiguration = armcosmosforpostgresql.ServerConfiguration{ // Name: to.Ptr("array_nulls"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations/coordinator"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/array_nulls"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ServerConfigurationProperties{ // Description: to.Ptr("Enables input of NULL elements in arrays."), // AllowedValues: to.Ptr("on,off"), // DataType: to.Ptr(armcosmosforpostgresql.ConfigurationDataTypeBoolean), // DefaultValue: to.Ptr("on"), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // RequiresRestart: to.Ptr(false), // Source: to.Ptr("user-override"), // Value: to.Ptr("on"), // }, // } }
Output:
func (*ConfigurationsClient) BeginUpdateOnNode ¶
func (client *ConfigurationsClient) BeginUpdateOnNode(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, parameters ServerConfiguration, options *ConfigurationsClientBeginUpdateOnNodeOptions) (*runtime.Poller[ConfigurationsClientUpdateOnNodeResponse], error)
BeginUpdateOnNode - Updates configuration of worker nodes in a cluster If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- configurationName - The name of the cluster configuration.
- parameters - The required parameters for updating a cluster configuration.
- options - ConfigurationsClientBeginUpdateOnNodeOptions contains the optional parameters for the ConfigurationsClient.BeginUpdateOnNode method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ConfigurationUpdateNode.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewConfigurationsClient().BeginUpdateOnNode(ctx, "TestResourceGroup", "testcluster", "array_nulls", armcosmosforpostgresql.ServerConfiguration{ Properties: &armcosmosforpostgresql.ServerConfigurationProperties{ Value: to.Ptr("off"), }, }, 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.ServerConfiguration = armcosmosforpostgresql.ServerConfiguration{ // Name: to.Ptr("array_nulls"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations/node"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/array_nulls"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ServerConfigurationProperties{ // Description: to.Ptr("Enables input of NULL elements in arrays."), // AllowedValues: to.Ptr("on,off"), // DataType: to.Ptr(armcosmosforpostgresql.ConfigurationDataTypeBoolean), // DefaultValue: to.Ptr("on"), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // RequiresRestart: to.Ptr(false), // Source: to.Ptr("user-override"), // Value: to.Ptr("off"), // }, // } }
Output:
func (*ConfigurationsClient) Get ¶
func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, options *ConfigurationsClientGetOptions) (ConfigurationsClientGetResponse, error)
Get - Gets information of a configuration for coordinator and nodes. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- configurationName - The name of the cluster configuration.
- options - ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ConfigurationGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewConfigurationsClient().Get(ctx, "TestResourceGroup", "testcluster", "client_encoding", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Configuration = armcosmosforpostgresql.Configuration{ // Name: to.Ptr("client_encoding"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/client_encoding"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ConfigurationProperties{ // Description: to.Ptr("Sets the client's character set encoding."), // AllowedValues: to.Ptr("BIG5,EUC_CN,EUC_JP,EUC_JIS_2004,EUC_KR,EUC_TW,GB18030,GBK,ISO_8859_5,ISO_8859_6,ISO_8859_7,ISO_8859_8,JOHAB,KOI8R,KOI8U,LATIN1,LATIN2,LATIN3,LATIN4,LATIN5,LATIN6,LATIN7,LATIN8,LATIN9,LATIN10,MULE_INTERNAL,SJIS,SHIFT_JIS_2004,SQL_ASCII,UHC,UTF8,WIN866,WIN874,WIN1250,WIN1251,WIN1252,WIN1253,WIN1254,WIN1255,WIN1256,WIN1257,WIN1258"), // DataType: to.Ptr(armcosmosforpostgresql.ConfigurationDataTypeEnumeration), // ServerRoleGroupConfigurations: []*armcosmosforpostgresql.ServerRoleGroupConfiguration{ // { // DefaultValue: to.Ptr("sql_ascii"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleCoordinator), // Source: to.Ptr("user-override"), // Value: to.Ptr("ISO_8859_7"), // }, // { // DefaultValue: to.Ptr("sql_ascii"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleWorker), // Source: to.Ptr("user-override"), // Value: to.Ptr("ISO_8859_7"), // }}, // }, // } }
Output:
func (*ConfigurationsClient) GetCoordinator ¶
func (client *ConfigurationsClient) GetCoordinator(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, options *ConfigurationsClientGetCoordinatorOptions) (ConfigurationsClientGetCoordinatorResponse, error)
GetCoordinator - Gets information of a configuration for coordinator. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- configurationName - The name of the cluster configuration.
- options - ConfigurationsClientGetCoordinatorOptions contains the optional parameters for the ConfigurationsClient.GetCoordinator method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ConfigurationGetCoordinator.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewConfigurationsClient().GetCoordinator(ctx, "TestResourceGroup", "testcluster", "array_nulls", 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.ServerConfiguration = armcosmosforpostgresql.ServerConfiguration{ // Name: to.Ptr("array_nulls"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/coordinatorConfigurations"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/coordinatorConfigurations/array_nulls"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ServerConfigurationProperties{ // Value: to.Ptr("on"), // }, // } }
Output:
func (*ConfigurationsClient) GetNode ¶
func (client *ConfigurationsClient) GetNode(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, options *ConfigurationsClientGetNodeOptions) (ConfigurationsClientGetNodeResponse, error)
GetNode - Gets information of a configuration for worker nodes. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- configurationName - The name of the cluster configuration.
- options - ConfigurationsClientGetNodeOptions contains the optional parameters for the ConfigurationsClient.GetNode method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ConfigurationGetNode.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewConfigurationsClient().GetNode(ctx, "TestResourceGroup", "testcluster", "array_nulls", 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.ServerConfiguration = armcosmosforpostgresql.ServerConfiguration{ // Name: to.Ptr("array_nulls"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/nodeConfigurations"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/nodeConfigurations/array_nulls"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ServerConfigurationProperties{ // Value: to.Ptr("off"), // }, // } }
Output:
func (*ConfigurationsClient) NewListByClusterPager ¶
func (client *ConfigurationsClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *ConfigurationsClientListByClusterOptions) *runtime.Pager[ConfigurationsClientListByClusterResponse]
NewListByClusterPager - List all the configurations of a cluster.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - ConfigurationsClientListByClusterOptions contains the optional parameters for the ConfigurationsClient.NewListByClusterPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ConfigurationListByCluster.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewConfigurationsClient().NewListByClusterPager("TestResourceGroup", "testcluster", 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.ClusterConfigurationListResult = armcosmosforpostgresql.ClusterConfigurationListResult{ // Value: []*armcosmosforpostgresql.Configuration{ // { // Name: to.Ptr("array_nulls"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/array_nulls"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ConfigurationProperties{ // Description: to.Ptr("Enable input of NULL elements in arrays."), // AllowedValues: to.Ptr("on,off"), // DataType: to.Ptr(armcosmosforpostgresql.ConfigurationDataTypeBoolean), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // ServerRoleGroupConfigurations: []*armcosmosforpostgresql.ServerRoleGroupConfiguration{ // { // DefaultValue: to.Ptr("on"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleCoordinator), // Source: to.Ptr("system-default"), // Value: to.Ptr("on"), // }, // { // DefaultValue: to.Ptr("on"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleWorker), // Source: to.Ptr("user-override"), // Value: to.Ptr("off"), // }}, // }, // }, // { // Name: to.Ptr("backslash_quote"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/backslash_quote"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ConfigurationProperties{ // Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."), // AllowedValues: to.Ptr("safe_encoding,on,off"), // DataType: to.Ptr(armcosmosforpostgresql.ConfigurationDataTypeEnumeration), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // ServerRoleGroupConfigurations: []*armcosmosforpostgresql.ServerRoleGroupConfiguration{ // { // DefaultValue: to.Ptr("safe_encoding"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleCoordinator), // Source: to.Ptr("user-override"), // Value: to.Ptr("off"), // }, // { // DefaultValue: to.Ptr("safe_encoding"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleWorker), // Source: to.Ptr("system-default"), // Value: to.Ptr("safe_encoding"), // }}, // }, // }, // { // Name: to.Ptr("work_mem"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/work_mem"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ConfigurationProperties{ // Description: to.Ptr("Sets the amount of memory to be used by internal sort operations and hash tables before writing to temporary disk files."), // AllowedValues: to.Ptr("4096-2097151"), // DataType: to.Ptr(armcosmosforpostgresql.ConfigurationDataTypeInteger), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // ServerRoleGroupConfigurations: []*armcosmosforpostgresql.ServerRoleGroupConfiguration{ // { // DefaultValue: to.Ptr("158720"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleCoordinator), // Source: to.Ptr("system-default"), // Value: to.Ptr("158720"), // }, // { // DefaultValue: to.Ptr("115712"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleWorker), // Source: to.Ptr("system-default"), // Value: to.Ptr("115712"), // }}, // }, // }, // { // Name: to.Ptr("client_encoding"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/client_encoding"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ConfigurationProperties{ // Description: to.Ptr("Sets the client's character set encoding."), // AllowedValues: to.Ptr("BIG5,EUC_CN,EUC_JP,EUC_JIS_2004,EUC_KR,EUC_TW,GB18030,GBK,ISO_8859_5,ISO_8859_6,ISO_8859_7,ISO_8859_8,JOHAB,KOI8R,KOI8U,LATIN1,LATIN2,LATIN3,LATIN4,LATIN5,LATIN6,LATIN7,LATIN8,LATIN9,LATIN10,MULE_INTERNAL,SJIS,SHIFT_JIS_2004,SQL_ASCII,UHC,UTF8,WIN866,WIN874,WIN1250,WIN1251,WIN1252,WIN1253,WIN1254,WIN1255,WIN1256,WIN1257,WIN1258"), // DataType: to.Ptr(armcosmosforpostgresql.ConfigurationDataTypeEnumeration), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // ServerRoleGroupConfigurations: []*armcosmosforpostgresql.ServerRoleGroupConfiguration{ // { // DefaultValue: to.Ptr("sql_ascii"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleCoordinator), // Source: to.Ptr("user-override"), // Value: to.Ptr("ISO_8859_7"), // }, // { // DefaultValue: to.Ptr("sql_ascii"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleWorker), // Source: to.Ptr("user-override"), // Value: to.Ptr("ISO_8859_7"), // }}, // }, // }}, // } } }
Output:
func (*ConfigurationsClient) NewListByServerPager ¶
func (client *ConfigurationsClient) NewListByServerPager(resourceGroupName string, clusterName string, serverName string, options *ConfigurationsClientListByServerOptions) *runtime.Pager[ConfigurationsClientListByServerResponse]
NewListByServerPager - List all the configurations of a server in cluster.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- serverName - The name of the server.
- options - ConfigurationsClientListByServerOptions contains the optional parameters for the ConfigurationsClient.NewListByServerPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ConfigurationListByServer.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewConfigurationsClient().NewListByServerPager("TestResourceGroup", "testcluster", "testserver", 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.ServerConfigurationListResult = armcosmosforpostgresql.ServerConfigurationListResult{ // Value: []*armcosmosforpostgresql.ServerConfiguration{ // { // Name: to.Ptr("application_name"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers/configurations"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/servers/testserver/configurations/application_name"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ServerConfigurationProperties{ // Description: to.Ptr("Sets the application name to be reported in statistics and logs."), // AllowedValues: to.Ptr("[A-Za-z0-9._-]*"), // DataType: to.Ptr(armcosmosforpostgresql.ConfigurationDataType("String")), // DefaultValue: to.Ptr(""), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // Source: to.Ptr("system-default"), // Value: to.Ptr(""), // }, // }, // { // Name: to.Ptr("array_nulls"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers/configurations"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/servers/testserver/configurations/array_nulls"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ServerConfigurationProperties{ // Description: to.Ptr("Enables input of NULL elements in arrays."), // AllowedValues: to.Ptr("on,off"), // DataType: to.Ptr(armcosmosforpostgresql.ConfigurationDataTypeBoolean), // DefaultValue: to.Ptr("on"), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // Source: to.Ptr("system-default"), // Value: to.Ptr("on"), // }, // }, // { // Name: to.Ptr("autovacuum"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers/configurations"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/servers/testserver/configurations/autovacuum"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ServerConfigurationProperties{ // Description: to.Ptr("Starts the autovacuum subprocess."), // AllowedValues: to.Ptr("on,off"), // DataType: to.Ptr(armcosmosforpostgresql.ConfigurationDataTypeBoolean), // DefaultValue: to.Ptr("on"), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // Source: to.Ptr("system-default"), // Value: to.Ptr("on"), // }, // }}, // } } }
Output:
type ConfigurationsClientBeginUpdateOnCoordinatorOptions ¶
type ConfigurationsClientBeginUpdateOnCoordinatorOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ConfigurationsClientBeginUpdateOnCoordinatorOptions contains the optional parameters for the ConfigurationsClient.BeginUpdateOnCoordinator method.
type ConfigurationsClientBeginUpdateOnNodeOptions ¶
type ConfigurationsClientBeginUpdateOnNodeOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ConfigurationsClientBeginUpdateOnNodeOptions contains the optional parameters for the ConfigurationsClient.BeginUpdateOnNode method.
type ConfigurationsClientGetCoordinatorOptions ¶
type ConfigurationsClientGetCoordinatorOptions struct { }
ConfigurationsClientGetCoordinatorOptions contains the optional parameters for the ConfigurationsClient.GetCoordinator method.
type ConfigurationsClientGetCoordinatorResponse ¶
type ConfigurationsClientGetCoordinatorResponse struct {
ServerConfiguration
}
ConfigurationsClientGetCoordinatorResponse contains the response from method ConfigurationsClient.GetCoordinator.
type ConfigurationsClientGetNodeOptions ¶
type ConfigurationsClientGetNodeOptions struct { }
ConfigurationsClientGetNodeOptions contains the optional parameters for the ConfigurationsClient.GetNode method.
type ConfigurationsClientGetNodeResponse ¶
type ConfigurationsClientGetNodeResponse struct {
ServerConfiguration
}
ConfigurationsClientGetNodeResponse contains the response from method ConfigurationsClient.GetNode.
type ConfigurationsClientGetOptions ¶
type ConfigurationsClientGetOptions struct { }
ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method.
type ConfigurationsClientGetResponse ¶
type ConfigurationsClientGetResponse struct {
Configuration
}
ConfigurationsClientGetResponse contains the response from method ConfigurationsClient.Get.
type ConfigurationsClientListByClusterOptions ¶
type ConfigurationsClientListByClusterOptions struct { }
ConfigurationsClientListByClusterOptions contains the optional parameters for the ConfigurationsClient.NewListByClusterPager method.
type ConfigurationsClientListByClusterResponse ¶
type ConfigurationsClientListByClusterResponse struct {
ClusterConfigurationListResult
}
ConfigurationsClientListByClusterResponse contains the response from method ConfigurationsClient.NewListByClusterPager.
type ConfigurationsClientListByServerOptions ¶
type ConfigurationsClientListByServerOptions struct { }
ConfigurationsClientListByServerOptions contains the optional parameters for the ConfigurationsClient.NewListByServerPager method.
type ConfigurationsClientListByServerResponse ¶
type ConfigurationsClientListByServerResponse struct {
ServerConfigurationListResult
}
ConfigurationsClientListByServerResponse contains the response from method ConfigurationsClient.NewListByServerPager.
type ConfigurationsClientUpdateOnCoordinatorResponse ¶
type ConfigurationsClientUpdateOnCoordinatorResponse struct {
ServerConfiguration
}
ConfigurationsClientUpdateOnCoordinatorResponse contains the response from method ConfigurationsClient.BeginUpdateOnCoordinator.
type ConfigurationsClientUpdateOnNodeResponse ¶
type ConfigurationsClientUpdateOnNodeResponse struct {
ServerConfiguration
}
ConfigurationsClientUpdateOnNodeResponse contains the response from method ConfigurationsClient.BeginUpdateOnNode.
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 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 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 cluster. Value []*FirewallRule }
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 cluster firewall rule. Must be IPv4 format. EndIPAddress *string // REQUIRED; The start IP address of the cluster firewall rule. Must be IPv4 format. StartIPAddress *string // READ-ONLY; Provisioning state of the firewall rule. ProvisioningState *ProvisioningState }
FirewallRuleProperties - The properties of a 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 FirewallRulesClient ¶
type FirewallRulesClient struct {
// contains filtered or unexported fields
}
FirewallRulesClient contains the methods for the FirewallRules group. Don't use this type directly, use NewFirewallRulesClient() instead.
func NewFirewallRulesClient ¶
func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallRulesClient, error)
NewFirewallRulesClient creates a new instance of FirewallRulesClient with the specified values.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*FirewallRulesClient) BeginCreateOrUpdate ¶
func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[FirewallRulesClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Creates a new cluster firewall rule or updates an existing cluster firewall rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- firewallRuleName - The name of the cluster firewall rule.
- parameters - The required parameters for creating or updating a firewall rule.
- options - FirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/FirewallRuleCreate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "pgtestsvc4", "rule1", armcosmosforpostgresql.FirewallRule{ Properties: &armcosmosforpostgresql.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 = armcosmosforpostgresql.FirewallRule{ // Name: to.Ptr("rule1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/firewallRules"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/pgtestsvc4/firewallRules/rule1"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.FirewallRuleProperties{ // EndIPAddress: to.Ptr("255.255.255.255"), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // StartIPAddress: to.Ptr("0.0.0.0"), // }, // } }
Output:
func (*FirewallRulesClient) BeginDelete ¶
func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*runtime.Poller[FirewallRulesClientDeleteResponse], error)
BeginDelete - Deletes a cluster firewall rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- firewallRuleName - The name of the cluster firewall rule.
- options - FirewallRulesClientBeginDeleteOptions contains the optional parameters for the FirewallRulesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/FirewallRuleDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "TestGroup", "pgtestsvc4", "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 (*FirewallRulesClient) Get ¶
func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (FirewallRulesClientGetResponse, error)
Get - Gets information about a cluster firewall rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- firewallRuleName - The name of the cluster firewall rule.
- options - FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/FirewallRuleGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "TestGroup", "pgtestsvc4", "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 = armcosmosforpostgresql.FirewallRule{ // Name: to.Ptr("rule1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/firewallRules"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/pgtestsvc4/firewallRules/rule1"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.FirewallRuleProperties{ // EndIPAddress: to.Ptr("255.255.255.255"), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // StartIPAddress: to.Ptr("0.0.0.0"), // }, // } }
Output:
func (*FirewallRulesClient) NewListByClusterPager ¶
func (client *FirewallRulesClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *FirewallRulesClientListByClusterOptions) *runtime.Pager[FirewallRulesClientListByClusterResponse]
NewListByClusterPager - Lists all the firewall rules on cluster.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - FirewallRulesClientListByClusterOptions contains the optional parameters for the FirewallRulesClient.NewListByClusterPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/FirewallRuleListByCluster.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewFirewallRulesClient().NewListByClusterPager("TestGroup", "pgtestsvc4", 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 = armcosmosforpostgresql.FirewallRuleListResult{ // Value: []*armcosmosforpostgresql.FirewallRule{ // { // Name: to.Ptr("rule1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/firewallRules"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/pgtestsvc4/firewallRules/rule1"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.FirewallRuleProperties{ // EndIPAddress: to.Ptr("255.255.255.255"), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // StartIPAddress: to.Ptr("0.0.0.0"), // }, // }, // { // Name: to.Ptr("rule2"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/firewallRules"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/pgtestsvc4/firewallRules/rule2"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.FirewallRuleProperties{ // EndIPAddress: to.Ptr("255.0.0.0"), // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // StartIPAddress: to.Ptr("1.0.0.0"), // }, // }}, // } } }
Output:
type FirewallRulesClientBeginCreateOrUpdateOptions ¶
type FirewallRulesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
FirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.BeginCreateOrUpdate method.
type FirewallRulesClientBeginDeleteOptions ¶
type FirewallRulesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
FirewallRulesClientBeginDeleteOptions contains the optional parameters for the FirewallRulesClient.BeginDelete method.
type FirewallRulesClientCreateOrUpdateResponse ¶
type FirewallRulesClientCreateOrUpdateResponse struct {
FirewallRule
}
FirewallRulesClientCreateOrUpdateResponse contains the response from method FirewallRulesClient.BeginCreateOrUpdate.
type FirewallRulesClientDeleteResponse ¶
type FirewallRulesClientDeleteResponse struct { }
FirewallRulesClientDeleteResponse contains the response from method FirewallRulesClient.BeginDelete.
type FirewallRulesClientGetOptions ¶
type FirewallRulesClientGetOptions struct { }
FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method.
type FirewallRulesClientGetResponse ¶
type FirewallRulesClientGetResponse struct {
FirewallRule
}
FirewallRulesClientGetResponse contains the response from method FirewallRulesClient.Get.
type FirewallRulesClientListByClusterOptions ¶
type FirewallRulesClientListByClusterOptions struct { }
FirewallRulesClientListByClusterOptions contains the optional parameters for the FirewallRulesClient.NewListByClusterPager method.
type FirewallRulesClientListByClusterResponse ¶
type FirewallRulesClientListByClusterResponse struct {
FirewallRuleListResult
}
FirewallRulesClientListByClusterResponse contains the response from method FirewallRulesClient.NewListByClusterPager.
type MaintenanceWindow ¶
type MaintenanceWindow struct { // Indicates whether custom maintenance window is enabled or not. CustomWindow *string // Preferred day of the week for maintenance window. DayOfWeek *int32 // Start hour within preferred day of the week for maintenance window. StartHour *int32 // Start minute within the start hour for maintenance window. StartMinute *int32 }
MaintenanceWindow - Schedule settings for regular cluster updates.
func (MaintenanceWindow) MarshalJSON ¶
func (m MaintenanceWindow) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MaintenanceWindow.
func (*MaintenanceWindow) UnmarshalJSON ¶
func (m *MaintenanceWindow) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindow.
type NameAvailability ¶
type NameAvailability struct { // Error message. Message *string // Name of the cluster. Name *string // Indicates whether the cluster name is available. NameAvailable *bool // Type of the cluster. Type *string }
NameAvailability - Represents cluster name availability.
func (NameAvailability) MarshalJSON ¶
func (n NameAvailability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NameAvailability.
func (*NameAvailability) UnmarshalJSON ¶
func (n *NameAvailability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailability.
type NameAvailabilityRequest ¶
type NameAvailabilityRequest struct { // REQUIRED; Cluster name to verify. Name *string // CONSTANT; Resource type used for verification. // Field has constant value "Microsoft.DBforPostgreSQL/serverGroupsv2", any specified value is ignored. Type *string }
NameAvailabilityRequest - Request from client to check cluster name availability.
func (NameAvailabilityRequest) MarshalJSON ¶
func (n NameAvailabilityRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NameAvailabilityRequest.
func (*NameAvailabilityRequest) UnmarshalJSON ¶
func (n *NameAvailabilityRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityRequest.
type Operation ¶
type Operation struct { // Indicates whether the operation is a data action. IsDataAction *bool // READ-ONLY; The localized display information for this particular operation or action. Display *OperationDisplay // READ-ONLY; The name of the operation being performed on this particular object. Name *string // READ-ONLY; The intended executor of the operation. Origin *OperationOrigin // READ-ONLY; Additional descriptions for the operation. Properties map[string]any }
Operation - REST API operation definition.
func (Operation) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct { // READ-ONLY; Operation description. Description *string // READ-ONLY; Localized friendly name for the operation. Operation *string // READ-ONLY; Operation resource provider name. Provider *string // READ-ONLY; Resource on which the operation is performed. Resource *string }
OperationDisplay - Display metadata associated with 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 { // Collection of available operation details. Value []*Operation // READ-ONLY; URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. NextLink *string }
OperationListResult - A list of resource provider operations.
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 OperationOrigin ¶
type OperationOrigin string
OperationOrigin - The intended executor of the operation.
const ( OperationOriginNotSpecified OperationOrigin = "NotSpecified" OperationOriginSystem OperationOrigin = "system" OperationOriginUser OperationOrigin = "user" )
func PossibleOperationOriginValues ¶
func PossibleOperationOriginValues() []OperationOrigin
PossibleOperationOriginValues returns the possible values for the OperationOrigin const type.
type OperationsClient ¶
type OperationsClient struct {
// contains filtered or unexported fields
}
OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.
func NewOperationsClient ¶
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)
NewOperationsClient creates a new instance of OperationsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*OperationsClient) NewListPager ¶
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - Lists all of the available REST API operations.
Generated from API version 2022-11-08
- 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/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/OperationList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.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 = armcosmosforpostgresql.OperationListResult{ // Value: []*armcosmosforpostgresql.Operation{ // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/read"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Return the list of clusters or gets the properties for the specified cluster."), // Operation: to.Ptr("List/Get PostgreSQL Clusters"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("PostgreSQL Cluster"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/write"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Creates a cluster with the specified parameters or update the properties or tags for the specified cluster."), // Operation: to.Ptr("Create/Update PostgreSQL Cluster"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("PostgreSQL Cluster"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/delete"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Deletes an existing cluster."), // Operation: to.Ptr("Delete PostgreSQL Cluster"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("PostgreSQL Cluster"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers/read"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Return the list of servers of cluster or gets the properties for the specified server from cluster."), // Operation: to.Ptr("List/Get PostgreSQL Servers of Cluster"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("PostgreSQL Server"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers/configurations/read"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Return the list of configurations for a server or gets the value for the specified configuration."), // Operation: to.Ptr("List/Get Configurations of Server"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("Configurations"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations/read"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Return the list of configurations for a cluster or gets the value for the specified configuration."), // Operation: to.Ptr("List/Get Configurations of Cluster"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("Configurations"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations/write"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Update an value of configurations."), // Operation: to.Ptr("Update Configurations of Cluster"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("Configurations"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/firewallRules/read"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Return the list of firewall rules for a cluster or gets the properties for the specified firewall rule."), // Operation: to.Ptr("List/Get Firewall Rules"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("Firewall Rules"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/firewallRules/write"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."), // Operation: to.Ptr("Create/Update Firewall Rule"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("Firewall Rules"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/firewallRules/delete"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Deletes an existing firewall rule."), // Operation: to.Ptr("Delete Firewall Rule"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("Firewall Rules"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/providers/Microsoft.Insights/metricDefinitions/read"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Return types of metrics that are available for databases"), // Operation: to.Ptr("Get database metric definitions"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("Database Metric Definition"), // }, // Properties: map[string]any{ // "serviceSpecification": map[string]any{ // "metricSpecifications":[]any{ // map[string]any{ // "name": "cpu_percent", // "aggregationType": "Average", // "displayDescription": "CPU percent", // "displayName": "CPU percent", // "fillGapWithZero": true, // "unit": "Percent", // }, // map[string]any{ // "name": "memory_percent", // "aggregationType": "Average", // "displayDescription": "Memory percent", // "displayName": "Memory percent", // "fillGapWithZero": true, // "unit": "Percent", // }, // map[string]any{ // "name": "io_consumption_percent", // "aggregationType": "Average", // "displayDescription": "IO percent", // "displayName": "IO percent", // "fillGapWithZero": true, // "unit": "Percent", // }, // map[string]any{ // "name": "storage_percent", // "aggregationType": "Average", // "displayDescription": "Storage percentage", // "displayName": "Storage percentage", // "unit": "Percent", // }, // map[string]any{ // "name": "storage_used", // "aggregationType": "Average", // "displayDescription": "Storage used", // "displayName": "Storage used", // "unit": "Bytes", // }, // map[string]any{ // "name": "storage_limit", // "aggregationType": "Average", // "displayDescription": "Storage limit", // "displayName": "Storage limit", // "unit": "Bytes", // }, // map[string]any{ // "name": "active_connections", // "aggregationType": "Average", // "displayDescription": "Total active connections", // "displayName": "Total active connections", // "fillGapWithZero": true, // "unit": "Count", // }, // map[string]any{ // "name": "connections_failed", // "aggregationType": "Average", // "displayDescription": "Total failed connections", // "displayName": "Total failed connections", // "fillGapWithZero": true, // "unit": "Count", // }, // }, // }, // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/providers/Microsoft.Insights/diagnosticSettings/read"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Gets the disagnostic setting for the resource"), // Operation: to.Ptr("Read diagnostic setting"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("Database Metric Definition"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/providers/Microsoft.Insights/diagnosticSettings/write"), // Display: &armcosmosforpostgresql.OperationDisplay{ // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), // Operation: to.Ptr("Write diagnostic setting"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("Database Metric Definition"), // }, // }}, // } } }
Output:
type OperationsClientListOptions ¶
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
type OperationsClientListResponse ¶
type OperationsClientListResponse struct {
OperationListResult
}
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type PrivateEndpoint ¶
type PrivateEndpoint struct { // READ-ONLY; The ARM identifier for private endpoint. ID *string }
PrivateEndpoint - The private endpoint resource.
func (PrivateEndpoint) MarshalJSON ¶
func (p PrivateEndpoint) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint.
func (*PrivateEndpoint) UnmarshalJSON ¶
func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint.
type PrivateEndpointConnection ¶
type PrivateEndpointConnection struct { // Resource properties. Properties *PrivateEndpointConnectionProperties // 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 }
PrivateEndpointConnection - The private endpoint connection resource.
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 - List of private endpoint connections associated with the specified resource.
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 { // REQUIRED; A collection of information about the state of the connection between service consumer and provider. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState // The private endpoint resource. PrivateEndpoint *PrivateEndpoint // READ-ONLY; The group ids for the private endpoint resource. GroupIDs []*string // READ-ONLY; The provisioning state of the private endpoint connection resource. ProvisioningState *PrivateEndpointConnectionProvisioningState }
PrivateEndpointConnectionProperties - Properties of the 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 PrivateEndpointConnectionProvisioningState ¶
type PrivateEndpointConnectionProvisioningState string
PrivateEndpointConnectionProvisioningState - The current provisioning state.
const ( PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" )
func PossiblePrivateEndpointConnectionProvisioningStateValues ¶
func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState
PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type.
type PrivateEndpointConnectionSimpleProperties ¶
type PrivateEndpointConnectionSimpleProperties struct { // Group ids of the private endpoint connection. GroupIDs []*string // Private endpoint which the connection belongs to. PrivateEndpoint *PrivateEndpointProperty // A collection of information about the state of the connection between service consumer and provider. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState }
PrivateEndpointConnectionSimpleProperties - The properties in private endpoint connection
func (PrivateEndpointConnectionSimpleProperties) MarshalJSON ¶
func (p PrivateEndpointConnectionSimpleProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionSimpleProperties.
func (*PrivateEndpointConnectionSimpleProperties) UnmarshalJSON ¶
func (p *PrivateEndpointConnectionSimpleProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionSimpleProperties.
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PrivateEndpointConnectionsClient) BeginCreateOrUpdate ¶
func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Approves or Rejects a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- privateEndpointConnectionName - The name of the private endpoint connection associated with the cluster.
- parameters - The required parameters for approving a 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/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/PrivateEndpointConnectionCreateOrUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "TestGroup", "testcluster", "private-endpoint-connection-name", armcosmosforpostgresql.PrivateEndpointConnection{ Properties: &armcosmosforpostgresql.PrivateEndpointConnectionProperties{ PrivateLinkServiceConnectionState: &armcosmosforpostgresql.PrivateLinkServiceConnectionState{ Description: to.Ptr("Approved by johndoe@contoso.com"), Status: to.Ptr(armcosmosforpostgresql.PrivateEndpointServiceConnectionStatusApproved), }, }, }, 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 = armcosmosforpostgresql.PrivateEndpointConnection{ // Name: to.Ptr("private-endpoint-connection-name"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/privateEndpointConnections/private-endpoint-connection-name"), // Properties: &armcosmosforpostgresql.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armcosmosforpostgresql.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), // }, // PrivateLinkServiceConnectionState: &armcosmosforpostgresql.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Approved by johndoe@contoso.com"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armcosmosforpostgresql.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armcosmosforpostgresql.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // } }
Output:
func (*PrivateEndpointConnectionsClient) BeginDelete ¶
func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName 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 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- privateEndpointConnectionName - The name of the private endpoint connection associated with the cluster.
- 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/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/PrivateEndpointConnectionsDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "TestGroup", "testcluster", "private-endpoint-connection-name", 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, clusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)
Get - Gets private endpoint connection. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- privateEndpointConnectionName - The name of the private endpoint connection associated with the cluster.
- 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/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/PrivateEndpointConnectionsGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "TestGroup", "testcluster", "private-endpoint-connection-name", 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 = armcosmosforpostgresql.PrivateEndpointConnection{ // Name: to.Ptr("private-endpoint-connection-name"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/privateEndpointConnections/private-endpoint-connection-name"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.PrivateEndpointConnectionProperties{ // GroupIDs: []*string{ // to.Ptr("coordinator")}, // PrivateEndpoint: &armcosmosforpostgresql.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), // }, // PrivateLinkServiceConnectionState: &armcosmosforpostgresql.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-approved"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armcosmosforpostgresql.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armcosmosforpostgresql.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // } }
Output:
func (*PrivateEndpointConnectionsClient) NewListByClusterPager ¶
func (client *PrivateEndpointConnectionsClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *PrivateEndpointConnectionsClientListByClusterOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByClusterResponse]
NewListByClusterPager - Gets list of private endpoint connections on a cluster.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - PrivateEndpointConnectionsClientListByClusterOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByClusterPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/PrivateEndpointConnectionsListByCluster.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByClusterPager("TestResourceGroup", "testcluster", 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 = armcosmosforpostgresql.PrivateEndpointConnectionListResult{ // Value: []*armcosmosforpostgresql.PrivateEndpointConnection{ // { // Name: to.Ptr("private-endpoint-connection-name"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/privateEndpointConnections/private-endpoint-connection-name"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.PrivateEndpointConnectionProperties{ // GroupIDs: []*string{ // to.Ptr("coordinator")}, // PrivateEndpoint: &armcosmosforpostgresql.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), // }, // PrivateLinkServiceConnectionState: &armcosmosforpostgresql.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-approved"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armcosmosforpostgresql.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armcosmosforpostgresql.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // }, // { // Name: to.Ptr("private-endpoint-connection-name-2"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/privateEndpointConnections/private-endpoint-connection-name-2"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.PrivateEndpointConnectionProperties{ // GroupIDs: []*string{ // to.Ptr("worker-0")}, // PrivateEndpoint: &armcosmosforpostgresql.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), // }, // PrivateLinkServiceConnectionState: &armcosmosforpostgresql.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-approved"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armcosmosforpostgresql.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armcosmosforpostgresql.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // }}, // } } }
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 {
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 {
PrivateEndpointConnection
}
PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.
type PrivateEndpointConnectionsClientListByClusterOptions ¶
type PrivateEndpointConnectionsClientListByClusterOptions struct { }
PrivateEndpointConnectionsClientListByClusterOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByClusterPager method.
type PrivateEndpointConnectionsClientListByClusterResponse ¶
type PrivateEndpointConnectionsClientListByClusterResponse struct {
PrivateEndpointConnectionListResult
}
PrivateEndpointConnectionsClientListByClusterResponse contains the response from method PrivateEndpointConnectionsClient.NewListByClusterPager.
type PrivateEndpointProperty ¶
type PrivateEndpointProperty struct { // Resource id of the private endpoint. ID *string }
PrivateEndpointProperty - Property to represent resource id of the private endpoint.
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 PrivateEndpointServiceConnectionStatus ¶
type PrivateEndpointServiceConnectionStatus string
PrivateEndpointServiceConnectionStatus - The private endpoint connection status.
const ( PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" )
func PossiblePrivateEndpointServiceConnectionStatusValues ¶
func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus
PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type.
type PrivateLinkResource ¶
type PrivateLinkResource struct { // Resource properties. Properties *PrivateLinkResourceProperties // 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 }
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 { // The private link resource private link DNS zone name. RequiredZoneNames []*string // READ-ONLY; The private link resource group id. GroupID *string // READ-ONLY; The private link resource required member names. RequiredMembers []*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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PrivateLinkResourcesClient) Get ¶
func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, privateLinkResourceName string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error)
Get - Gets a private link resource for cluster. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- privateLinkResourceName - 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/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/PrivateLinkResourcesGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "TestGroup", "testcluster", "plr", 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 = armcosmosforpostgresql.PrivateLinkResource{ // Name: to.Ptr("plr"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateLinkResources"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/privateLinkResources/plr"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.PrivateLinkResourceProperties{ // GroupID: to.Ptr("coordinator"), // RequiredMembers: []*string{ // to.Ptr("coordinator")}, // RequiredZoneNames: []*string{ // to.Ptr("privatelink.testcluster.postgres.database.azure.com")}, // }, // } }
Output:
func (*PrivateLinkResourcesClient) NewListByClusterPager ¶
func (client *PrivateLinkResourcesClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *PrivateLinkResourcesClientListByClusterOptions) *runtime.Pager[PrivateLinkResourcesClientListByClusterResponse]
NewListByClusterPager - Gets the private link resources for cluster.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - PrivateLinkResourcesClientListByClusterOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByClusterPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/PrivateLinkResourceListByCluster.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewPrivateLinkResourcesClient().NewListByClusterPager("TestResourceGroup", "testcluster", 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 = armcosmosforpostgresql.PrivateLinkResourceListResult{ // Value: []*armcosmosforpostgresql.PrivateLinkResource{ // { // Name: to.Ptr("coordinator"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateLinkResources"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/privateLinkResources/coordinator"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.PrivateLinkResourceProperties{ // GroupID: to.Ptr("coordinator"), // RequiredMembers: []*string{ // to.Ptr("coordinator")}, // RequiredZoneNames: []*string{ // to.Ptr("privatelink.testcluster.postgres.database.azure.com")}, // }, // }, // { // Name: to.Ptr("worker-0"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/privateLinkResources"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/privateLinkResources/worker-0"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.PrivateLinkResourceProperties{ // GroupID: to.Ptr("worker-0"), // RequiredMembers: []*string{ // to.Ptr("worker-0")}, // RequiredZoneNames: []*string{ // to.Ptr("privatelink.testcluster.postgres.database.azure.com")}, // }, // }}, // } } }
Output:
type PrivateLinkResourcesClientGetOptions ¶
type PrivateLinkResourcesClientGetOptions struct { }
PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method.
type PrivateLinkResourcesClientGetResponse ¶
type PrivateLinkResourcesClientGetResponse struct {
PrivateLinkResource
}
PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get.
type PrivateLinkResourcesClientListByClusterOptions ¶
type PrivateLinkResourcesClientListByClusterOptions struct { }
PrivateLinkResourcesClientListByClusterOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByClusterPager method.
type PrivateLinkResourcesClientListByClusterResponse ¶
type PrivateLinkResourcesClientListByClusterResponse struct {
PrivateLinkResourceListResult
}
PrivateLinkResourcesClientListByClusterResponse contains the response from method PrivateLinkResourcesClient.NewListByClusterPager.
type PrivateLinkServiceConnectionState ¶
type PrivateLinkServiceConnectionState struct { // A message indicating if changes on the service provider require any updates on the consumer. ActionsRequired *string // The reason for approval/rejection of the connection. Description *string // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Status *PrivateEndpointServiceConnectionStatus }
PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
func (PrivateLinkServiceConnectionState) MarshalJSON ¶
func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.
func (*PrivateLinkServiceConnectionState) UnmarshalJSON ¶
func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.
type ProvisioningState ¶
type ProvisioningState string
ProvisioningState - The current provisioning state.
const ( ProvisioningStateCanceled ProvisioningState = "Canceled" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateInProgress ProvisioningState = "InProgress" ProvisioningStateSucceeded ProvisioningState = "Succeeded" )
func PossibleProvisioningStateValues ¶
func PossibleProvisioningStateValues() []ProvisioningState
PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
type Role ¶
type Role struct { // REQUIRED; The properties of a role. Properties *RoleProperties // 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 }
Role - Represents a cluster role.
func (Role) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Role.
func (*Role) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Role.
type RoleListResult ¶
type RoleListResult struct { // The list of roles in a cluster. Value []*Role }
RoleListResult - A list of roles.
func (RoleListResult) MarshalJSON ¶
func (r RoleListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleListResult.
func (*RoleListResult) UnmarshalJSON ¶
func (r *RoleListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleListResult.
type RoleProperties ¶
type RoleProperties struct { // REQUIRED; The password of the cluster role. Password *string // READ-ONLY; Provisioning state of the role ProvisioningState *ProvisioningState }
RoleProperties - The properties of a cluster role.
func (RoleProperties) MarshalJSON ¶
func (r RoleProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleProperties.
func (*RoleProperties) UnmarshalJSON ¶
func (r *RoleProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleProperties.
type RolesClient ¶
type RolesClient struct {
// contains filtered or unexported fields
}
RolesClient contains the methods for the Roles group. Don't use this type directly, use NewRolesClient() instead.
func NewRolesClient ¶
func NewRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RolesClient, error)
NewRolesClient creates a new instance of RolesClient with the specified values.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*RolesClient) BeginCreate ¶
func (client *RolesClient) BeginCreate(ctx context.Context, resourceGroupName string, clusterName string, roleName string, parameters Role, options *RolesClientBeginCreateOptions) (*runtime.Poller[RolesClientCreateResponse], error)
BeginCreate - Creates a new role or updates an existing role. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- roleName - The name of the cluster role.
- parameters - The required parameters for creating or updating a role.
- options - RolesClientBeginCreateOptions contains the optional parameters for the RolesClient.BeginCreate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/RoleCreate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRolesClient().BeginCreate(ctx, "TestGroup", "pgtestsvc4", "role1", armcosmosforpostgresql.Role{ Properties: &armcosmosforpostgresql.RoleProperties{ Password: to.Ptr("password"), }, }, 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.Role = armcosmosforpostgresql.Role{ // Name: to.Ptr("role1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/roles"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/pgtestsvc4/roles/role1"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.RoleProperties{ // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // }, // } }
Output:
func (*RolesClient) BeginDelete ¶
func (client *RolesClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, roleName string, options *RolesClientBeginDeleteOptions) (*runtime.Poller[RolesClientDeleteResponse], error)
BeginDelete - Deletes a cluster role. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- roleName - The name of the cluster role.
- options - RolesClientBeginDeleteOptions contains the optional parameters for the RolesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/RoleDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRolesClient().BeginDelete(ctx, "TestGroup", "pgtestsvc4", "role1", 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 (*RolesClient) Get ¶
func (client *RolesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, roleName string, options *RolesClientGetOptions) (RolesClientGetResponse, error)
Get - Gets information about a cluster role. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- roleName - The name of the cluster role.
- options - RolesClientGetOptions contains the optional parameters for the RolesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/RoleGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRolesClient().Get(ctx, "TestGroup", "pgtestsvc4", "role1", 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.Role = armcosmosforpostgresql.Role{ // Name: to.Ptr("role1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/roles"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/pgtestsvc4/roles/role1"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.RoleProperties{ // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // }, // } }
Output:
func (*RolesClient) NewListByClusterPager ¶
func (client *RolesClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *RolesClientListByClusterOptions) *runtime.Pager[RolesClientListByClusterResponse]
NewListByClusterPager - List all the roles in a given cluster.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - RolesClientListByClusterOptions contains the optional parameters for the RolesClient.NewListByClusterPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/RoleListByCluster.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewRolesClient().NewListByClusterPager("TestGroup", "pgtestsvc4", 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.RoleListResult = armcosmosforpostgresql.RoleListResult{ // Value: []*armcosmosforpostgresql.Role{ // { // Name: to.Ptr("role1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/roles"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/pgtestsvc4/roles/role1"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.RoleProperties{ // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // }, // }, // { // Name: to.Ptr("role2"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/roles"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/pgtestsvc4/roles/role2"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.RoleProperties{ // ProvisioningState: to.Ptr(armcosmosforpostgresql.ProvisioningStateSucceeded), // }, // }}, // } } }
Output:
type RolesClientBeginCreateOptions ¶
type RolesClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RolesClientBeginCreateOptions contains the optional parameters for the RolesClient.BeginCreate method.
type RolesClientBeginDeleteOptions ¶
type RolesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RolesClientBeginDeleteOptions contains the optional parameters for the RolesClient.BeginDelete method.
type RolesClientCreateResponse ¶
type RolesClientCreateResponse struct {
Role
}
RolesClientCreateResponse contains the response from method RolesClient.BeginCreate.
type RolesClientDeleteResponse ¶
type RolesClientDeleteResponse struct { }
RolesClientDeleteResponse contains the response from method RolesClient.BeginDelete.
type RolesClientGetOptions ¶
type RolesClientGetOptions struct { }
RolesClientGetOptions contains the optional parameters for the RolesClient.Get method.
type RolesClientGetResponse ¶
type RolesClientGetResponse struct {
Role
}
RolesClientGetResponse contains the response from method RolesClient.Get.
type RolesClientListByClusterOptions ¶
type RolesClientListByClusterOptions struct { }
RolesClientListByClusterOptions contains the optional parameters for the RolesClient.NewListByClusterPager method.
type RolesClientListByClusterResponse ¶
type RolesClientListByClusterResponse struct {
RoleListResult
}
RolesClientListByClusterResponse contains the response from method RolesClient.NewListByClusterPager.
type ServerConfiguration ¶
type ServerConfiguration struct { // The properties of a configuration. Properties *ServerConfigurationProperties // 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 }
ServerConfiguration - Represents a configuration.
func (ServerConfiguration) MarshalJSON ¶
func (s ServerConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerConfiguration.
func (*ServerConfiguration) UnmarshalJSON ¶
func (s *ServerConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfiguration.
type ServerConfigurationListResult ¶
type ServerConfigurationListResult struct { // The list of server configurations. Value []*ServerConfiguration // READ-ONLY; Link to retrieve next page of results. NextLink *string }
ServerConfigurationListResult - A list of server configurations.
func (ServerConfigurationListResult) MarshalJSON ¶
func (s ServerConfigurationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerConfigurationListResult.
func (*ServerConfigurationListResult) UnmarshalJSON ¶
func (s *ServerConfigurationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfigurationListResult.
type ServerConfigurationProperties ¶
type ServerConfigurationProperties struct { // REQUIRED; Value of the configuration. Value *string // READ-ONLY; Allowed values of the configuration. AllowedValues *string // READ-ONLY; Data type of the configuration. DataType *ConfigurationDataType // READ-ONLY; Default value of the configuration. DefaultValue *string // READ-ONLY; Description of the configuration. Description *string // READ-ONLY; Provisioning state of the configuration. ProvisioningState *ProvisioningState // READ-ONLY; If configuration change requires restart. RequiresRestart *bool // READ-ONLY; Source of the configuration. Source *string }
ServerConfigurationProperties - The properties of a configuration.
func (ServerConfigurationProperties) MarshalJSON ¶
func (s ServerConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerConfigurationProperties.
func (*ServerConfigurationProperties) UnmarshalJSON ¶
func (s *ServerConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfigurationProperties.
type ServerNameItem ¶
type ServerNameItem struct { // The name of a server. Name *string // READ-ONLY; The fully qualified domain name of a server. FullyQualifiedDomainName *string }
ServerNameItem - The name object for a server.
func (ServerNameItem) MarshalJSON ¶
func (s ServerNameItem) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerNameItem.
func (*ServerNameItem) UnmarshalJSON ¶
func (s *ServerNameItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerNameItem.
type ServerRole ¶
type ServerRole string
ServerRole - The role of a server.
const ( ServerRoleCoordinator ServerRole = "Coordinator" ServerRoleWorker ServerRole = "Worker" )
func PossibleServerRoleValues ¶
func PossibleServerRoleValues() []ServerRole
PossibleServerRoleValues returns the possible values for the ServerRole const type.
type ServerRoleGroupConfiguration ¶
type ServerRoleGroupConfiguration struct { // REQUIRED; The role of servers in the server role group. Role *ServerRole // REQUIRED; Value of the configuration. Value *string // READ-ONLY; Default value of the configuration. DefaultValue *string // READ-ONLY; Source of the configuration. Source *string }
ServerRoleGroupConfiguration - Represents server role group configuration value.
func (ServerRoleGroupConfiguration) MarshalJSON ¶
func (s ServerRoleGroupConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerRoleGroupConfiguration.
func (*ServerRoleGroupConfiguration) UnmarshalJSON ¶
func (s *ServerRoleGroupConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerRoleGroupConfiguration.
type ServersClient ¶
type ServersClient struct {
// contains filtered or unexported fields
}
ServersClient contains the methods for the Servers group. Don't use this type directly, use NewServersClient() instead.
func NewServersClient ¶
func NewServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServersClient, error)
NewServersClient creates a new instance of ServersClient with the specified values.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ServersClient) Get ¶
func (client *ServersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, serverName string, options *ServersClientGetOptions) (ServersClientGetResponse, error)
Get - Gets information about a server in cluster. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- serverName - The name of the server.
- options - ServersClientGetOptions contains the optional parameters for the ServersClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ServerGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewServersClient().Get(ctx, "TestGroup", "testcluster1", "testcluster1-c", 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.ClusterServer = armcosmosforpostgresql.ClusterServer{ // Name: to.Ptr("testcluster1-c"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster1/servers/testcluster1-c"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ClusterServerProperties{ // AdministratorLogin: to.Ptr("citus"), // EnableHa: to.Ptr(true), // EnablePublicIPAccess: to.Ptr(true), // IsReadOnly: to.Ptr(false), // ServerEdition: to.Ptr("MemoryOptimized"), // StorageQuotaInMb: to.Ptr[int32](10000), // VCores: to.Ptr[int32](4), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr("9.5"), // FullyQualifiedDomainName: to.Ptr("testcluster1-c.postgres.database.azure.com"), // HaState: to.Ptr("Healthy"), // PostgresqlVersion: to.Ptr("12"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleCoordinator), // State: to.Ptr("Ready"), // }, // } }
Output:
func (*ServersClient) NewListByClusterPager ¶
func (client *ServersClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *ServersClientListByClusterOptions) *runtime.Pager[ServersClientListByClusterResponse]
NewListByClusterPager - Lists servers of a cluster.
Generated from API version 2022-11-08
- resourceGroupName - The name of the resource group. The name is case insensitive.
- clusterName - The name of the cluster.
- options - ServersClientListByClusterOptions contains the optional parameters for the ServersClient.NewListByClusterPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ServerListByCluster.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmosforpostgresql/armcosmosforpostgresql" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcosmosforpostgresql.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewServersClient().NewListByClusterPager("TestGroup", "testcluster1", 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.ClusterServerListResult = armcosmosforpostgresql.ClusterServerListResult{ // Value: []*armcosmosforpostgresql.ClusterServer{ // { // Name: to.Ptr("testcluster1-c"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster1/servers/testcluster1-c"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ClusterServerProperties{ // AdministratorLogin: to.Ptr("citus"), // EnableHa: to.Ptr(true), // EnablePublicIPAccess: to.Ptr(true), // IsReadOnly: to.Ptr(false), // ServerEdition: to.Ptr("MemoryOptimized"), // StorageQuotaInMb: to.Ptr[int32](10000), // VCores: to.Ptr[int32](4), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr("9.5"), // FullyQualifiedDomainName: to.Ptr("testcluster1-c.postgres.database.azure.com"), // HaState: to.Ptr("Healthy"), // PostgresqlVersion: to.Ptr("12"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleCoordinator), // State: to.Ptr("Ready"), // }, // }, // { // Name: to.Ptr("testcluster1-w0"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster1/servers/testcluster1-w0"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ClusterServerProperties{ // AdministratorLogin: to.Ptr("citus"), // EnableHa: to.Ptr(false), // EnablePublicIPAccess: to.Ptr(false), // IsReadOnly: to.Ptr(false), // ServerEdition: to.Ptr("MemoryOptimized"), // StorageQuotaInMb: to.Ptr[int32](10000), // VCores: to.Ptr[int32](4), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr("9.5"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w0.postgres.database.azure.com"), // HaState: to.Ptr("NotEnabled"), // PostgresqlVersion: to.Ptr("12"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleWorker), // State: to.Ptr("Ready"), // }, // }, // { // Name: to.Ptr("testcluster1-w1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster1/servers/testcluster1-w1"), // SystemData: &armcosmosforpostgresql.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armcosmosforpostgresql.CreatedByTypeUser), // }, // Properties: &armcosmosforpostgresql.ClusterServerProperties{ // AdministratorLogin: to.Ptr("citus"), // EnableHa: to.Ptr(false), // EnablePublicIPAccess: to.Ptr(false), // IsReadOnly: to.Ptr(false), // ServerEdition: to.Ptr("MemoryOptimized"), // StorageQuotaInMb: to.Ptr[int32](10000), // VCores: to.Ptr[int32](4), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr("9.5"), // FullyQualifiedDomainName: to.Ptr("testcluster1-w1.postgres.database.azure.com"), // HaState: to.Ptr("NotEnabled"), // PostgresqlVersion: to.Ptr("12"), // Role: to.Ptr(armcosmosforpostgresql.ServerRoleWorker), // State: to.Ptr("Ready"), // }, // }}, // } } }
Output:
type ServersClientGetOptions ¶
type ServersClientGetOptions struct { }
ServersClientGetOptions contains the optional parameters for the ServersClient.Get method.
type ServersClientGetResponse ¶
type ServersClientGetResponse struct {
ClusterServer
}
ServersClientGetResponse contains the response from method ServersClient.Get.
type ServersClientListByClusterOptions ¶
type ServersClientListByClusterOptions struct { }
ServersClientListByClusterOptions contains the optional parameters for the ServersClient.NewListByClusterPager method.
type ServersClientListByClusterResponse ¶
type ServersClientListByClusterResponse struct {
ClusterServerListResult
}
ServersClientListByClusterResponse contains the response from method ServersClient.NewListByClusterPager.
type SimplePrivateEndpointConnection ¶
type SimplePrivateEndpointConnection struct { // Properties of the private endpoint connection. Properties *PrivateEndpointConnectionSimpleProperties // 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 }
SimplePrivateEndpointConnection - A private endpoint connection.
func (SimplePrivateEndpointConnection) MarshalJSON ¶
func (s SimplePrivateEndpointConnection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SimplePrivateEndpointConnection.
func (*SimplePrivateEndpointConnection) UnmarshalJSON ¶
func (s *SimplePrivateEndpointConnection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SimplePrivateEndpointConnection.
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.