Documentation
¶
Index ¶
- type CitusVersion
- type ClientFactory
- func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient
- func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient
- func (c *ClientFactory) NewOperationsClient() *OperationsClient
- func (c *ClientFactory) NewRolesClient() *RolesClient
- func (c *ClientFactory) NewServerGroupsClient() *ServerGroupsClient
- func (c *ClientFactory) NewServersClient() *ServersClient
- type ConfigurationDataType
- type ConfigurationsClient
- func (client *ConfigurationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (*runtime.Poller[ConfigurationsClientUpdateResponse], error)
- func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (ConfigurationsClientGetResponse, error)
- func (client *ConfigurationsClient) NewListByServerGroupPager(resourceGroupName string, serverGroupName string, ...) *runtime.Pager[ConfigurationsClientListByServerGroupResponse]
- func (client *ConfigurationsClient) NewListByServerPager(resourceGroupName string, serverGroupName string, serverName string, ...) *runtime.Pager[ConfigurationsClientListByServerResponse]
- type ConfigurationsClientBeginUpdateOptions
- type ConfigurationsClientGetOptions
- type ConfigurationsClientGetResponse
- type ConfigurationsClientListByServerGroupOptions
- type ConfigurationsClientListByServerGroupResponse
- type ConfigurationsClientListByServerOptions
- type ConfigurationsClientListByServerResponse
- type ConfigurationsClientUpdateResponse
- type CreateMode
- type CreatedByType
- type FirewallRule
- type FirewallRuleListResult
- type FirewallRuleProperties
- type FirewallRulesClient
- func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (*runtime.Poller[FirewallRulesClientCreateOrUpdateResponse], error)
- func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (*runtime.Poller[FirewallRulesClientDeleteResponse], error)
- func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (FirewallRulesClientGetResponse, error)
- func (client *FirewallRulesClient) NewListByServerGroupPager(resourceGroupName string, serverGroupName string, ...) *runtime.Pager[FirewallRulesClientListByServerGroupResponse]
- type FirewallRulesClientBeginCreateOrUpdateOptions
- type FirewallRulesClientBeginDeleteOptions
- type FirewallRulesClientCreateOrUpdateResponse
- type FirewallRulesClientDeleteResponse
- type FirewallRulesClientGetOptions
- type FirewallRulesClientGetResponse
- type FirewallRulesClientListByServerGroupOptions
- type FirewallRulesClientListByServerGroupResponse
- type MaintenanceWindow
- type NameAvailability
- type NameAvailabilityRequest
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationOrigin
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type PostgreSQLVersion
- type ProxyResource
- type Resource
- type ResourceProviderType
- type Role
- type RoleListResult
- type RoleProperties
- type RolesClient
- func (client *RolesClient) BeginCreate(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (*runtime.Poller[RolesClientCreateResponse], error)
- func (client *RolesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (*runtime.Poller[RolesClientDeleteResponse], error)
- func (client *RolesClient) NewListByServerGroupPager(resourceGroupName string, serverGroupName string, ...) *runtime.Pager[RolesClientListByServerGroupResponse]
- type RolesClientBeginCreateOptions
- type RolesClientBeginDeleteOptions
- type RolesClientCreateResponse
- type RolesClientDeleteResponse
- type RolesClientListByServerGroupOptions
- type RolesClientListByServerGroupResponse
- type ServerConfiguration
- type ServerConfigurationListResult
- type ServerConfigurationProperties
- type ServerEdition
- type ServerGroup
- type ServerGroupConfiguration
- type ServerGroupConfigurationListResult
- type ServerGroupConfigurationProperties
- type ServerGroupForUpdate
- type ServerGroupListResult
- type ServerGroupProperties
- type ServerGroupPropertiesDelegatedSubnetArguments
- type ServerGroupPropertiesForUpdate
- type ServerGroupPropertiesPrivateDNSZoneArguments
- type ServerGroupServer
- type ServerGroupServerListResult
- type ServerGroupServerProperties
- type ServerGroupsClient
- func (client *ServerGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (*runtime.Poller[ServerGroupsClientCreateOrUpdateResponse], error)
- func (client *ServerGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (*runtime.Poller[ServerGroupsClientDeleteResponse], error)
- func (client *ServerGroupsClient) BeginRestart(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (*runtime.Poller[ServerGroupsClientRestartResponse], error)
- func (client *ServerGroupsClient) BeginStart(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (*runtime.Poller[ServerGroupsClientStartResponse], error)
- func (client *ServerGroupsClient) BeginStop(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (*runtime.Poller[ServerGroupsClientStopResponse], error)
- func (client *ServerGroupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (*runtime.Poller[ServerGroupsClientUpdateResponse], error)
- func (client *ServerGroupsClient) CheckNameAvailability(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest, ...) (ServerGroupsClientCheckNameAvailabilityResponse, error)
- func (client *ServerGroupsClient) Get(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (ServerGroupsClientGetResponse, error)
- func (client *ServerGroupsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[ServerGroupsClientListByResourceGroupResponse]
- func (client *ServerGroupsClient) NewListPager(options *ServerGroupsClientListOptions) *runtime.Pager[ServerGroupsClientListResponse]
- type ServerGroupsClientBeginCreateOrUpdateOptions
- type ServerGroupsClientBeginDeleteOptions
- type ServerGroupsClientBeginRestartOptions
- type ServerGroupsClientBeginStartOptions
- type ServerGroupsClientBeginStopOptions
- type ServerGroupsClientBeginUpdateOptions
- type ServerGroupsClientCheckNameAvailabilityOptions
- type ServerGroupsClientCheckNameAvailabilityResponse
- type ServerGroupsClientCreateOrUpdateResponse
- type ServerGroupsClientDeleteResponse
- type ServerGroupsClientGetOptions
- type ServerGroupsClientGetResponse
- type ServerGroupsClientListByResourceGroupOptions
- type ServerGroupsClientListByResourceGroupResponse
- type ServerGroupsClientListOptions
- type ServerGroupsClientListResponse
- type ServerGroupsClientRestartResponse
- type ServerGroupsClientStartResponse
- type ServerGroupsClientStopResponse
- type ServerGroupsClientUpdateResponse
- type ServerHaState
- type ServerNameItem
- type ServerProperties
- type ServerRole
- type ServerRoleGroup
- type ServerRoleGroupConfiguration
- type ServerState
- type ServersClient
- func (client *ServersClient) Get(ctx context.Context, resourceGroupName string, serverGroupName string, ...) (ServersClientGetResponse, error)
- func (client *ServersClient) NewListByServerGroupPager(resourceGroupName string, serverGroupName string, ...) *runtime.Pager[ServersClientListByServerGroupResponse]
- type ServersClientGetOptions
- type ServersClientGetResponse
- type ServersClientListByServerGroupOptions
- type ServersClientListByServerGroupResponse
- type SystemData
- type TrackedResource
Examples ¶
- ConfigurationsClient.BeginUpdate
- ConfigurationsClient.Get
- ConfigurationsClient.NewListByServerGroupPager
- ConfigurationsClient.NewListByServerPager
- FirewallRulesClient.BeginCreateOrUpdate
- FirewallRulesClient.BeginDelete
- FirewallRulesClient.Get
- FirewallRulesClient.NewListByServerGroupPager
- OperationsClient.NewListPager
- RolesClient.BeginCreate
- RolesClient.BeginDelete
- RolesClient.NewListByServerGroupPager
- ServerGroupsClient.BeginCreateOrUpdate (CreateANewServerGroup)
- ServerGroupsClient.BeginCreateOrUpdate (CreateANewServerGroupAsAPointInTimeRestore)
- ServerGroupsClient.BeginCreateOrUpdate (CreateANewServerGroupAsAReadReplica)
- ServerGroupsClient.BeginDelete
- ServerGroupsClient.BeginRestart
- ServerGroupsClient.BeginStart
- ServerGroupsClient.BeginStop
- ServerGroupsClient.BeginUpdate (AddNewWorkerNodes)
- ServerGroupsClient.BeginUpdate (ScaleCompute)
- ServerGroupsClient.BeginUpdate (ScaleStorage)
- ServerGroupsClient.BeginUpdate (UpdateCustomerMaintenanceWindow)
- ServerGroupsClient.BeginUpdate (UpdateTheServerGroup)
- ServerGroupsClient.CheckNameAvailability
- ServerGroupsClient.Get
- ServerGroupsClient.NewListByResourceGroupPager
- ServerGroupsClient.NewListPager
- ServersClient.Get
- ServersClient.NewListByServerGroupPager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CitusVersion ¶
type CitusVersion string
CitusVersion - The Citus version.
const ( CitusVersionEight3 CitusVersion = "8.3" CitusVersionNine0 CitusVersion = "9.0" CitusVersionNine1 CitusVersion = "9.1" CitusVersionNine2 CitusVersion = "9.2" CitusVersionNine3 CitusVersion = "9.3" CitusVersionNine4 CitusVersion = "9.4" CitusVersionNine5 CitusVersion = "9.5" )
func PossibleCitusVersionValues ¶
func PossibleCitusVersionValues() []CitusVersion
PossibleCitusVersionValues returns the possible values for the CitusVersion const type.
type ClientFactory ¶ added in v0.6.0
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶ added in v0.6.0
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewConfigurationsClient ¶ added in v0.6.0
func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient
func (*ClientFactory) NewFirewallRulesClient ¶ added in v0.6.0
func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient
func (*ClientFactory) NewOperationsClient ¶ added in v0.6.0
func (c *ClientFactory) NewOperationsClient() *OperationsClient
func (*ClientFactory) NewRolesClient ¶ added in v0.6.0
func (c *ClientFactory) NewRolesClient() *RolesClient
func (*ClientFactory) NewServerGroupsClient ¶ added in v0.6.0
func (c *ClientFactory) NewServerGroupsClient() *ServerGroupsClient
func (*ClientFactory) NewServersClient ¶ added in v0.6.0
func (c *ClientFactory) NewServersClient() *ServersClient
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 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.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ConfigurationsClient) BeginUpdate ¶
func (client *ConfigurationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverGroupName string, configurationName string, parameters ServerGroupConfiguration, options *ConfigurationsClientBeginUpdateOptions) (*runtime.Poller[ConfigurationsClientUpdateResponse], error)
BeginUpdate - Updates configuration of server role groups in a server group If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- configurationName - The name of the server group configuration.
- parameters - The required parameters for updating a server group configuration.
- options - ConfigurationsClientBeginUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ConfigurationUpdate.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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewConfigurationsClient().BeginUpdate(ctx, "TestResourceGroup", "hsctestsg", "array_nulls", armpostgresqlhsc.ServerGroupConfiguration{ Properties: &armpostgresqlhsc.ServerGroupConfigurationProperties{ ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{ { Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), Value: to.Ptr("on"), }, { Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), 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.ServerGroupConfiguration = armpostgresqlhsc.ServerGroupConfiguration{ // 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/hsctestsg/configurations/array_nulls"), // Properties: &armpostgresqlhsc.ServerGroupConfigurationProperties{ // ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{ // { // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // Value: to.Ptr("on"), // }, // { // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // Value: to.Ptr("off"), // }}, // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
func (*ConfigurationsClient) Get ¶
func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverGroupName string, configurationName string, options *ConfigurationsClientGetOptions) (ConfigurationsClientGetResponse, error)
Get - Gets information about single server group configuration. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- configurationName - The name of the server group 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewConfigurationsClient().Get(ctx, "TestResourceGroup", "hsctestsg", "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.ServerGroupConfiguration = armpostgresqlhsc.ServerGroupConfiguration{ // 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/hsctestsg/configurations/array_nulls"), // Properties: &armpostgresqlhsc.ServerGroupConfigurationProperties{ // Description: to.Ptr("Enable input of NULL elements in arrays."), // AllowedValues: to.Ptr("on,off"), // DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataTypeBoolean), // ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{ // { // DefaultValue: to.Ptr("on"), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // Source: to.Ptr("system-default"), // Value: to.Ptr("on"), // }, // { // DefaultValue: to.Ptr("on"), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // Source: to.Ptr("user-override"), // Value: to.Ptr("off"), // }}, // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
func (*ConfigurationsClient) NewListByServerGroupPager ¶ added in v0.4.0
func (client *ConfigurationsClient) NewListByServerGroupPager(resourceGroupName string, serverGroupName string, options *ConfigurationsClientListByServerGroupOptions) *runtime.Pager[ConfigurationsClientListByServerGroupResponse]
NewListByServerGroupPager - List all the configurations of a server group.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- options - ConfigurationsClientListByServerGroupOptions contains the optional parameters for the ConfigurationsClient.NewListByServerGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ConfigurationListByServerGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewConfigurationsClient().NewListByServerGroupPager("TestResourceGroup", "hsctestsg", 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.ServerGroupConfigurationListResult = armpostgresqlhsc.ServerGroupConfigurationListResult{ // Value: []*armpostgresqlhsc.ServerGroupConfiguration{ // { // 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/hsctestsg/configurations/array_nulls"), // Properties: &armpostgresqlhsc.ServerGroupConfigurationProperties{ // Description: to.Ptr("Enable input of NULL elements in arrays."), // AllowedValues: to.Ptr("on,off"), // DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataTypeBoolean), // ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{ // { // DefaultValue: to.Ptr("on"), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // Source: to.Ptr("system-default"), // Value: to.Ptr("on"), // }, // { // DefaultValue: to.Ptr("on"), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // Source: to.Ptr("user-override"), // Value: to.Ptr("off"), // }}, // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // 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/hsctestsg/configurations/backslash_quote"), // Properties: &armpostgresqlhsc.ServerGroupConfigurationProperties{ // Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."), // AllowedValues: to.Ptr("safe_encoding,on,off"), // DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataTypeEnumeration), // ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{ // { // DefaultValue: to.Ptr("safe_encoding"), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // Source: to.Ptr("user-override"), // Value: to.Ptr("off"), // }, // { // DefaultValue: to.Ptr("safe_encoding"), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // Source: to.Ptr("system-default"), // Value: to.Ptr("safe_encoding"), // }}, // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // 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/hsctestsg/configurations/work_mem"), // Properties: &armpostgresqlhsc.ServerGroupConfigurationProperties{ // 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(armpostgresqlhsc.ConfigurationDataTypeInteger), // ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{ // { // DefaultValue: to.Ptr("158720"), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // Source: to.Ptr("system-default"), // Value: to.Ptr("158720"), // }, // { // DefaultValue: to.Ptr("115712"), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // Source: to.Ptr("system-default"), // Value: to.Ptr("115712"), // }}, // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // 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/hsctestsg/configurations/client_encoding"), // Properties: &armpostgresqlhsc.ServerGroupConfigurationProperties{ // 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(armpostgresqlhsc.ConfigurationDataTypeEnumeration), // ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{ // { // DefaultValue: to.Ptr("sql_ascii"), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // Source: to.Ptr("user-override"), // Value: to.Ptr("ISO_8859_7"), // }, // { // DefaultValue: to.Ptr("sql_ascii"), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // Source: to.Ptr("user-override"), // Value: to.Ptr("ISO_8859_7"), // }}, // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }}, // } } }
Output:
func (*ConfigurationsClient) NewListByServerPager ¶ added in v0.4.0
func (client *ConfigurationsClient) NewListByServerPager(resourceGroupName string, serverGroupName string, serverName string, options *ConfigurationsClientListByServerOptions) *runtime.Pager[ConfigurationsClientListByServerResponse]
NewListByServerPager - List all the configurations of a server in server group.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewConfigurationsClient().NewListByServerPager("TestResourceGroup", "hsctestsg", "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 = armpostgresqlhsc.ServerConfigurationListResult{ // Value: []*armpostgresqlhsc.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/hsctestsg/servers/testserver/configurations/application_name"), // Properties: &armpostgresqlhsc.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(armpostgresqlhsc.ConfigurationDataType("String")), // DefaultValue: to.Ptr(""), // Source: to.Ptr("system-default"), // Value: to.Ptr(""), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // 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/hsctestsg/servers/testserver/configurations/array_nulls"), // Properties: &armpostgresqlhsc.ServerConfigurationProperties{ // Description: to.Ptr("Enables input of NULL elements in arrays."), // AllowedValues: to.Ptr("on,off"), // DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataTypeBoolean), // DefaultValue: to.Ptr("on"), // Source: to.Ptr("system-default"), // Value: to.Ptr("on"), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // 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/hsctestsg/servers/testserver/configurations/autovacuum"), // Properties: &armpostgresqlhsc.ServerConfigurationProperties{ // Description: to.Ptr("Starts the autovacuum subprocess."), // AllowedValues: to.Ptr("on,off"), // DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataTypeBoolean), // DefaultValue: to.Ptr("on"), // Source: to.Ptr("system-default"), // Value: to.Ptr("on"), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }}, // } } }
Output:
type ConfigurationsClientBeginUpdateOptions ¶ added in v0.2.0
type ConfigurationsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ConfigurationsClientBeginUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginUpdate method.
type ConfigurationsClientGetOptions ¶ added in v0.2.0
type ConfigurationsClientGetOptions struct { }
ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method.
type ConfigurationsClientGetResponse ¶ added in v0.2.0
type ConfigurationsClientGetResponse struct {
ServerGroupConfiguration
}
ConfigurationsClientGetResponse contains the response from method ConfigurationsClient.Get.
type ConfigurationsClientListByServerGroupOptions ¶ added in v0.2.0
type ConfigurationsClientListByServerGroupOptions struct { }
ConfigurationsClientListByServerGroupOptions contains the optional parameters for the ConfigurationsClient.NewListByServerGroupPager method.
type ConfigurationsClientListByServerGroupResponse ¶ added in v0.2.0
type ConfigurationsClientListByServerGroupResponse struct {
ServerGroupConfigurationListResult
}
ConfigurationsClientListByServerGroupResponse contains the response from method ConfigurationsClient.NewListByServerGroupPager.
type ConfigurationsClientListByServerOptions ¶ added in v0.2.0
type ConfigurationsClientListByServerOptions struct { }
ConfigurationsClientListByServerOptions contains the optional parameters for the ConfigurationsClient.NewListByServerPager method.
type ConfigurationsClientListByServerResponse ¶ added in v0.2.0
type ConfigurationsClientListByServerResponse struct {
ServerConfigurationListResult
}
ConfigurationsClientListByServerResponse contains the response from method ConfigurationsClient.NewListByServerPager.
type ConfigurationsClientUpdateResponse ¶ added in v0.2.0
type ConfigurationsClientUpdateResponse struct {
ServerGroupConfiguration
}
ConfigurationsClientUpdateResponse contains the response from method ConfigurationsClient.BeginUpdate.
type CreateMode ¶
type CreateMode string
CreateMode - The mode to create a new server group.
const ( CreateModeDefault CreateMode = "Default" CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" CreateModeReadReplica CreateMode = "ReadReplica" )
func PossibleCreateModeValues ¶
func PossibleCreateModeValues() []CreateMode
PossibleCreateModeValues returns the possible values for the CreateMode const type.
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 `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The system metadata relating to this resource SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
FirewallRule - Represents a server group firewall rule.
func (FirewallRule) MarshalJSON ¶
func (f FirewallRule) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FirewallRule.
func (*FirewallRule) UnmarshalJSON ¶ added in v0.6.0
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 server group. Value []*FirewallRule `json:"value,omitempty"` }
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 ¶ added in v0.6.0
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 server group firewall rule. Must be IPv4 format. EndIPAddress *string `json:"endIpAddress,omitempty"` // REQUIRED; The start IP address of the server group firewall rule. Must be IPv4 format. StartIPAddress *string `json:"startIpAddress,omitempty"` }
FirewallRuleProperties - The properties of a server group firewall rule.
func (FirewallRuleProperties) MarshalJSON ¶ added in v0.6.0
func (f FirewallRuleProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FirewallRuleProperties.
func (*FirewallRuleProperties) UnmarshalJSON ¶ added in v0.6.0
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.
- 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, serverGroupName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[FirewallRulesClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Creates a new firewall rule or updates an existing firewall rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- firewallRuleName - The name of the server group 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.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", armpostgresqlhsc.FirewallRule{ Properties: &armpostgresqlhsc.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 = armpostgresqlhsc.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"), // Properties: &armpostgresqlhsc.FirewallRuleProperties{ // EndIPAddress: to.Ptr("255.255.255.255"), // StartIPAddress: to.Ptr("0.0.0.0"), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
func (*FirewallRulesClient) BeginDelete ¶
func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverGroupName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*runtime.Poller[FirewallRulesClientDeleteResponse], error)
BeginDelete - Deletes a server group firewall rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- firewallRuleName - The name of the server group 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.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, serverGroupName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (FirewallRulesClientGetResponse, error)
Get - Gets information about a server group firewall rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- firewallRuleName - The name of the server group 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.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 = armpostgresqlhsc.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"), // Properties: &armpostgresqlhsc.FirewallRuleProperties{ // EndIPAddress: to.Ptr("255.255.255.255"), // StartIPAddress: to.Ptr("0.0.0.0"), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
func (*FirewallRulesClient) NewListByServerGroupPager ¶ added in v0.4.0
func (client *FirewallRulesClient) NewListByServerGroupPager(resourceGroupName string, serverGroupName string, options *FirewallRulesClientListByServerGroupOptions) *runtime.Pager[FirewallRulesClientListByServerGroupResponse]
NewListByServerGroupPager - List all the firewall rules in a given server group.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- options - FirewallRulesClientListByServerGroupOptions contains the optional parameters for the FirewallRulesClient.NewListByServerGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/FirewallRuleListByServerGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewFirewallRulesClient().NewListByServerGroupPager("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 = armpostgresqlhsc.FirewallRuleListResult{ // Value: []*armpostgresqlhsc.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"), // Properties: &armpostgresqlhsc.FirewallRuleProperties{ // EndIPAddress: to.Ptr("255.255.255.255"), // StartIPAddress: to.Ptr("0.0.0.0"), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // 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"), // Properties: &armpostgresqlhsc.FirewallRuleProperties{ // EndIPAddress: to.Ptr("255.0.0.0"), // StartIPAddress: to.Ptr("1.0.0.0"), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }}, // } } }
Output:
type FirewallRulesClientBeginCreateOrUpdateOptions ¶ added in v0.2.0
type FirewallRulesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
FirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.BeginCreateOrUpdate method.
type FirewallRulesClientBeginDeleteOptions ¶ added in v0.2.0
type FirewallRulesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
FirewallRulesClientBeginDeleteOptions contains the optional parameters for the FirewallRulesClient.BeginDelete method.
type FirewallRulesClientCreateOrUpdateResponse ¶ added in v0.2.0
type FirewallRulesClientCreateOrUpdateResponse struct {
FirewallRule
}
FirewallRulesClientCreateOrUpdateResponse contains the response from method FirewallRulesClient.BeginCreateOrUpdate.
type FirewallRulesClientDeleteResponse ¶ added in v0.2.0
type FirewallRulesClientDeleteResponse struct { }
FirewallRulesClientDeleteResponse contains the response from method FirewallRulesClient.BeginDelete.
type FirewallRulesClientGetOptions ¶ added in v0.2.0
type FirewallRulesClientGetOptions struct { }
FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method.
type FirewallRulesClientGetResponse ¶ added in v0.2.0
type FirewallRulesClientGetResponse struct {
FirewallRule
}
FirewallRulesClientGetResponse contains the response from method FirewallRulesClient.Get.
type FirewallRulesClientListByServerGroupOptions ¶ added in v0.2.0
type FirewallRulesClientListByServerGroupOptions struct { }
FirewallRulesClientListByServerGroupOptions contains the optional parameters for the FirewallRulesClient.NewListByServerGroupPager method.
type FirewallRulesClientListByServerGroupResponse ¶ added in v0.2.0
type FirewallRulesClientListByServerGroupResponse struct {
FirewallRuleListResult
}
FirewallRulesClientListByServerGroupResponse contains the response from method FirewallRulesClient.NewListByServerGroupPager.
type MaintenanceWindow ¶
type MaintenanceWindow struct { // indicates whether custom window is enabled or disabled CustomWindow *string `json:"customWindow,omitempty"` // day of week for maintenance window DayOfWeek *int32 `json:"dayOfWeek,omitempty"` // start hour for maintenance window StartHour *int32 `json:"startHour,omitempty"` // start minute for maintenance window StartMinute *int32 `json:"startMinute,omitempty"` }
MaintenanceWindow - Maintenance window of a server group.
func (MaintenanceWindow) MarshalJSON ¶ added in v0.6.0
func (m MaintenanceWindow) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MaintenanceWindow.
func (*MaintenanceWindow) UnmarshalJSON ¶ added in v0.6.0
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 `json:"message,omitempty"` // name of the PostgreSQL server. Name *string `json:"name,omitempty"` // Indicates whether the resource name is available. NameAvailable *bool `json:"nameAvailable,omitempty"` // type of the server Type *string `json:"type,omitempty"` }
NameAvailability - Represents a resource name availability.
func (NameAvailability) MarshalJSON ¶ added in v0.6.0
func (n NameAvailability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NameAvailability.
func (*NameAvailability) UnmarshalJSON ¶ added in v0.6.0
func (n *NameAvailability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailability.
type NameAvailabilityRequest ¶
type NameAvailabilityRequest struct { // REQUIRED; Resource name to verify. Name *string `json:"name,omitempty"` // CONSTANT; Resource type used for verification. // Field has constant value "Microsoft.DBforPostgreSQL/serverGroupsv2", any specified value is ignored. Type *string `json:"type,omitempty"` }
NameAvailabilityRequest - Request from client to check resource name availability.
func (NameAvailabilityRequest) MarshalJSON ¶ added in v0.6.0
func (n NameAvailabilityRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NameAvailabilityRequest.
func (*NameAvailabilityRequest) UnmarshalJSON ¶ added in v0.6.0
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 `json:"isDataAction,omitempty"` // READ-ONLY; The localized display information for this particular operation or action. Display *OperationDisplay `json:"display,omitempty" azure:"ro"` // READ-ONLY; The name of the operation being performed on this particular object. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The intended executor of the operation. Origin *OperationOrigin `json:"origin,omitempty" azure:"ro"` // READ-ONLY; Additional descriptions for the operation. Properties map[string]any `json:"properties,omitempty" azure:"ro"` }
Operation - REST API operation definition.
func (Operation) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct { // READ-ONLY; Operation description. Description *string `json:"description,omitempty" azure:"ro"` // READ-ONLY; Localized friendly name for the operation. Operation *string `json:"operation,omitempty" azure:"ro"` // READ-ONLY; Operation resource provider name. Provider *string `json:"provider,omitempty" azure:"ro"` // READ-ONLY; Resource on which the operation is performed. Resource *string `json:"resource,omitempty" azure:"ro"` }
OperationDisplay - Display metadata associated with the operation.
func (OperationDisplay) MarshalJSON ¶ added in v0.6.0
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationListResult ¶
type OperationListResult struct { // Collection of available operation details Value []*Operation `json:"value,omitempty"` // 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 `json:"nextLink,omitempty" azure:"ro"` }
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 ¶ added in v0.6.0
func (o *OperationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
type OperationOrigin ¶
type OperationOrigin string
OperationOrigin - The intended executor of the operation.
const ( 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 ¶ added in v0.4.0
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - Lists all of the available REST API operations.
Generated from API version 2020-10-05-privatepreview
- 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.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 = armpostgresqlhsc.OperationListResult{ // Value: []*armpostgresqlhsc.Operation{ // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/read"), // Display: &armpostgresqlhsc.OperationDisplay{ // Description: to.Ptr("Return the list of server groups or gets the properties for the specified server group."), // Operation: to.Ptr("List/Get PostgreSQL Server Groups"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("PostgreSQL Server Group"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/write"), // Display: &armpostgresqlhsc.OperationDisplay{ // Description: to.Ptr("Creates a server group with the specified parameters or update the properties or tags for the specified server group."), // Operation: to.Ptr("Create/Update PostgreSQL Server Group"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("PostgreSQL Server Group"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/delete"), // Display: &armpostgresqlhsc.OperationDisplay{ // Description: to.Ptr("Deletes an existing server group."), // Operation: to.Ptr("Delete PostgreSQL Server Group"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("PostgreSQL Server Grouo"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers/read"), // Display: &armpostgresqlhsc.OperationDisplay{ // Description: to.Ptr("Return the list of servers of server group or gets the properties for the specified server from server group."), // Operation: to.Ptr("List/Get PostgreSQL Servers of Server Group"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("PostgreSQL Server"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers/configurations/read"), // Display: &armpostgresqlhsc.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: &armpostgresqlhsc.OperationDisplay{ // Description: to.Ptr("Return the list of configurations for a server group or gets the value for the specified configuration."), // Operation: to.Ptr("List/Get Configurations of Server Group"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("Configurations"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations/write"), // Display: &armpostgresqlhsc.OperationDisplay{ // Description: to.Ptr("Update an value of configurations."), // Operation: to.Ptr("Update Configurations of Server Group"), // Provider: to.Ptr("Microsoft DB for PostgreSQL"), // Resource: to.Ptr("Configurations"), // }, // }, // { // Name: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/firewallRules/read"), // Display: &armpostgresqlhsc.OperationDisplay{ // Description: to.Ptr("Return the list of firewall rules for a server group 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: &armpostgresqlhsc.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: &armpostgresqlhsc.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: &armpostgresqlhsc.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: &armpostgresqlhsc.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: &armpostgresqlhsc.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 ¶ added in v0.2.0
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
type OperationsClientListResponse ¶ added in v0.2.0
type OperationsClientListResponse struct {
OperationListResult
}
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type PostgreSQLVersion ¶
type PostgreSQLVersion string
PostgreSQLVersion - The PostgreSQL version.
const ( PostgreSQLVersionEleven PostgreSQLVersion = "11" PostgreSQLVersionTwelve PostgreSQLVersion = "12" )
func PossiblePostgreSQLVersionValues ¶
func PossiblePostgreSQLVersionValues() []PostgreSQLVersion
PossiblePostgreSQLVersionValues returns the possible values for the PostgreSQLVersion const type.
type ProxyResource ¶
type ProxyResource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location
func (ProxyResource) MarshalJSON ¶ added in v0.6.0
func (p ProxyResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProxyResource.
func (*ProxyResource) UnmarshalJSON ¶ added in v0.6.0
func (p *ProxyResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.
type Resource ¶
type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
Resource - Common fields that are returned in the response for all Azure Resource Manager resources
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
type ResourceProviderType ¶
type ResourceProviderType string
ResourceProviderType - The resource provider type of server group.
const ( ResourceProviderTypeMarlin ResourceProviderType = "Marlin" ResourceProviderTypeMeru ResourceProviderType = "Meru" )
func PossibleResourceProviderTypeValues ¶
func PossibleResourceProviderTypeValues() []ResourceProviderType
PossibleResourceProviderTypeValues returns the possible values for the ResourceProviderType const type.
type Role ¶
type Role struct { // The properties of a role. Properties *RoleProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The system metadata relating to this resource SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
Role - Represents a server group role.
func (Role) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Role.
func (*Role) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Role.
type RoleListResult ¶
type RoleListResult struct { // The list of roles in a server group. Value []*Role `json:"value,omitempty"` }
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 ¶ added in v0.6.0
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 server group role. Password *string `json:"password,omitempty"` }
RoleProperties - The properties of a server group role.
func (RoleProperties) MarshalJSON ¶ added in v0.6.0
func (r RoleProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleProperties.
func (*RoleProperties) UnmarshalJSON ¶ added in v0.6.0
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.
- 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, serverGroupName 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 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- roleName - The name of the server group role name.
- 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.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", armpostgresqlhsc.Role{ Properties: &armpostgresqlhsc.RoleProperties{ Password: to.Ptr("secret"), }, }, 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 = armpostgresqlhsc.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"), // Properties: &armpostgresqlhsc.RoleProperties{ // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
func (*RolesClient) BeginDelete ¶
func (client *RolesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverGroupName string, roleName string, options *RolesClientBeginDeleteOptions) (*runtime.Poller[RolesClientDeleteResponse], error)
BeginDelete - Deletes a server group role. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- roleName - The name of the server group role name.
- 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.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) NewListByServerGroupPager ¶ added in v0.4.0
func (client *RolesClient) NewListByServerGroupPager(resourceGroupName string, serverGroupName string, options *RolesClientListByServerGroupOptions) *runtime.Pager[RolesClientListByServerGroupResponse]
NewListByServerGroupPager - List all the roles in a given server group.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- options - RolesClientListByServerGroupOptions contains the optional parameters for the RolesClient.NewListByServerGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/RoleListByServerGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewRolesClient().NewListByServerGroupPager("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 = armpostgresqlhsc.RoleListResult{ // Value: []*armpostgresqlhsc.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"), // Properties: &armpostgresqlhsc.RoleProperties{ // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // 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"), // Properties: &armpostgresqlhsc.RoleProperties{ // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }}, // } } }
Output:
type RolesClientBeginCreateOptions ¶ added in v0.2.0
type RolesClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RolesClientBeginCreateOptions contains the optional parameters for the RolesClient.BeginCreate method.
type RolesClientBeginDeleteOptions ¶ added in v0.2.0
type RolesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RolesClientBeginDeleteOptions contains the optional parameters for the RolesClient.BeginDelete method.
type RolesClientCreateResponse ¶ added in v0.2.0
type RolesClientCreateResponse struct {
Role
}
RolesClientCreateResponse contains the response from method RolesClient.BeginCreate.
type RolesClientDeleteResponse ¶ added in v0.2.0
type RolesClientDeleteResponse struct { }
RolesClientDeleteResponse contains the response from method RolesClient.BeginDelete.
type RolesClientListByServerGroupOptions ¶ added in v0.2.0
type RolesClientListByServerGroupOptions struct { }
RolesClientListByServerGroupOptions contains the optional parameters for the RolesClient.NewListByServerGroupPager method.
type RolesClientListByServerGroupResponse ¶ added in v0.2.0
type RolesClientListByServerGroupResponse struct {
RoleListResult
}
RolesClientListByServerGroupResponse contains the response from method RolesClient.NewListByServerGroupPager.
type ServerConfiguration ¶
type ServerConfiguration struct { // The properties of a configuration. Properties *ServerConfigurationProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The system metadata relating to this resource SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
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 ¶ added in v0.6.0
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 `json:"value,omitempty"` // READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` }
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 ¶ added in v0.6.0
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 `json:"value,omitempty"` // READ-ONLY; Allowed values of the configuration. AllowedValues *string `json:"allowedValues,omitempty" azure:"ro"` // READ-ONLY; Data type of the configuration. DataType *ConfigurationDataType `json:"dataType,omitempty" azure:"ro"` // READ-ONLY; Default value of the configuration. DefaultValue *string `json:"defaultValue,omitempty" azure:"ro"` // READ-ONLY; Description of the configuration. Description *string `json:"description,omitempty" azure:"ro"` // READ-ONLY; Source of the configuration. Source *string `json:"source,omitempty" azure:"ro"` }
ServerConfigurationProperties - The properties of a configuration.
func (ServerConfigurationProperties) MarshalJSON ¶ added in v0.6.0
func (s ServerConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerConfigurationProperties.
func (*ServerConfigurationProperties) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfigurationProperties.
type ServerEdition ¶
type ServerEdition string
ServerEdition - The edition of a server (default: GeneralPurpose).
const ( ServerEditionGeneralPurpose ServerEdition = "GeneralPurpose" ServerEditionMemoryOptimized ServerEdition = "MemoryOptimized" )
func PossibleServerEditionValues ¶
func PossibleServerEditionValues() []ServerEdition
PossibleServerEditionValues returns the possible values for the ServerEdition const type.
type ServerGroup ¶
type ServerGroup struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` // Properties of the server group create. Properties *ServerGroupProperties `json:"properties,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The system metadata relating to this resource SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
ServerGroup - Represents a server group for create.
func (ServerGroup) MarshalJSON ¶
func (s ServerGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroup.
func (*ServerGroup) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroup.
type ServerGroupConfiguration ¶
type ServerGroupConfiguration struct { // The properties of server group configuration. Properties *ServerGroupConfigurationProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The system metadata relating to this resource SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
ServerGroupConfiguration - Represents the configuration list of server role groups in a server group.
func (ServerGroupConfiguration) MarshalJSON ¶
func (s ServerGroupConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupConfiguration.
func (*ServerGroupConfiguration) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroupConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupConfiguration.
type ServerGroupConfigurationListResult ¶
type ServerGroupConfigurationListResult struct { // The list of server group configurations. Value []*ServerGroupConfiguration `json:"value,omitempty"` // READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` }
ServerGroupConfigurationListResult - A list of server group configurations.
func (ServerGroupConfigurationListResult) MarshalJSON ¶
func (s ServerGroupConfigurationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupConfigurationListResult.
func (*ServerGroupConfigurationListResult) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroupConfigurationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupConfigurationListResult.
type ServerGroupConfigurationProperties ¶
type ServerGroupConfigurationProperties struct { // REQUIRED; The list of server role group configuration values. ServerRoleGroupConfigurations []*ServerRoleGroupConfiguration `json:"serverRoleGroupConfigurations,omitempty"` // READ-ONLY; Allowed values of the configuration. AllowedValues *string `json:"allowedValues,omitempty" azure:"ro"` // READ-ONLY; Data type of the configuration. DataType *ConfigurationDataType `json:"dataType,omitempty" azure:"ro"` // READ-ONLY; Description of the configuration. Description *string `json:"description,omitempty" azure:"ro"` }
ServerGroupConfigurationProperties - The properties of server group configuration.
func (ServerGroupConfigurationProperties) MarshalJSON ¶
func (s ServerGroupConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupConfigurationProperties.
func (*ServerGroupConfigurationProperties) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroupConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupConfigurationProperties.
type ServerGroupForUpdate ¶
type ServerGroupForUpdate struct { // The location the resource resides in. Location *string `json:"location,omitempty"` // Properties of the server group. Properties *ServerGroupPropertiesForUpdate `json:"properties,omitempty"` // Application-specific metadata in the form of key-value pairs. Tags map[string]*string `json:"tags,omitempty"` }
ServerGroupForUpdate - Represents a server group for update.
func (ServerGroupForUpdate) MarshalJSON ¶
func (s ServerGroupForUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupForUpdate.
func (*ServerGroupForUpdate) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroupForUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupForUpdate.
type ServerGroupListResult ¶
type ServerGroupListResult struct { // The list of server groups Value []*ServerGroup `json:"value,omitempty"` // READ-ONLY; The link used to get the next page of operations. NextLink *string `json:"nextLink,omitempty" azure:"ro"` }
ServerGroupListResult - A list of server groups.
func (ServerGroupListResult) MarshalJSON ¶
func (s ServerGroupListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupListResult.
func (*ServerGroupListResult) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroupListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupListResult.
type ServerGroupProperties ¶
type ServerGroupProperties struct { // The administrator's login name of servers in server group. Can only be specified when the server is being created (and // is required for creation). AdministratorLogin *string `json:"administratorLogin,omitempty"` // The password of the administrator login. AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` // Availability Zone information of the server group. AvailabilityZone *string `json:"availabilityZone,omitempty"` // The backup retention days for server group. BackupRetentionDays *int32 `json:"backupRetentionDays,omitempty"` // The Citus version of server group. CitusVersion *CitusVersion `json:"citusVersion,omitempty"` // The mode to create a new server group. CreateMode *CreateMode `json:"createMode,omitempty"` // The delegated subnet arguments for a server group. DelegatedSubnetArguments *ServerGroupPropertiesDelegatedSubnetArguments `json:"delegatedSubnetArguments,omitempty"` // If Citus MX is enabled or not for the server group. EnableMx *bool `json:"enableMx,omitempty"` // If shards on coordinator is enabled or not for the server group. EnableShardsOnCoordinator *bool `json:"enableShardsOnCoordinator,omitempty"` // If ZFS compression is enabled or not for the server group. EnableZfs *bool `json:"enableZfs,omitempty"` // Maintenance window of a server group. MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` // Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when 'createMode' is 'PointInTimeRestore' PointInTimeUTC *time.Time `json:"pointInTimeUTC,omitempty"` // The PostgreSQL version of server group. PostgresqlVersion *PostgreSQLVersion `json:"postgresqlVersion,omitempty"` // The private dns zone arguments for a server group. PrivateDNSZoneArguments *ServerGroupPropertiesPrivateDNSZoneArguments `json:"privateDnsZoneArguments,omitempty"` // The list of server role groups. ServerRoleGroups []*ServerRoleGroup `json:"serverRoleGroups,omitempty"` // The source server group location to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'ReadReplica' SourceLocation *string `json:"sourceLocation,omitempty"` // The source resource group name to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'ReadReplica' SourceResourceGroupName *string `json:"sourceResourceGroupName,omitempty"` // The source server group name to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'ReadReplica' SourceServerGroupName *string `json:"sourceServerGroupName,omitempty"` // The source subscription id to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'ReadReplica' SourceSubscriptionID *string `json:"sourceSubscriptionId,omitempty"` // Standby Availability Zone information of the server group. StandbyAvailabilityZone *string `json:"standbyAvailabilityZone,omitempty"` // READ-ONLY; The earliest restore point time (ISO8601 format) for server group. EarliestRestoreTime *time.Time `json:"earliestRestoreTime,omitempty" azure:"ro"` // READ-ONLY; The array of read replica server groups. ReadReplicas []*string `json:"readReplicas,omitempty" azure:"ro"` // READ-ONLY; The resource provider type of server group. ResourceProviderType *ResourceProviderType `json:"resourceProviderType,omitempty" azure:"ro"` // READ-ONLY; The source server group id for read replica server groups. SourceServerGroup *string `json:"sourceServerGroup,omitempty" azure:"ro"` // READ-ONLY; A state of a server group that is visible to user. State *ServerState `json:"state,omitempty" azure:"ro"` }
ServerGroupProperties - The properties used to create a new server group.
func (ServerGroupProperties) MarshalJSON ¶
func (s ServerGroupProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupProperties.
func (*ServerGroupProperties) UnmarshalJSON ¶
func (s *ServerGroupProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupProperties.
type ServerGroupPropertiesDelegatedSubnetArguments ¶
type ServerGroupPropertiesDelegatedSubnetArguments struct { // delegated subnet arm resource id. SubnetArmResourceID *string `json:"subnetArmResourceId,omitempty"` }
ServerGroupPropertiesDelegatedSubnetArguments - The delegated subnet arguments for a server group.
func (ServerGroupPropertiesDelegatedSubnetArguments) MarshalJSON ¶ added in v0.6.0
func (s ServerGroupPropertiesDelegatedSubnetArguments) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupPropertiesDelegatedSubnetArguments.
func (*ServerGroupPropertiesDelegatedSubnetArguments) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroupPropertiesDelegatedSubnetArguments) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupPropertiesDelegatedSubnetArguments.
type ServerGroupPropertiesForUpdate ¶
type ServerGroupPropertiesForUpdate struct { // The password of the administrator login. AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` // Availability Zone information of the server group. AvailabilityZone *string `json:"availabilityZone,omitempty"` // The backup retention days for server group. BackupRetentionDays *int32 `json:"backupRetentionDays,omitempty"` // The Citus version of server group. CitusVersion *CitusVersion `json:"citusVersion,omitempty"` // If shards on coordinator is enabled or not for the server group. EnableShardsOnCoordinator *bool `json:"enableShardsOnCoordinator,omitempty"` // Maintenance window of a server group. MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` // The PostgreSQL version of server group. PostgresqlVersion *PostgreSQLVersion `json:"postgresqlVersion,omitempty"` // The list of server role groups. ServerRoleGroups []*ServerRoleGroup `json:"serverRoleGroups,omitempty"` // Standby Availability Zone information of the server group. StandbyAvailabilityZone *string `json:"standbyAvailabilityZone,omitempty"` }
ServerGroupPropertiesForUpdate - The properties used to update a server group.
func (ServerGroupPropertiesForUpdate) MarshalJSON ¶
func (s ServerGroupPropertiesForUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupPropertiesForUpdate.
func (*ServerGroupPropertiesForUpdate) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroupPropertiesForUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupPropertiesForUpdate.
type ServerGroupPropertiesPrivateDNSZoneArguments ¶
type ServerGroupPropertiesPrivateDNSZoneArguments struct { // private dns zone arm resource id. PrivateDNSZoneArmResourceID *string `json:"privateDnsZoneArmResourceId,omitempty"` }
ServerGroupPropertiesPrivateDNSZoneArguments - The private dns zone arguments for a server group.
func (ServerGroupPropertiesPrivateDNSZoneArguments) MarshalJSON ¶ added in v0.6.0
func (s ServerGroupPropertiesPrivateDNSZoneArguments) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupPropertiesPrivateDNSZoneArguments.
func (*ServerGroupPropertiesPrivateDNSZoneArguments) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroupPropertiesPrivateDNSZoneArguments) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupPropertiesPrivateDNSZoneArguments.
type ServerGroupServer ¶
type ServerGroupServer struct { // The properties of a server in a server group. Properties *ServerGroupServerProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The system metadata relating to this resource SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
ServerGroupServer - Represents a server in a server group.
func (ServerGroupServer) MarshalJSON ¶
func (s ServerGroupServer) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupServer.
func (*ServerGroupServer) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroupServer) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupServer.
type ServerGroupServerListResult ¶
type ServerGroupServerListResult struct { // The list of servers in a server group. Value []*ServerGroupServer `json:"value,omitempty"` }
ServerGroupServerListResult - A list of servers in a server group.
func (ServerGroupServerListResult) MarshalJSON ¶
func (s ServerGroupServerListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupServerListResult.
func (*ServerGroupServerListResult) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroupServerListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupServerListResult.
type ServerGroupServerProperties ¶
type ServerGroupServerProperties struct { // The administrator's login name of a servers in server group. AdministratorLogin *string `json:"administratorLogin,omitempty"` // Availability Zone information of the server group. AvailabilityZone *string `json:"availabilityZone,omitempty"` // The Citus version of server. CitusVersion *CitusVersion `json:"citusVersion,omitempty"` // If high availability is enabled or not for the server. EnableHa *bool `json:"enableHa,omitempty"` // The PostgreSQL version of server. PostgresqlVersion *PostgreSQLVersion `json:"postgresqlVersion,omitempty"` // The role of server in the server group. Role *ServerRole `json:"role,omitempty"` // The edition of a server (default: GeneralPurpose). ServerEdition *ServerEdition `json:"serverEdition,omitempty"` // Standby Availability Zone information of the server group. StandbyAvailabilityZone *string `json:"standbyAvailabilityZone,omitempty"` // The storage of a server in MB (max: 2097152 = 2TiB). StorageQuotaInMb *int64 `json:"storageQuotaInMb,omitempty"` // The vCores count of a server (max: 64). VCores *int64 `json:"vCores,omitempty"` // READ-ONLY; If public IP is requested or not for a server. EnablePublicIP *bool `json:"enablePublicIp,omitempty" azure:"ro"` // READ-ONLY; The fully qualified domain name of a server. FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty" azure:"ro"` // READ-ONLY; A state of a server group that is visible to user for HA feature. HaState *ServerHaState `json:"haState,omitempty" azure:"ro"` // READ-ONLY; A state of a server that is visible to user. State *ServerState `json:"state,omitempty" azure:"ro"` }
ServerGroupServerProperties - The properties of a server in server group.
func (ServerGroupServerProperties) MarshalJSON ¶
func (s ServerGroupServerProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerGroupServerProperties.
func (*ServerGroupServerProperties) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerGroupServerProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerGroupServerProperties.
type ServerGroupsClient ¶
type ServerGroupsClient struct {
// contains filtered or unexported fields
}
ServerGroupsClient contains the methods for the ServerGroups group. Don't use this type directly, use NewServerGroupsClient() instead.
func NewServerGroupsClient ¶
func NewServerGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerGroupsClient, error)
NewServerGroupsClient creates a new instance of ServerGroupsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ServerGroupsClient) BeginCreateOrUpdate ¶
func (client *ServerGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverGroupName string, parameters ServerGroup, options *ServerGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerGroupsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Creates a new server group with servers. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- parameters - The required parameters for creating or updating a server group.
- options - ServerGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerGroupsClient.BeginCreateOrUpdate method.
Example (CreateANewServerGroup) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupCreate.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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginCreateOrUpdate(ctx, "TestGroup", "hsctestsg", armpostgresqlhsc.ServerGroup{ Location: to.Ptr("westus"), Tags: map[string]*string{ "ElasticServer": to.Ptr("1"), }, Properties: &armpostgresqlhsc.ServerGroupProperties{ AdministratorLogin: to.Ptr("citus"), AdministratorLoginPassword: to.Ptr("password"), AvailabilityZone: to.Ptr("1"), BackupRetentionDays: to.Ptr[int32](35), CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), DelegatedSubnetArguments: &armpostgresqlhsc.ServerGroupPropertiesDelegatedSubnetArguments{ SubnetArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), }, EnableMx: to.Ptr(true), EnableZfs: to.Ptr(false), PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), PrivateDNSZoneArguments: &armpostgresqlhsc.ServerGroupPropertiesPrivateDNSZoneArguments{ PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone"), }, ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ { EnableHa: to.Ptr(true), ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionGeneralPurpose), StorageQuotaInMb: to.Ptr[int64](524288), VCores: to.Ptr[int64](4), Name: to.Ptr(""), Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), ServerCount: to.Ptr[int32](1), }, { EnableHa: to.Ptr(false), ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), StorageQuotaInMb: to.Ptr[int64](524288), VCores: to.Ptr[int64](4), Name: to.Ptr(""), Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), ServerCount: to.Ptr[int32](3), }}, StandbyAvailabilityZone: to.Ptr("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.ServerGroup = armpostgresqlhsc.ServerGroup{ // Name: to.Ptr("hsctestsg"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg"), // Location: to.Ptr("westus2"), // Properties: &armpostgresqlhsc.ServerGroupProperties{ // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
Example (CreateANewServerGroupAsAPointInTimeRestore) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupCreatePITR.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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginCreateOrUpdate(ctx, "TestGroup", "hsctestsg", armpostgresqlhsc.ServerGroup{ Location: to.Ptr("westus"), Properties: &armpostgresqlhsc.ServerGroupProperties{ CreateMode: to.Ptr(armpostgresqlhsc.CreateModePointInTimeRestore), EnableMx: to.Ptr(true), EnableZfs: to.Ptr(false), PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T00:00:37.467Z"); return t }()), SourceLocation: to.Ptr("eastus"), SourceResourceGroupName: to.Ptr("SourceGroup"), SourceServerGroupName: to.Ptr("pgtests-source-server-group"), SourceSubscriptionID: to.Ptr("dddddddd-dddd-dddd-dddd-dddddddddddd"), }, }, 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.ServerGroup = armpostgresqlhsc.ServerGroup{ // Name: to.Ptr("hsctestsg"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg"), // Location: to.Ptr("westus2"), // Properties: &armpostgresqlhsc.ServerGroupProperties{ // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
Example (CreateANewServerGroupAsAReadReplica) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupCreateReadReplica.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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginCreateOrUpdate(ctx, "TestGroup", "hsctestsg", armpostgresqlhsc.ServerGroup{ Location: to.Ptr("westus"), Properties: &armpostgresqlhsc.ServerGroupProperties{ CreateMode: to.Ptr(armpostgresqlhsc.CreateModeReadReplica), SourceLocation: to.Ptr("eastus"), SourceResourceGroupName: to.Ptr("SourceGroup"), SourceServerGroupName: to.Ptr("pgtests-source-server-group"), SourceSubscriptionID: to.Ptr("dddddddd-dddd-dddd-dddd-dddddddddddd"), }, }, 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.ServerGroup = armpostgresqlhsc.ServerGroup{ // Name: to.Ptr("hsctestsg"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg"), // Location: to.Ptr("westus2"), // Properties: &armpostgresqlhsc.ServerGroupProperties{ // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
func (*ServerGroupsClient) BeginDelete ¶
func (client *ServerGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverGroupName string, options *ServerGroupsClientBeginDeleteOptions) (*runtime.Poller[ServerGroupsClientDeleteResponse], error)
BeginDelete - Deletes a server group together with servers in it. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- options - ServerGroupsClientBeginDeleteOptions contains the optional parameters for the ServerGroupsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginDelete(ctx, "TestGroup", "testservergroup", 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 (*ServerGroupsClient) BeginRestart ¶
func (client *ServerGroupsClient) BeginRestart(ctx context.Context, resourceGroupName string, serverGroupName string, options *ServerGroupsClientBeginRestartOptions) (*runtime.Poller[ServerGroupsClientRestartResponse], error)
BeginRestart - Restarts the server group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- options - ServerGroupsClientBeginRestartOptions contains the optional parameters for the ServerGroupsClient.BeginRestart method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupRestart.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginRestart(ctx, "TestGroup", "hsctestsg1", 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 (*ServerGroupsClient) BeginStart ¶
func (client *ServerGroupsClient) BeginStart(ctx context.Context, resourceGroupName string, serverGroupName string, options *ServerGroupsClientBeginStartOptions) (*runtime.Poller[ServerGroupsClientStartResponse], error)
BeginStart - Starts the server group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- options - ServerGroupsClientBeginStartOptions contains the optional parameters for the ServerGroupsClient.BeginStart method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupStart.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginStart(ctx, "TestGroup", "hsctestsg1", 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 (*ServerGroupsClient) BeginStop ¶
func (client *ServerGroupsClient) BeginStop(ctx context.Context, resourceGroupName string, serverGroupName string, options *ServerGroupsClientBeginStopOptions) (*runtime.Poller[ServerGroupsClientStopResponse], error)
BeginStop - Stops the server group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- options - ServerGroupsClientBeginStopOptions contains the optional parameters for the ServerGroupsClient.BeginStop method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupStop.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginStop(ctx, "TestGroup", "hsctestsg1", 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 (*ServerGroupsClient) BeginUpdate ¶
func (client *ServerGroupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverGroupName string, parameters ServerGroupForUpdate, options *ServerGroupsClientBeginUpdateOptions) (*runtime.Poller[ServerGroupsClientUpdateResponse], error)
BeginUpdate - Updates an existing server group. The request body can contain one to many of the properties present in the normal server group definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- parameters - The parameters for updating a server group.
- options - ServerGroupsClientBeginUpdateOptions contains the optional parameters for the ServerGroupsClient.BeginUpdate method.
Example (AddNewWorkerNodes) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupAddNode.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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginUpdate(ctx, "TestGroup", "hsctestsg", armpostgresqlhsc.ServerGroupForUpdate{ Location: to.Ptr("westus"), Properties: &armpostgresqlhsc.ServerGroupPropertiesForUpdate{ ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ { Name: to.Ptr(""), Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), ServerCount: to.Ptr[int32](10), }}, }, }, 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.ServerGroup = armpostgresqlhsc.ServerGroup{ // Name: to.Ptr("hsctestsg"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg"), // Location: to.Ptr("westus2"), // Properties: &armpostgresqlhsc.ServerGroupProperties{ // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
Example (ScaleCompute) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupScaleCompute.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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginUpdate(ctx, "TestGroup", "hsctestsg", armpostgresqlhsc.ServerGroupForUpdate{ Location: to.Ptr("westus"), Properties: &armpostgresqlhsc.ServerGroupPropertiesForUpdate{ ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ { VCores: to.Ptr[int64](16), Name: to.Ptr(""), Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), }}, }, }, 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.ServerGroup = armpostgresqlhsc.ServerGroup{ // Name: to.Ptr("hsctestsg"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg"), // Location: to.Ptr("westus2"), // Properties: &armpostgresqlhsc.ServerGroupProperties{ // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
Example (ScaleStorage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupScaleStorage.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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginUpdate(ctx, "TestGroup", "hsctestsg", armpostgresqlhsc.ServerGroupForUpdate{ Location: to.Ptr("westus"), Properties: &armpostgresqlhsc.ServerGroupPropertiesForUpdate{ ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ { StorageQuotaInMb: to.Ptr[int64](8388608), Name: to.Ptr(""), Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), }}, }, }, 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.ServerGroup = armpostgresqlhsc.ServerGroup{ // Name: to.Ptr("hsctestsg"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg"), // Location: to.Ptr("westus2"), // Properties: &armpostgresqlhsc.ServerGroupProperties{ // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
Example (UpdateCustomerMaintenanceWindow) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupUpdateMaintenanceWindow.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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginUpdate(ctx, "TestGroup", "hsctestsg", armpostgresqlhsc.ServerGroupForUpdate{ Properties: &armpostgresqlhsc.ServerGroupPropertiesForUpdate{ MaintenanceWindow: &armpostgresqlhsc.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.ServerGroup = armpostgresqlhsc.ServerGroup{ // Name: to.Ptr("hsctestsg"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg"), // Location: to.Ptr("westus2"), // Properties: &armpostgresqlhsc.ServerGroupProperties{ // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
Example (UpdateTheServerGroup) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupUpdate.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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServerGroupsClient().BeginUpdate(ctx, "TestGroup", "hsctestsg", armpostgresqlhsc.ServerGroupForUpdate{ Properties: &armpostgresqlhsc.ServerGroupPropertiesForUpdate{ AdministratorLoginPassword: to.Ptr("secret"), BackupRetentionDays: to.Ptr[int32](30), PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ { EnableHa: to.Ptr(false), ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionGeneralPurpose), StorageQuotaInMb: to.Ptr[int64](1048576), VCores: to.Ptr[int64](8), Name: to.Ptr(""), Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), ServerCount: to.Ptr[int32](1), }, { EnableHa: to.Ptr(true), ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), StorageQuotaInMb: to.Ptr[int64](524288), VCores: to.Ptr[int64](4), Name: to.Ptr(""), Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), ServerCount: to.Ptr[int32](4), }}, }, Tags: map[string]*string{ "ElasticServer": to.Ptr("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.ServerGroup = armpostgresqlhsc.ServerGroup{ // Name: to.Ptr("hsctestsg"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg"), // Location: to.Ptr("westus2"), // Properties: &armpostgresqlhsc.ServerGroupProperties{ // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
func (*ServerGroupsClient) CheckNameAvailability ¶
func (client *ServerGroupsClient) CheckNameAvailability(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest, options *ServerGroupsClientCheckNameAvailabilityOptions) (ServerGroupsClientCheckNameAvailabilityResponse, error)
CheckNameAvailability - Check the availability of name for resource If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- nameAvailabilityRequest - The required parameters for checking if resource name is available.
- options - ServerGroupsClientCheckNameAvailabilityOptions contains the optional parameters for the ServerGroupsClient.CheckNameAvailability method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewServerGroupsClient().CheckNameAvailability(ctx, armpostgresqlhsc.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 = armpostgresqlhsc.NameAvailability{ // Name: to.Ptr("name1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // Message: to.Ptr(""), // NameAvailable: to.Ptr(true), // } }
Output:
func (*ServerGroupsClient) Get ¶
func (client *ServerGroupsClient) Get(ctx context.Context, resourceGroupName string, serverGroupName string, options *ServerGroupsClientGetOptions) (ServerGroupsClientGetResponse, error)
Get - Gets information about a server group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- options - ServerGroupsClientGetOptions contains the optional parameters for the ServerGroupsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewServerGroupsClient().Get(ctx, "TestGroup", "hsctestsg1", 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.ServerGroup = armpostgresqlhsc.ServerGroup{ // Name: to.Ptr("hsctestsg1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg1"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp1": to.Ptr("string"), // "additionalProp2": to.Ptr("string"), // "additionalProp3": to.Ptr("string"), // }, // Properties: &armpostgresqlhsc.ServerGroupProperties{ // AdministratorLogin: to.Ptr("citus"), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), // DelegatedSubnetArguments: &armpostgresqlhsc.ServerGroupPropertiesDelegatedSubnetArguments{ // SubnetArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), // }, // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableMx: to.Ptr(true), // EnableZfs: to.Ptr(false), // MaintenanceWindow: &armpostgresqlhsc.MaintenanceWindow{ // CustomWindow: to.Ptr("Disabled"), // DayOfWeek: to.Ptr[int32](0), // StartHour: to.Ptr[int32](0), // StartMinute: to.Ptr[int32](0), // }, // PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), // PrivateDNSZoneArguments: &armpostgresqlhsc.ServerGroupPropertiesPrivateDNSZoneArguments{ // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone"), // }, // ReadReplicas: []*string{ // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSQL/serverGroupsv2/hsctestreadreplica-01"), // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSQL/serverGroupsv2/hsctestreadreplica-02")}, // ResourceProviderType: to.Ptr(armpostgresqlhsc.ResourceProviderTypeMeru), // ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ // { // EnableHa: to.Ptr(true), // EnablePublicIP: to.Ptr(true), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](4), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // ServerCount: to.Ptr[int32](1), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg1-c"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-c.postgres.database.azure.com"), // }}, // }, // { // EnableHa: to.Ptr(false), // EnablePublicIP: to.Ptr(false), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionGeneralPurpose), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](8), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // ServerCount: to.Ptr[int32](3), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg1-w0"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg1-w1"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-w1.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg1-w2"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-w2.postgres.database.azure.com"), // }}, // }}, // StandbyAvailabilityZone: to.Ptr("2"), // State: to.Ptr(armpostgresqlhsc.ServerStateReady), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
func (*ServerGroupsClient) NewListByResourceGroupPager ¶ added in v0.4.0
func (client *ServerGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *ServerGroupsClientListByResourceGroupOptions) *runtime.Pager[ServerGroupsClientListByResourceGroupResponse]
NewListByResourceGroupPager - List all the server groups in a given resource group.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - ServerGroupsClientListByResourceGroupOptions contains the optional parameters for the ServerGroupsClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupListByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewServerGroupsClient().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.ServerGroupListResult = armpostgresqlhsc.ServerGroupListResult{ // Value: []*armpostgresqlhsc.ServerGroup{ // { // Name: to.Ptr("hsctestsg1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg1"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp1": to.Ptr("string"), // }, // Properties: &armpostgresqlhsc.ServerGroupProperties{ // AdministratorLogin: to.Ptr("citus"), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), // DelegatedSubnetArguments: &armpostgresqlhsc.ServerGroupPropertiesDelegatedSubnetArguments{ // SubnetArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), // }, // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableMx: to.Ptr(true), // EnableZfs: to.Ptr(false), // PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), // PrivateDNSZoneArguments: &armpostgresqlhsc.ServerGroupPropertiesPrivateDNSZoneArguments{ // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone"), // }, // ResourceProviderType: to.Ptr(armpostgresqlhsc.ResourceProviderTypeMeru), // ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ // { // EnableHa: to.Ptr(true), // EnablePublicIP: to.Ptr(true), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](4), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // ServerCount: to.Ptr[int32](1), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg1-c"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-c.postgres.database.azure.com"), // }}, // }, // { // EnableHa: to.Ptr(false), // EnablePublicIP: to.Ptr(false), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionGeneralPurpose), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](8), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // ServerCount: to.Ptr[int32](3), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg1-w0"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg1-w1"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-w1.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg1-w2"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-w2.postgres.database.azure.com"), // }}, // }}, // StandbyAvailabilityZone: to.Ptr("2"), // State: to.Ptr(armpostgresqlhsc.ServerStateReady), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("hsctestsg2"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg2"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp2": to.Ptr("string"), // }, // Properties: &armpostgresqlhsc.ServerGroupProperties{ // AdministratorLogin: to.Ptr("citus"), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableMx: to.Ptr(true), // EnableZfs: to.Ptr(false), // PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), // ResourceProviderType: to.Ptr(armpostgresqlhsc.ResourceProviderTypeMeru), // ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ // { // EnableHa: to.Ptr(true), // EnablePublicIP: to.Ptr(true), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](8), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // ServerCount: to.Ptr[int32](1), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg2-c"), // FullyQualifiedDomainName: to.Ptr("hsctestsg2-c.postgres.database.azure.com"), // }}, // }, // { // EnableHa: to.Ptr(false), // EnablePublicIP: to.Ptr(false), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionGeneralPurpose), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](4), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // ServerCount: to.Ptr[int32](2), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg2-w0"), // FullyQualifiedDomainName: to.Ptr("hsctestsg2-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg2-w1"), // FullyQualifiedDomainName: to.Ptr("hsctestsg2-w1.postgres.database.azure.com"), // }}, // }}, // StandbyAvailabilityZone: to.Ptr("2"), // State: to.Ptr(armpostgresqlhsc.ServerStateReady), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("hsctestsg3"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg3"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp3": to.Ptr("string"), // }, // Properties: &armpostgresqlhsc.ServerGroupProperties{ // AdministratorLogin: to.Ptr("citus"), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), // DelegatedSubnetArguments: &armpostgresqlhsc.ServerGroupPropertiesDelegatedSubnetArguments{ // SubnetArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), // }, // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableMx: to.Ptr(true), // EnableZfs: to.Ptr(false), // PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), // PrivateDNSZoneArguments: &armpostgresqlhsc.ServerGroupPropertiesPrivateDNSZoneArguments{ // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone"), // }, // ResourceProviderType: to.Ptr(armpostgresqlhsc.ResourceProviderTypeMeru), // ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ // { // EnableHa: to.Ptr(true), // EnablePublicIP: to.Ptr(true), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](4), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // ServerCount: to.Ptr[int32](1), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg3-c"), // FullyQualifiedDomainName: to.Ptr("hsctestsg3-c.postgres.database.azure.com"), // }}, // }, // { // EnableHa: to.Ptr(false), // EnablePublicIP: to.Ptr(false), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionGeneralPurpose), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](8), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // ServerCount: to.Ptr[int32](3), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg3-w0"), // FullyQualifiedDomainName: to.Ptr("hsctestsg3-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg3-w1"), // FullyQualifiedDomainName: to.Ptr("hsctestsg3-w1.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg3-w2"), // FullyQualifiedDomainName: to.Ptr("hsctestsg3-w2.postgres.database.azure.com"), // }}, // }}, // StandbyAvailabilityZone: to.Ptr("2"), // State: to.Ptr(armpostgresqlhsc.ServerStateReady), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }}, // } } }
Output:
func (*ServerGroupsClient) NewListPager ¶ added in v0.4.0
func (client *ServerGroupsClient) NewListPager(options *ServerGroupsClientListOptions) *runtime.Pager[ServerGroupsClientListResponse]
NewListPager - List all the server groups in a given subscription.
Generated from API version 2020-10-05-privatepreview
- options - ServerGroupsClientListOptions contains the optional parameters for the ServerGroupsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerGroupList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewServerGroupsClient().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.ServerGroupListResult = armpostgresqlhsc.ServerGroupListResult{ // Value: []*armpostgresqlhsc.ServerGroup{ // { // Name: to.Ptr("hsctestsg1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg1"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp1": to.Ptr("string"), // }, // Properties: &armpostgresqlhsc.ServerGroupProperties{ // AdministratorLogin: to.Ptr("citus"), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), // DelegatedSubnetArguments: &armpostgresqlhsc.ServerGroupPropertiesDelegatedSubnetArguments{ // SubnetArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), // }, // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableMx: to.Ptr(true), // EnableZfs: to.Ptr(false), // PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), // PrivateDNSZoneArguments: &armpostgresqlhsc.ServerGroupPropertiesPrivateDNSZoneArguments{ // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone"), // }, // ReadReplicas: []*string{ // to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg2")}, // ResourceProviderType: to.Ptr(armpostgresqlhsc.ResourceProviderTypeMeru), // ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ // { // EnableHa: to.Ptr(true), // EnablePublicIP: to.Ptr(true), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](4), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // ServerCount: to.Ptr[int32](1), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg1-c"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-c.postgres.database.azure.com"), // }}, // }, // { // EnableHa: to.Ptr(false), // EnablePublicIP: to.Ptr(false), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionGeneralPurpose), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](8), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // ServerCount: to.Ptr[int32](3), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg1-w0"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg1-w1"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-w1.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg1-w2"), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-w2.postgres.database.azure.com"), // }}, // }}, // StandbyAvailabilityZone: to.Ptr("2"), // State: to.Ptr(armpostgresqlhsc.ServerStateReady), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("hsctestsg2"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg2"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp2": to.Ptr("string"), // }, // Properties: &armpostgresqlhsc.ServerGroupProperties{ // AdministratorLogin: to.Ptr("citus"), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableMx: to.Ptr(true), // EnableZfs: to.Ptr(false), // PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), // ResourceProviderType: to.Ptr(armpostgresqlhsc.ResourceProviderTypeMeru), // ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ // { // EnableHa: to.Ptr(true), // EnablePublicIP: to.Ptr(true), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](8), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // ServerCount: to.Ptr[int32](1), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg2-c"), // FullyQualifiedDomainName: to.Ptr("hsctestsg2-c.postgres.database.azure.com"), // }}, // }, // { // EnableHa: to.Ptr(false), // EnablePublicIP: to.Ptr(false), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionGeneralPurpose), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](4), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // ServerCount: to.Ptr[int32](2), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg2-w0"), // FullyQualifiedDomainName: to.Ptr("hsctestsg2-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg2-w1"), // FullyQualifiedDomainName: to.Ptr("hsctestsg2-w1.postgres.database.azure.com"), // }}, // }}, // SourceServerGroup: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg1"), // StandbyAvailabilityZone: to.Ptr("2"), // State: to.Ptr(armpostgresqlhsc.ServerStateReady), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("hsctestsg3"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg3"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "additionalProp3": to.Ptr("string"), // }, // Properties: &armpostgresqlhsc.ServerGroupProperties{ // AdministratorLogin: to.Ptr("citus"), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), // DelegatedSubnetArguments: &armpostgresqlhsc.ServerGroupPropertiesDelegatedSubnetArguments{ // SubnetArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), // }, // EarliestRestoreTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-14T00:00:37.467Z"); return t}()), // EnableMx: to.Ptr(true), // EnableZfs: to.Ptr(false), // PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), // PrivateDNSZoneArguments: &armpostgresqlhsc.ServerGroupPropertiesPrivateDNSZoneArguments{ // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone"), // }, // ResourceProviderType: to.Ptr(armpostgresqlhsc.ResourceProviderTypeMeru), // ServerRoleGroups: []*armpostgresqlhsc.ServerRoleGroup{ // { // EnableHa: to.Ptr(true), // EnablePublicIP: to.Ptr(true), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](4), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // ServerCount: to.Ptr[int32](1), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg3-c"), // FullyQualifiedDomainName: to.Ptr("hsctestsg3-c.postgres.database.azure.com"), // }}, // }, // { // EnableHa: to.Ptr(false), // EnablePublicIP: to.Ptr(false), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionGeneralPurpose), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](8), // Name: to.Ptr(""), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // ServerCount: to.Ptr[int32](3), // ServerNames: []*armpostgresqlhsc.ServerNameItem{ // { // Name: to.Ptr("hsctestsg3-w0"), // FullyQualifiedDomainName: to.Ptr("hsctestsg3-w0.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg3-w1"), // FullyQualifiedDomainName: to.Ptr("hsctestsg3-w1.postgres.database.azure.com"), // }, // { // Name: to.Ptr("hsctestsg3-w2"), // FullyQualifiedDomainName: to.Ptr("hsctestsg3-w2.postgres.database.azure.com"), // }}, // }}, // StandbyAvailabilityZone: to.Ptr("2"), // State: to.Ptr(armpostgresqlhsc.ServerStateReady), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }}, // } } }
Output:
type ServerGroupsClientBeginCreateOrUpdateOptions ¶ added in v0.2.0
type ServerGroupsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ServerGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerGroupsClient.BeginCreateOrUpdate method.
type ServerGroupsClientBeginDeleteOptions ¶ added in v0.2.0
type ServerGroupsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ServerGroupsClientBeginDeleteOptions contains the optional parameters for the ServerGroupsClient.BeginDelete method.
type ServerGroupsClientBeginRestartOptions ¶ added in v0.2.0
type ServerGroupsClientBeginRestartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ServerGroupsClientBeginRestartOptions contains the optional parameters for the ServerGroupsClient.BeginRestart method.
type ServerGroupsClientBeginStartOptions ¶ added in v0.2.0
type ServerGroupsClientBeginStartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ServerGroupsClientBeginStartOptions contains the optional parameters for the ServerGroupsClient.BeginStart method.
type ServerGroupsClientBeginStopOptions ¶ added in v0.2.0
type ServerGroupsClientBeginStopOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ServerGroupsClientBeginStopOptions contains the optional parameters for the ServerGroupsClient.BeginStop method.
type ServerGroupsClientBeginUpdateOptions ¶ added in v0.2.0
type ServerGroupsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ServerGroupsClientBeginUpdateOptions contains the optional parameters for the ServerGroupsClient.BeginUpdate method.
type ServerGroupsClientCheckNameAvailabilityOptions ¶ added in v0.2.0
type ServerGroupsClientCheckNameAvailabilityOptions struct { }
ServerGroupsClientCheckNameAvailabilityOptions contains the optional parameters for the ServerGroupsClient.CheckNameAvailability method.
type ServerGroupsClientCheckNameAvailabilityResponse ¶ added in v0.2.0
type ServerGroupsClientCheckNameAvailabilityResponse struct {
NameAvailability
}
ServerGroupsClientCheckNameAvailabilityResponse contains the response from method ServerGroupsClient.CheckNameAvailability.
type ServerGroupsClientCreateOrUpdateResponse ¶ added in v0.2.0
type ServerGroupsClientCreateOrUpdateResponse struct {
ServerGroup
}
ServerGroupsClientCreateOrUpdateResponse contains the response from method ServerGroupsClient.BeginCreateOrUpdate.
type ServerGroupsClientDeleteResponse ¶ added in v0.2.0
type ServerGroupsClientDeleteResponse struct { }
ServerGroupsClientDeleteResponse contains the response from method ServerGroupsClient.BeginDelete.
type ServerGroupsClientGetOptions ¶ added in v0.2.0
type ServerGroupsClientGetOptions struct { }
ServerGroupsClientGetOptions contains the optional parameters for the ServerGroupsClient.Get method.
type ServerGroupsClientGetResponse ¶ added in v0.2.0
type ServerGroupsClientGetResponse struct {
ServerGroup
}
ServerGroupsClientGetResponse contains the response from method ServerGroupsClient.Get.
type ServerGroupsClientListByResourceGroupOptions ¶ added in v0.2.0
type ServerGroupsClientListByResourceGroupOptions struct { }
ServerGroupsClientListByResourceGroupOptions contains the optional parameters for the ServerGroupsClient.NewListByResourceGroupPager method.
type ServerGroupsClientListByResourceGroupResponse ¶ added in v0.2.0
type ServerGroupsClientListByResourceGroupResponse struct {
ServerGroupListResult
}
ServerGroupsClientListByResourceGroupResponse contains the response from method ServerGroupsClient.NewListByResourceGroupPager.
type ServerGroupsClientListOptions ¶ added in v0.2.0
type ServerGroupsClientListOptions struct { }
ServerGroupsClientListOptions contains the optional parameters for the ServerGroupsClient.NewListPager method.
type ServerGroupsClientListResponse ¶ added in v0.2.0
type ServerGroupsClientListResponse struct {
ServerGroupListResult
}
ServerGroupsClientListResponse contains the response from method ServerGroupsClient.NewListPager.
type ServerGroupsClientRestartResponse ¶ added in v0.2.0
type ServerGroupsClientRestartResponse struct { }
ServerGroupsClientRestartResponse contains the response from method ServerGroupsClient.BeginRestart.
type ServerGroupsClientStartResponse ¶ added in v0.2.0
type ServerGroupsClientStartResponse struct { }
ServerGroupsClientStartResponse contains the response from method ServerGroupsClient.BeginStart.
type ServerGroupsClientStopResponse ¶ added in v0.2.0
type ServerGroupsClientStopResponse struct { }
ServerGroupsClientStopResponse contains the response from method ServerGroupsClient.BeginStop.
type ServerGroupsClientUpdateResponse ¶ added in v0.2.0
type ServerGroupsClientUpdateResponse struct {
ServerGroup
}
ServerGroupsClientUpdateResponse contains the response from method ServerGroupsClient.BeginUpdate.
type ServerHaState ¶
type ServerHaState string
ServerHaState - A state of a server role group/server that is visible to user for HA feature.
const ( ServerHaStateCreatingStandby ServerHaState = "CreatingStandby" ServerHaStateFailingOver ServerHaState = "FailingOver" ServerHaStateHealthy ServerHaState = "Healthy" ServerHaStateNotEnabled ServerHaState = "NotEnabled" ServerHaStateNotSync ServerHaState = "NotSync" ServerHaStateRemovingStandby ServerHaState = "RemovingStandby" ServerHaStateReplicatingData ServerHaState = "ReplicatingData" )
func PossibleServerHaStateValues ¶
func PossibleServerHaStateValues() []ServerHaState
PossibleServerHaStateValues returns the possible values for the ServerHaState const type.
type ServerNameItem ¶
type ServerNameItem struct { // The name of a server. Name *string `json:"name,omitempty"` // READ-ONLY; The fully qualified domain name of a server. FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty" azure:"ro"` }
ServerNameItem - The name object for a server.
func (ServerNameItem) MarshalJSON ¶ added in v0.6.0
func (s ServerNameItem) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerNameItem.
func (*ServerNameItem) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerNameItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerNameItem.
type ServerProperties ¶
type ServerProperties struct { // If high availability is enabled or not for the server. EnableHa *bool `json:"enableHa,omitempty"` // The edition of a server (default: GeneralPurpose). ServerEdition *ServerEdition `json:"serverEdition,omitempty"` // The storage of a server in MB (max: 2097152 = 2TiB). StorageQuotaInMb *int64 `json:"storageQuotaInMb,omitempty"` // The vCores count of a server (max: 64). VCores *int64 `json:"vCores,omitempty"` // READ-ONLY; If public IP is requested or not for a server. EnablePublicIP *bool `json:"enablePublicIp,omitempty" azure:"ro"` }
ServerProperties - The properties of a server.
func (ServerProperties) MarshalJSON ¶
func (s ServerProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerProperties.
func (*ServerProperties) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties.
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 ServerRoleGroup ¶
type ServerRoleGroup struct { // If high availability is enabled or not for the server. EnableHa *bool `json:"enableHa,omitempty"` // The name of the server role group. Name *string `json:"name,omitempty"` // The role of servers in the server role group. Role *ServerRole `json:"role,omitempty"` // The number of servers in the server role group. ServerCount *int32 `json:"serverCount,omitempty"` // The edition of a server (default: GeneralPurpose). ServerEdition *ServerEdition `json:"serverEdition,omitempty"` // The storage of a server in MB (max: 2097152 = 2TiB). StorageQuotaInMb *int64 `json:"storageQuotaInMb,omitempty"` // The vCores count of a server (max: 64). VCores *int64 `json:"vCores,omitempty"` // READ-ONLY; If public IP is requested or not for a server. EnablePublicIP *bool `json:"enablePublicIp,omitempty" azure:"ro"` // READ-ONLY; The list of server names in the server role group. ServerNames []*ServerNameItem `json:"serverNames,omitempty" azure:"ro"` }
ServerRoleGroup - Represents a server role group.
func (ServerRoleGroup) MarshalJSON ¶
func (s ServerRoleGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerRoleGroup.
func (*ServerRoleGroup) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerRoleGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerRoleGroup.
type ServerRoleGroupConfiguration ¶
type ServerRoleGroupConfiguration struct { // REQUIRED; The role of servers in the server role group. Role *ServerRole `json:"role,omitempty"` // REQUIRED; Value of the configuration. Value *string `json:"value,omitempty"` // READ-ONLY; Default value of the configuration. DefaultValue *string `json:"defaultValue,omitempty" azure:"ro"` // READ-ONLY; Source of the configuration. Source *string `json:"source,omitempty" azure:"ro"` }
ServerRoleGroupConfiguration - Represents server role group configuration value.
func (ServerRoleGroupConfiguration) MarshalJSON ¶ added in v0.6.0
func (s ServerRoleGroupConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerRoleGroupConfiguration.
func (*ServerRoleGroupConfiguration) UnmarshalJSON ¶ added in v0.6.0
func (s *ServerRoleGroupConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerRoleGroupConfiguration.
type ServerState ¶
type ServerState string
ServerState - A state of a server group/server that is visible to user.
const ( ServerStateDisabled ServerState = "Disabled" ServerStateDropping ServerState = "Dropping" ServerStateProvisioning ServerState = "Provisioning" ServerStateReady ServerState = "Ready" ServerStateStarting ServerState = "Starting" ServerStateStopped ServerState = "Stopped" ServerStateStopping ServerState = "Stopping" ServerStateUpdating ServerState = "Updating" )
func PossibleServerStateValues ¶
func PossibleServerStateValues() []ServerState
PossibleServerStateValues returns the possible values for the ServerState const type.
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.
- 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, serverGroupName string, serverName string, options *ServersClientGetOptions) (ServersClientGetResponse, error)
Get - Gets information about a server in server group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/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/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewServersClient().Get(ctx, "TestGroup", "hsctestsg1", "hsctestsg1-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.ServerGroupServer = armpostgresqlhsc.ServerGroupServer{ // Name: to.Ptr("hsctestsg1-c"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg1/servers/hsctestsg1-c"), // Properties: &armpostgresqlhsc.ServerGroupServerProperties{ // EnableHa: to.Ptr(true), // EnablePublicIP: to.Ptr(true), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](4), // AdministratorLogin: to.Ptr("citus"), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-c.postgres.database.azure.com"), // HaState: to.Ptr(armpostgresqlhsc.ServerHaStateHealthy), // PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // StandbyAvailabilityZone: to.Ptr("2"), // State: to.Ptr(armpostgresqlhsc.ServerStateReady), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // } }
Output:
func (*ServersClient) NewListByServerGroupPager ¶ added in v0.4.0
func (client *ServersClient) NewListByServerGroupPager(resourceGroupName string, serverGroupName string, options *ServersClientListByServerGroupOptions) *runtime.Pager[ServersClientListByServerGroupResponse]
NewListByServerGroupPager - Lists servers of a server group.
Generated from API version 2020-10-05-privatepreview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serverGroupName - The name of the server group.
- options - ServersClientListByServerGroupOptions contains the optional parameters for the ServersClient.NewListByServerGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/examples/ServerListByServerGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armpostgresqlhsc.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewServersClient().NewListByServerGroupPager("TestGroup", "hsctestsg1", 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.ServerGroupServerListResult = armpostgresqlhsc.ServerGroupServerListResult{ // Value: []*armpostgresqlhsc.ServerGroupServer{ // { // Name: to.Ptr("hsctestsg1-c"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg1/servers/hsctestsg1-c"), // Properties: &armpostgresqlhsc.ServerGroupServerProperties{ // EnableHa: to.Ptr(true), // EnablePublicIP: to.Ptr(true), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](4), // AdministratorLogin: to.Ptr("citus"), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-c.postgres.database.azure.com"), // HaState: to.Ptr(armpostgresqlhsc.ServerHaStateHealthy), // PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), // Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator), // StandbyAvailabilityZone: to.Ptr("2"), // State: to.Ptr(armpostgresqlhsc.ServerStateReady), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("hsctestsg1-w0"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg1/servers/hsctestsg1-w0"), // Properties: &armpostgresqlhsc.ServerGroupServerProperties{ // EnableHa: to.Ptr(false), // EnablePublicIP: to.Ptr(false), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](4), // AdministratorLogin: to.Ptr("citus"), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-w0.postgres.database.azure.com"), // HaState: to.Ptr(armpostgresqlhsc.ServerHaStateNotEnabled), // PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // StandbyAvailabilityZone: to.Ptr(""), // State: to.Ptr(armpostgresqlhsc.ServerStateReady), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("hsctestsg1-w1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/hsctestsg1/servers/hsctestsg1-w1"), // Properties: &armpostgresqlhsc.ServerGroupServerProperties{ // EnableHa: to.Ptr(false), // EnablePublicIP: to.Ptr(false), // ServerEdition: to.Ptr(armpostgresqlhsc.ServerEditionMemoryOptimized), // StorageQuotaInMb: to.Ptr[int64](10000), // VCores: to.Ptr[int64](4), // AdministratorLogin: to.Ptr("citus"), // AvailabilityZone: to.Ptr("1"), // CitusVersion: to.Ptr(armpostgresqlhsc.CitusVersionNine5), // FullyQualifiedDomainName: to.Ptr("hsctestsg1-w1.postgres.database.azure.com"), // HaState: to.Ptr(armpostgresqlhsc.ServerHaStateNotEnabled), // PostgresqlVersion: to.Ptr(armpostgresqlhsc.PostgreSQLVersionTwelve), // Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker), // StandbyAvailabilityZone: to.Ptr(""), // State: to.Ptr(armpostgresqlhsc.ServerStateReady), // }, // SystemData: &armpostgresqlhsc.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(armpostgresqlhsc.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(armpostgresqlhsc.CreatedByTypeUser), // }, // }}, // } } }
Output:
type ServersClientGetOptions ¶ added in v0.2.0
type ServersClientGetOptions struct { }
ServersClientGetOptions contains the optional parameters for the ServersClient.Get method.
type ServersClientGetResponse ¶ added in v0.2.0
type ServersClientGetResponse struct {
ServerGroupServer
}
ServersClientGetResponse contains the response from method ServersClient.Get.
type ServersClientListByServerGroupOptions ¶ added in v0.2.0
type ServersClientListByServerGroupOptions struct { }
ServersClientListByServerGroupOptions contains the optional parameters for the ServersClient.NewListByServerGroupPager method.
type ServersClientListByServerGroupResponse ¶ added in v0.2.0
type ServersClientListByServerGroupResponse struct {
ServerGroupServerListResult
}
ServersClientListByServerGroupResponse contains the response from method ServersClient.NewListByServerGroupPager.
type SystemData ¶
type SystemData struct { // The timestamp of resource creation (UTC). CreatedAt *time.Time `json:"createdAt,omitempty"` // The identity that created the resource. CreatedBy *string `json:"createdBy,omitempty"` // The type of identity that created the resource. CreatedByType *CreatedByType `json:"createdByType,omitempty"` // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` // The identity that last modified the resource. LastModifiedBy *string `json:"lastModifiedBy,omitempty"` // The type of identity that last modified the resource. LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` }
SystemData - Metadata pertaining to creation and last modification of the resource.
func (SystemData) MarshalJSON ¶
func (s SystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SystemData.
func (*SystemData) UnmarshalJSON ¶
func (s *SystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
type TrackedResource ¶
type TrackedResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` }
TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
func (TrackedResource) MarshalJSON ¶
func (t TrackedResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TrackedResource.
func (*TrackedResource) UnmarshalJSON ¶ added in v0.6.0
func (t *TrackedResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.