armpostgresql

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 14 Imported by: 12

README

Azure Database for PostgreSQL Module for Go

PkgGoDev

The armpostgresql module provides operations for working with Azure Database for PostgreSQL.

Source code

Getting started

Prerequisites

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

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Database for PostgreSQL module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql

Authorization

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

cred, err := azidentity.NewDefaultAzureCredential(nil)

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

Client Factory

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

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

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

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

Clients

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

client := clientFactory.NewServersClient()

Fakes

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

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

More sample code

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Database for PostgreSQL label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckNameAvailabilityClient

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

CheckNameAvailabilityClient contains the methods for the CheckNameAvailability group. Don't use this type directly, use NewCheckNameAvailabilityClient() instead.

func NewCheckNameAvailabilityClient

func NewCheckNameAvailabilityClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CheckNameAvailabilityClient, error)

NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient 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 (*CheckNameAvailabilityClient) Execute

Execute - Check the availability of name for resource If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • nameAvailabilityRequest - The required parameters for checking if resource name is available.
  • options - CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCheckNameAvailabilityClient().Execute(ctx, armpostgresql.NameAvailabilityRequest{
		Name: to.Ptr("name1"),
		Type: to.Ptr("Microsoft.DBforPostgreSQL"),
	}, 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 = armpostgresql.NameAvailability{
	// 	Message: to.Ptr(""),
	// 	NameAvailable: to.Ptr(true),
	// 	Reason: to.Ptr(""),
	// }
}
Output:

type CheckNameAvailabilityClientExecuteOptions added in v0.3.0

type CheckNameAvailabilityClientExecuteOptions struct {
}

CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute method.

type CheckNameAvailabilityClientExecuteResponse added in v0.3.0

type CheckNameAvailabilityClientExecuteResponse struct {
	// Represents a resource name availability.
	NameAvailability
}

CheckNameAvailabilityClientExecuteResponse contains the response from method CheckNameAvailabilityClient.Execute.

type ClientFactory added in v1.1.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 v1.1.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) NewCheckNameAvailabilityClient added in v1.1.0

func (c *ClientFactory) NewCheckNameAvailabilityClient() *CheckNameAvailabilityClient

NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient.

func (*ClientFactory) NewConfigurationsClient added in v1.1.0

func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient

NewConfigurationsClient creates a new instance of ConfigurationsClient.

func (*ClientFactory) NewDatabasesClient added in v1.1.0

func (c *ClientFactory) NewDatabasesClient() *DatabasesClient

NewDatabasesClient creates a new instance of DatabasesClient.

func (*ClientFactory) NewFirewallRulesClient added in v1.1.0

func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient

NewFirewallRulesClient creates a new instance of FirewallRulesClient.

func (*ClientFactory) NewLocationBasedPerformanceTierClient added in v1.1.0

func (c *ClientFactory) NewLocationBasedPerformanceTierClient() *LocationBasedPerformanceTierClient

NewLocationBasedPerformanceTierClient creates a new instance of LocationBasedPerformanceTierClient.

func (*ClientFactory) NewLogFilesClient added in v1.1.0

func (c *ClientFactory) NewLogFilesClient() *LogFilesClient

NewLogFilesClient creates a new instance of LogFilesClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPrivateEndpointConnectionsClient added in v1.1.0

func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient.

func (*ClientFactory) NewPrivateLinkResourcesClient added in v1.1.0

func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient

NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient.

func (*ClientFactory) NewRecoverableServersClient added in v1.1.0

func (c *ClientFactory) NewRecoverableServersClient() *RecoverableServersClient

NewRecoverableServersClient creates a new instance of RecoverableServersClient.

func (*ClientFactory) NewReplicasClient added in v1.1.0

func (c *ClientFactory) NewReplicasClient() *ReplicasClient

NewReplicasClient creates a new instance of ReplicasClient.

func (*ClientFactory) NewServerAdministratorsClient added in v1.1.0

func (c *ClientFactory) NewServerAdministratorsClient() *ServerAdministratorsClient

NewServerAdministratorsClient creates a new instance of ServerAdministratorsClient.

func (*ClientFactory) NewServerBasedPerformanceTierClient added in v1.1.0

func (c *ClientFactory) NewServerBasedPerformanceTierClient() *ServerBasedPerformanceTierClient

NewServerBasedPerformanceTierClient creates a new instance of ServerBasedPerformanceTierClient.

func (*ClientFactory) NewServerKeysClient added in v1.1.0

func (c *ClientFactory) NewServerKeysClient() *ServerKeysClient

NewServerKeysClient creates a new instance of ServerKeysClient.

func (*ClientFactory) NewServerParametersClient added in v1.1.0

func (c *ClientFactory) NewServerParametersClient() *ServerParametersClient

NewServerParametersClient creates a new instance of ServerParametersClient.

func (*ClientFactory) NewServerSecurityAlertPoliciesClient added in v1.1.0

func (c *ClientFactory) NewServerSecurityAlertPoliciesClient() *ServerSecurityAlertPoliciesClient

NewServerSecurityAlertPoliciesClient creates a new instance of ServerSecurityAlertPoliciesClient.

func (*ClientFactory) NewServersClient added in v1.1.0

func (c *ClientFactory) NewServersClient() *ServersClient

NewServersClient creates a new instance of ServersClient.

func (*ClientFactory) NewVirtualNetworkRulesClient added in v1.1.0

func (c *ClientFactory) NewVirtualNetworkRulesClient() *VirtualNetworkRulesClient

NewVirtualNetworkRulesClient creates a new instance of VirtualNetworkRulesClient.

type Configuration

type Configuration struct {
	// The properties of a configuration.
	Properties *ConfigurationProperties

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

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

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

Configuration - Represents a Configuration.

func (Configuration) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Configuration.

func (*Configuration) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Configuration.

type ConfigurationListResult

type ConfigurationListResult struct {
	// The list of server configurations.
	Value []*Configuration
}

ConfigurationListResult - A list of server configurations.

func (ConfigurationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationListResult.

func (*ConfigurationListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationListResult.

type ConfigurationProperties

type ConfigurationProperties struct {
	// Source of the configuration.
	Source *string

	// Value of the configuration.
	Value *string

	// READ-ONLY; Allowed values of the configuration.
	AllowedValues *string

	// READ-ONLY; Data type of the configuration.
	DataType *string

	// READ-ONLY; Default value of the configuration.
	DefaultValue *string

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

ConfigurationProperties - The properties of a configuration.

func (ConfigurationProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationProperties.

func (*ConfigurationProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProperties.

type ConfigurationsClient

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

ConfigurationsClient contains the methods for the Configurations group. Don't use this type directly, use NewConfigurationsClient() instead.

func NewConfigurationsClient

func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationsClient, error)

NewConfigurationsClient creates a new instance of ConfigurationsClient with the specified values.

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

func (*ConfigurationsClient) BeginCreateOrUpdate

func (client *ConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConfigurationsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Updates a configuration of a server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • configurationName - The name of the server configuration.
  • parameters - The required parameters for updating a server configuration.
  • options - ConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationCreateOrUpdate.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewConfigurationsClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "array_nulls", armpostgresql.Configuration{
		Properties: &armpostgresql.ConfigurationProperties{
			Source: to.Ptr("user-override"),
			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.Configuration = armpostgresql.Configuration{
	// 	Name: to.Ptr("array_nulls"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"),
	// 	Properties: &armpostgresql.ConfigurationProperties{
	// 		Description: to.Ptr("Enable input of NULL elements in arrays."),
	// 		AllowedValues: to.Ptr("on,off"),
	// 		DataType: to.Ptr("Boolean"),
	// 		DefaultValue: to.Ptr("on"),
	// 		Source: to.Ptr("user-override"),
	// 		Value: to.Ptr("off"),
	// 	},
	// }
}
Output:

func (*ConfigurationsClient) Get

func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, configurationName string, options *ConfigurationsClientGetOptions) (ConfigurationsClientGetResponse, error)

Get - Gets information about a configuration of server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • configurationName - The name of the server 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationsClient().Get(ctx, "TestGroup", "testserver", "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.Configuration = armpostgresql.Configuration{
	// 	Name: to.Ptr("array_nulls"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"),
	// 	Properties: &armpostgresql.ConfigurationProperties{
	// 		Description: to.Ptr("Enable input of NULL elements in arrays."),
	// 		AllowedValues: to.Ptr("on,off"),
	// 		DataType: to.Ptr("Boolean"),
	// 		DefaultValue: to.Ptr("on"),
	// 		Source: to.Ptr("system-default"),
	// 		Value: to.Ptr("on"),
	// 	},
	// }
}
Output:

func (*ConfigurationsClient) NewListByServerPager added in v0.5.0

func (client *ConfigurationsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ConfigurationsClientListByServerOptions) *runtime.Pager[ConfigurationsClientListByServerResponse]

NewListByServerPager - List all the configurations in a given server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationsClient().NewListByServerPager("TestGroup", "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.ConfigurationListResult = armpostgresql.ConfigurationListResult{
		// 	Value: []*armpostgresql.Configuration{
		// 		{
		// 			Name: to.Ptr("array_nulls"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enable input of NULL elements in arrays."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("backslash_quote"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/backslash_quote"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."),
		// 				AllowedValues: to.Ptr("safe_encoding,on,off"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("safe_encoding"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("safe_encoding"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("bytea_output"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/bytea_output"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the output format for bytea."),
		// 				AllowedValues: to.Ptr("escape,hex"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("hex"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("hex"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("check_function_bodies"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/check_function_bodies"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Check function bodies during CREATE FUNCTION."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("client_encoding"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/client_encoding"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the client's character set encoding."),
		// 				AllowedValues: to.Ptr("BIG5,EUC_CN,EUC_JP,EUC_JIS_2004,EUC_KR,EUC_TW,GB18030,GBK,ISO_8859_5,ISO_8859_6,ISO_8859_7,ISO_8859_8,JOHAB,KOI8R,KOI8U,LATIN1,LATIN2,LATIN3,LATIN4,LATIN5,LATIN6,LATIN7,LATIN8,LATIN9,LATIN10,MULE_INTERNAL,SJIS,SHIFT_JIS_2004,SQL_ASCII,UHC,UTF8,WIN866,WIN874,WIN1250,WIN1251,WIN1252,WIN1253,WIN1254,WIN1255,WIN1256,WIN1257,WIN1258"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("sql_ascii"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("sql_ascii"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("client_min_messages"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/client_min_messages"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the message levels that are sent to the client."),
		// 				AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,log,notice,warning,error"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("notice"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("notice"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("constraint_exclusion"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/constraint_exclusion"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner to use constraints to optimize queries."),
		// 				AllowedValues: to.Ptr("partition,on,off"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("partition"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("partition"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("cpu_index_tuple_cost"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_index_tuple_cost"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the planner's estimate of the cost of processing each index entry during an index scan."),
		// 				AllowedValues: to.Ptr("0-1.79769e+308"),
		// 				DataType: to.Ptr("Numeric"),
		// 				DefaultValue: to.Ptr("0.005"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0.005"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("cpu_operator_cost"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_operator_cost"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the planner's estimate of the cost of processing each operator or function call."),
		// 				AllowedValues: to.Ptr("0-1.79769e+308"),
		// 				DataType: to.Ptr("Numeric"),
		// 				DefaultValue: to.Ptr("0.0025"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0.0025"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("cpu_tuple_cost"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_tuple_cost"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the planner's estimate of the cost of processing each tuple (row)."),
		// 				AllowedValues: to.Ptr("0-1.79769e+308"),
		// 				DataType: to.Ptr("Numeric"),
		// 				DefaultValue: to.Ptr("0.01"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0.01"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("cursor_tuple_fraction"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cursor_tuple_fraction"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the planner's estimate of the fraction of a cursor's rows that will be retrieved."),
		// 				AllowedValues: to.Ptr("0-1"),
		// 				DataType: to.Ptr("Numeric"),
		// 				DefaultValue: to.Ptr("0.1"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0.1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("datestyle"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/datestyle"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the display format for date and time values."),
		// 				AllowedValues: to.Ptr("(iso|postgres|sql|german)\\,\\s(dmy|mdy|ymd)"),
		// 				DataType: to.Ptr("String"),
		// 				DefaultValue: to.Ptr("iso, mdy"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("iso, mdy"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("deadlock_timeout"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/deadlock_timeout"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the amount of time, in milliseconds, to wait on a lock before checking for deadlock."),
		// 				AllowedValues: to.Ptr("1-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("1000"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("1000"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("debug_print_parse"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_parse"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Logs each query's parse tree."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("debug_print_plan"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_plan"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Logs each query's execution plan."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("debug_print_rewritten"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_rewritten"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Logs each query's rewritten parse tree."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default_statistics_target"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_statistics_target"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the default statistics target."),
		// 				AllowedValues: to.Ptr("1-10000"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("100"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("100"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default_text_search_config"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_text_search_config"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets default text search configuration."),
		// 				AllowedValues: to.Ptr("[A-Za-z\\._]+"),
		// 				DataType: to.Ptr("String"),
		// 				DefaultValue: to.Ptr("pg_catalog.english"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("pg_catalog.english"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default_transaction_deferrable"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_deferrable"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the default deferrable status of new transactions."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default_transaction_isolation"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_isolation"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the transaction isolation level of each new transaction."),
		// 				AllowedValues: to.Ptr("serializable,repeatable read,read committed,read uncommitted"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("read committed"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("read committed"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default_transaction_read_only"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_read_only"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the default read-only status of new transactions."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default_with_oids"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_with_oids"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Create new tables with OIDs by default."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("enable_bitmapscan"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_bitmapscan"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner's use of bitmap-scan plans."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("enable_hashagg"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_hashagg"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner's use of hashed aggregation plans."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("enable_hashjoin"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_hashjoin"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner's use of hash join plans."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("enable_indexonlyscan"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_indexonlyscan"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner's use of index-only-scan plans."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("enable_indexscan"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_indexscan"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner's use of index-scan plans."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("enable_material"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_material"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner's use of materialization."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("enable_mergejoin"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_mergejoin"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner's use of merge join plans."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("enable_nestloop"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_nestloop"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner's use of nested-loop join plans."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("enable_seqscan"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_seqscan"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner's use of sequential-scan plans."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("enable_sort"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_sort"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner's use of explicit sort steps."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("enable_tidscan"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_tidscan"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables the planner's use of TID scan plans."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("escape_string_warning"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/escape_string_warning"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Warn about backslash escapes in ordinary string literals."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("exit_on_error"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/exit_on_error"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Terminate session on any error."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("extra_float_digits"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/extra_float_digits"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the number of digits displayed for floating-point values."),
		// 				AllowedValues: to.Ptr("-15-3"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("from_collapse_limit"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/from_collapse_limit"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the FROM-list size beyond which subqueries are not collapsed."),
		// 				AllowedValues: to.Ptr("1-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("8"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("8"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("geqo"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enables genetic query optimization."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("geqo_effort"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_effort"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("GEQO: effort is used to set the default for other GEQO parameters."),
		// 				AllowedValues: to.Ptr("1-10"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("5"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("5"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("geqo_generations"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_generations"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("GEQO: number of iterations of the algorithm."),
		// 				AllowedValues: to.Ptr("0-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("geqo_pool_size"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_pool_size"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("GEQO: number of individuals in the population."),
		// 				AllowedValues: to.Ptr("0-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("geqo_seed"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_seed"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("GEQO: seed for random path selection."),
		// 				AllowedValues: to.Ptr("0-1"),
		// 				DataType: to.Ptr("Numeric"),
		// 				DefaultValue: to.Ptr("0.0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0.0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("geqo_selection_bias"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_selection_bias"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("GEQO: selective pressure within the population."),
		// 				AllowedValues: to.Ptr("1.5-2"),
		// 				DataType: to.Ptr("Numeric"),
		// 				DefaultValue: to.Ptr("2.0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("2.0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("geqo_threshold"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_threshold"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the threshold of FROM items beyond which GEQO is used."),
		// 				AllowedValues: to.Ptr("2-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("12"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("12"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("gin_fuzzy_search_limit"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/gin_fuzzy_search_limit"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the maximum allowed result for exact search by GIN."),
		// 				AllowedValues: to.Ptr("0-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("intervalstyle"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/intervalstyle"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the display format for interval values."),
		// 				AllowedValues: to.Ptr("postgres,postgres_verbose,sql_standard,iso_8601"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("postgres"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("postgres"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("join_collapse_limit"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/join_collapse_limit"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the FROM-list size beyond which JOIN constructs are not flattened."),
		// 				AllowedValues: to.Ptr("1-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("8"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("8"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("lock_timeout"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/lock_timeout"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any wait for a lock. 0 turns this off."),
		// 				AllowedValues: to.Ptr("0-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_checkpoints"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_checkpoints"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Logs each checkpoint."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_connections"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_connections"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Logs each successful connection."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_disconnections"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_disconnections"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Logs end of a session, including duration."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_duration"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_duration"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Logs the duration of each completed SQL statement."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_error_verbosity"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_error_verbosity"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the verbosity of logged messages."),
		// 				AllowedValues: to.Ptr("terse,default,verbose"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("default"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("default"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_lock_waits"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_lock_waits"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Logs long lock waits."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_min_duration_statement"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_duration_statement"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the minimum execution time (in milliseconds) above which statements will be logged. -1 disables logging statement durations."),
		// 				AllowedValues: to.Ptr("-1-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("-1"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("-1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_min_error_statement"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_error_statement"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Causes all statements generating error at or above this level to be logged."),
		// 				AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("error"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("error"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_min_messages"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_messages"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the message levels that are logged."),
		// 				AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("warning"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("warning"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_statement"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_statement"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the type of statements logged."),
		// 				AllowedValues: to.Ptr("none,ddl,mod,all"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("none"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("none"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("max_locks_per_transaction"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_locks_per_transaction"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the maximum number of locks per transaction."),
		// 				AllowedValues: to.Ptr("10-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("64"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("64"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("max_pred_locks_per_transaction"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_pred_locks_per_transaction"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the maximum number of predicate locks per transaction."),
		// 				AllowedValues: to.Ptr("10-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("64"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("64"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("max_prepared_transactions"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_prepared_transactions"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the maximum number of simultaneously prepared transactions."),
		// 				AllowedValues: to.Ptr("0-8388607"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("quote_all_identifiers"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/quote_all_identifiers"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("When generating SQL fragments, quote all identifiers."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("random_page_cost"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/random_page_cost"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the planner's estimate of the cost of a nonsequentially fetched disk page."),
		// 				AllowedValues: to.Ptr("0-1.79769e+308"),
		// 				DataType: to.Ptr("Numeric"),
		// 				DefaultValue: to.Ptr("4.0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("4.0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("search_path"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/search_path"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the schema search order for names that are not schema-qualified."),
		// 				AllowedValues: to.Ptr("[A-Za-z.\"$, ]+"),
		// 				DataType: to.Ptr("String"),
		// 				DefaultValue: to.Ptr("\"$user\", public"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("\"$user\", public"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("seq_page_cost"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/seq_page_cost"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the planner's estimate of the cost of a sequentially fetched disk page."),
		// 				AllowedValues: to.Ptr("0-1.79769e+308"),
		// 				DataType: to.Ptr("Numeric"),
		// 				DefaultValue: to.Ptr("1.0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("1.0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sql_inheritance"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/sql_inheritance"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Causes subtables to be included by default in various commands."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("standard_conforming_strings"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/standard_conforming_strings"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Causes '...' strings to treat backslashes literally."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("statement_timeout"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/statement_timeout"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any statement. 0 turns this off."),
		// 				AllowedValues: to.Ptr("0-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("synchronize_seqscans"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/synchronize_seqscans"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Enable synchronized sequential scans."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("synchronous_commit"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/synchronous_commit"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the current transaction's synchronization level."),
		// 				AllowedValues: to.Ptr("local,remote_write,on,off"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("on"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("on"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("transform_null_equals"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/transform_null_equals"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Treats \"expr=NULL\" as \"expr IS NULL\"."),
		// 				AllowedValues: to.Ptr("on,off"),
		// 				DataType: to.Ptr("Boolean"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("xmlbinary"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/xmlbinary"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets how binary values are to be encoded in XML."),
		// 				AllowedValues: to.Ptr("base64,hex"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("base64"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("base64"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("xmloption"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/xmloption"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments."),
		// 				AllowedValues: to.Ptr("content,document"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("content"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("content"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("force_parallel_mode"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/force_parallel_mode"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Forces use of parallel query facilities."),
		// 				AllowedValues: to.Ptr("off,on,regress"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("off"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("off"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("idle_in_transaction_session_timeout"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/idle_in_transaction_session_timeout"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the maximum allowed duration of any idling transaction."),
		// 				AllowedValues: to.Ptr("0-2147483647"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("max_parallel_workers_per_gather"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_parallel_workers_per_gather"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the maximum number of parallel processes per executor node."),
		// 				AllowedValues: to.Ptr("0-1024"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("min_parallel_relation_size"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/min_parallel_relation_size"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the minimum size of relations to be considered for parallel scan."),
		// 				AllowedValues: to.Ptr("0-715827882"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("8388608"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("8388608"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("parallel_setup_cost"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/parallel_setup_cost"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the planner's estimate of the cost of starting up worker processes for parallel query."),
		// 				AllowedValues: to.Ptr("0-1.79769e+308"),
		// 				DataType: to.Ptr("Numeric"),
		// 				DefaultValue: to.Ptr("1000"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("1000"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("parallel_tuple_cost"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/parallel_tuple_cost"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets the planner's estimate of the cost of passing each tuple (row) from worker to master backend."),
		// 				AllowedValues: to.Ptr("0-1.79769e+308"),
		// 				DataType: to.Ptr("Numeric"),
		// 				DefaultValue: to.Ptr("0.1"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0.1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_retention_days"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_retention_days"),
		// 			Properties: &armpostgresql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets how many days a log file is saved for."),
		// 				AllowedValues: to.Ptr("1-7"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("3"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("3"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ConfigurationsClientBeginCreateOrUpdateOptions added in v0.3.0

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

ConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginCreateOrUpdate method.

type ConfigurationsClientCreateOrUpdateResponse added in v0.3.0

type ConfigurationsClientCreateOrUpdateResponse struct {
	// Represents a Configuration.
	Configuration
}

ConfigurationsClientCreateOrUpdateResponse contains the response from method ConfigurationsClient.BeginCreateOrUpdate.

type ConfigurationsClientGetOptions added in v0.3.0

type ConfigurationsClientGetOptions struct {
}

ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method.

type ConfigurationsClientGetResponse added in v0.3.0

type ConfigurationsClientGetResponse struct {
	// Represents a Configuration.
	Configuration
}

ConfigurationsClientGetResponse contains the response from method ConfigurationsClient.Get.

type ConfigurationsClientListByServerOptions added in v0.3.0

type ConfigurationsClientListByServerOptions struct {
}

ConfigurationsClientListByServerOptions contains the optional parameters for the ConfigurationsClient.NewListByServerPager method.

type ConfigurationsClientListByServerResponse added in v0.3.0

type ConfigurationsClientListByServerResponse struct {
	// A list of server configurations.
	ConfigurationListResult
}

ConfigurationsClientListByServerResponse contains the response from method ConfigurationsClient.NewListByServerPager.

type CreateMode

type CreateMode string

CreateMode - The mode to create a new server.

const (
	CreateModeDefault            CreateMode = "Default"
	CreateModeGeoRestore         CreateMode = "GeoRestore"
	CreateModePointInTimeRestore CreateMode = "PointInTimeRestore"
	CreateModeReplica            CreateMode = "Replica"
)

func PossibleCreateModeValues

func PossibleCreateModeValues() []CreateMode

PossibleCreateModeValues returns the possible values for the CreateMode const type.

type Database

type Database struct {
	// The properties of a database.
	Properties *DatabaseProperties

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

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

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

Database - Represents a Database.

func (Database) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Database.

func (*Database) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Database.

type DatabaseListResult

type DatabaseListResult struct {
	// The list of databases housed in a server
	Value []*Database
}

DatabaseListResult - A List of databases.

func (DatabaseListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseListResult.

func (*DatabaseListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseListResult.

type DatabaseProperties

type DatabaseProperties struct {
	// The charset of the database.
	Charset *string

	// The collation of the database.
	Collation *string
}

DatabaseProperties - The properties of a database.

func (DatabaseProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DatabaseProperties.

func (*DatabaseProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseProperties.

type DatabasesClient

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

DatabasesClient contains the methods for the Databases group. Don't use this type directly, use NewDatabasesClient() instead.

func NewDatabasesClient

func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabasesClient, error)

NewDatabasesClient creates a new instance of DatabasesClient 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 (*DatabasesClient) BeginCreateOrUpdate

func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabasesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates a new database or updates an existing database. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • databaseName - The name of the database.
  • parameters - The required parameters for creating or updating a database.
  • options - DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseCreate.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "db1", armpostgresql.Database{
		Properties: &armpostgresql.DatabaseProperties{
			Charset:   to.Ptr("UTF8"),
			Collation: to.Ptr("English_United States.1252"),
		},
	}, 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.Database = armpostgresql.Database{
	// 	Name: to.Ptr("db1"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"),
	// 	Properties: &armpostgresql.DatabaseProperties{
	// 		Charset: to.Ptr("UTF8"),
	// 		Collation: to.Ptr("English_United States.1252"),
	// 	},
	// }
}
Output:

func (*DatabasesClient) BeginDelete

func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*runtime.Poller[DatabasesClientDeleteResponse], error)

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

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • databaseName - The name of the database.
  • options - DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "TestGroup", "testserver", "db1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*DatabasesClient) Get

func (client *DatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientGetOptions) (DatabasesClientGetResponse, error)

Get - Gets information about a database. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • databaseName - The name of the database.
  • options - DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDatabasesClient().Get(ctx, "TestGroup", "testserver", "db1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Database = armpostgresql.Database{
	// 	Name: to.Ptr("db1"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"),
	// 	Properties: &armpostgresql.DatabaseProperties{
	// 		Charset: to.Ptr("UTF8"),
	// 		Collation: to.Ptr("English_United States.1252"),
	// 	},
	// }
}
Output:

func (*DatabasesClient) NewListByServerPager added in v0.5.0

func (client *DatabasesClient) NewListByServerPager(resourceGroupName string, serverName string, options *DatabasesClientListByServerOptions) *runtime.Pager[DatabasesClientListByServerResponse]

NewListByServerPager - List all the databases in a given server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDatabasesClient().NewListByServerPager("TestGroup", "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.DatabaseListResult = armpostgresql.DatabaseListResult{
		// 	Value: []*armpostgresql.Database{
		// 		{
		// 			Name: to.Ptr("db1"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"),
		// 			Properties: &armpostgresql.DatabaseProperties{
		// 				Charset: to.Ptr("UTF8"),
		// 				Collation: to.Ptr("English_United States.1252"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("db2"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db2"),
		// 			Properties: &armpostgresql.DatabaseProperties{
		// 				Charset: to.Ptr("UTF8"),
		// 				Collation: to.Ptr("English_United States.1252"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type DatabasesClientBeginCreateOrUpdateOptions added in v0.3.0

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

DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate method.

type DatabasesClientBeginDeleteOptions added in v0.3.0

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

DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method.

type DatabasesClientCreateOrUpdateResponse added in v0.3.0

type DatabasesClientCreateOrUpdateResponse struct {
	// Represents a Database.
	Database
}

DatabasesClientCreateOrUpdateResponse contains the response from method DatabasesClient.BeginCreateOrUpdate.

type DatabasesClientDeleteResponse added in v0.3.0

type DatabasesClientDeleteResponse struct {
}

DatabasesClientDeleteResponse contains the response from method DatabasesClient.BeginDelete.

type DatabasesClientGetOptions added in v0.3.0

type DatabasesClientGetOptions struct {
}

DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method.

type DatabasesClientGetResponse added in v0.3.0

type DatabasesClientGetResponse struct {
	// Represents a Database.
	Database
}

DatabasesClientGetResponse contains the response from method DatabasesClient.Get.

type DatabasesClientListByServerOptions added in v0.3.0

type DatabasesClientListByServerOptions struct {
}

DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.NewListByServerPager method.

type DatabasesClientListByServerResponse added in v0.3.0

type DatabasesClientListByServerResponse struct {
	// A List of databases.
	DatabaseListResult
}

DatabasesClientListByServerResponse contains the response from method DatabasesClient.NewListByServerPager.

type ErrorAdditionalInfo

type ErrorAdditionalInfo struct {
	// READ-ONLY; The additional info.
	Info any

	// READ-ONLY; The additional info type.
	Type *string
}

ErrorAdditionalInfo - The resource management error additional info.

func (ErrorAdditionalInfo) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.

func (*ErrorAdditionalInfo) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.

type ErrorResponse

type ErrorResponse struct {
	// READ-ONLY; The error additional info.
	AdditionalInfo []*ErrorAdditionalInfo

	// READ-ONLY; The error code.
	Code *string

	// READ-ONLY; The error details.
	Details []*ErrorResponse

	// READ-ONLY; The error message.
	Message *string

	// READ-ONLY; The error target.
	Target *string
}

ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)

func (ErrorResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type FirewallRule

type FirewallRule struct {
	// REQUIRED; The properties of a firewall rule.
	Properties *FirewallRuleProperties

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

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

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

FirewallRule - Represents a server 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 v1.1.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.
	Value []*FirewallRule
}

FirewallRuleListResult - A list of firewall rules.

func (FirewallRuleListResult) MarshalJSON

func (f FirewallRuleListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FirewallRuleListResult.

func (*FirewallRuleListResult) UnmarshalJSON added in v1.1.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 firewall rule. Must be IPv4 format.
	EndIPAddress *string

	// REQUIRED; The start IP address of the server firewall rule. Must be IPv4 format.
	StartIPAddress *string
}

FirewallRuleProperties - The properties of a server firewall rule.

func (FirewallRuleProperties) MarshalJSON added in v1.1.0

func (f FirewallRuleProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FirewallRuleProperties.

func (*FirewallRuleProperties) UnmarshalJSON added in v1.1.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, serverName 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 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • firewallRuleName - The name of the server 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "rule1", armpostgresql.FirewallRule{
		Properties: &armpostgresql.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 = armpostgresql.FirewallRule{
	// 	Name: to.Ptr("rule1"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"),
	// 	Properties: &armpostgresql.FirewallRuleProperties{
	// 		EndIPAddress: to.Ptr("255.255.255.255"),
	// 		StartIPAddress: to.Ptr("0.0.0.0"),
	// 	},
	// }
}
Output:

func (*FirewallRulesClient) BeginDelete

func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*runtime.Poller[FirewallRulesClientDeleteResponse], error)

BeginDelete - Deletes a server firewall rule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • firewallRuleName - The name of the server 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "TestGroup", "testserver", "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, serverName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (FirewallRulesClientGetResponse, error)

Get - Gets information about a server firewall rule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • firewallRuleName - The name of the server 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "TestGroup", "testserver", "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 = armpostgresql.FirewallRule{
	// 	Name: to.Ptr("rule1"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"),
	// 	Properties: &armpostgresql.FirewallRuleProperties{
	// 		EndIPAddress: to.Ptr("255.255.255.255"),
	// 		StartIPAddress: to.Ptr("0.0.0.0"),
	// 	},
	// }
}
Output:

func (*FirewallRulesClient) NewListByServerPager added in v0.5.0

func (client *FirewallRulesClient) NewListByServerPager(resourceGroupName string, serverName string, options *FirewallRulesClientListByServerOptions) *runtime.Pager[FirewallRulesClientListByServerResponse]

NewListByServerPager - List all the firewall rules in a given server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewFirewallRulesClient().NewListByServerPager("TestGroup", "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.FirewallRuleListResult = armpostgresql.FirewallRuleListResult{
		// 	Value: []*armpostgresql.FirewallRule{
		// 		{
		// 			Name: to.Ptr("rule1"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"),
		// 			Properties: &armpostgresql.FirewallRuleProperties{
		// 				EndIPAddress: to.Ptr("255.255.255.255"),
		// 				StartIPAddress: to.Ptr("0.0.0.0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("rule2"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule2"),
		// 			Properties: &armpostgresql.FirewallRuleProperties{
		// 				EndIPAddress: to.Ptr("255.0.0.0"),
		// 				StartIPAddress: to.Ptr("1.0.0.0"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type FirewallRulesClientBeginCreateOrUpdateOptions added in v0.3.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.3.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.3.0

type FirewallRulesClientCreateOrUpdateResponse struct {
	// Represents a server firewall rule.
	FirewallRule
}

FirewallRulesClientCreateOrUpdateResponse contains the response from method FirewallRulesClient.BeginCreateOrUpdate.

type FirewallRulesClientDeleteResponse added in v0.3.0

type FirewallRulesClientDeleteResponse struct {
}

FirewallRulesClientDeleteResponse contains the response from method FirewallRulesClient.BeginDelete.

type FirewallRulesClientGetOptions added in v0.3.0

type FirewallRulesClientGetOptions struct {
}

FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method.

type FirewallRulesClientGetResponse added in v0.3.0

type FirewallRulesClientGetResponse struct {
	// Represents a server firewall rule.
	FirewallRule
}

FirewallRulesClientGetResponse contains the response from method FirewallRulesClient.Get.

type FirewallRulesClientListByServerOptions added in v0.3.0

type FirewallRulesClientListByServerOptions struct {
}

FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.NewListByServerPager method.

type FirewallRulesClientListByServerResponse added in v0.3.0

type FirewallRulesClientListByServerResponse struct {
	// A list of firewall rules.
	FirewallRuleListResult
}

FirewallRulesClientListByServerResponse contains the response from method FirewallRulesClient.NewListByServerPager.

type GeoRedundantBackup

type GeoRedundantBackup string

GeoRedundantBackup - Enable Geo-redundant or not for server backup.

const (
	GeoRedundantBackupDisabled GeoRedundantBackup = "Disabled"
	GeoRedundantBackupEnabled  GeoRedundantBackup = "Enabled"
)

func PossibleGeoRedundantBackupValues

func PossibleGeoRedundantBackupValues() []GeoRedundantBackup

PossibleGeoRedundantBackupValues returns the possible values for the GeoRedundantBackup const type.

type IdentityType

type IdentityType string

IdentityType - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.

const (
	IdentityTypeSystemAssigned IdentityType = "SystemAssigned"
)

func PossibleIdentityTypeValues

func PossibleIdentityTypeValues() []IdentityType

PossibleIdentityTypeValues returns the possible values for the IdentityType const type.

type InfrastructureEncryption

type InfrastructureEncryption string

InfrastructureEncryption - Add a second layer of encryption for your data using new encryption algorithm which gives additional data protection. Value is optional but if passed in, must be 'Disabled' or 'Enabled'.

const (
	// InfrastructureEncryptionDisabled - Additional (2nd) layer of encryption for data at rest
	InfrastructureEncryptionDisabled InfrastructureEncryption = "Disabled"
	// InfrastructureEncryptionEnabled - Default value for single layer of encryption for data at rest.
	InfrastructureEncryptionEnabled InfrastructureEncryption = "Enabled"
)

func PossibleInfrastructureEncryptionValues

func PossibleInfrastructureEncryptionValues() []InfrastructureEncryption

PossibleInfrastructureEncryptionValues returns the possible values for the InfrastructureEncryption const type.

type LocationBasedPerformanceTierClient

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

LocationBasedPerformanceTierClient contains the methods for the LocationBasedPerformanceTier group. Don't use this type directly, use NewLocationBasedPerformanceTierClient() instead.

func NewLocationBasedPerformanceTierClient

func NewLocationBasedPerformanceTierClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationBasedPerformanceTierClient, error)

NewLocationBasedPerformanceTierClient creates a new instance of LocationBasedPerformanceTierClient 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 (*LocationBasedPerformanceTierClient) NewListPager added in v0.5.0

NewListPager - List all the performance tiers at specified location in a given subscription.

Generated from API version 2017-12-01

  • locationName - The name of the location.
  • options - LocationBasedPerformanceTierClientListOptions contains the optional parameters for the LocationBasedPerformanceTierClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/PerformanceTiersListByLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLocationBasedPerformanceTierClient().NewListPager("WestUS", 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.PerformanceTierListResult = armpostgresql.PerformanceTierListResult{
		// 	Value: []*armpostgresql.PerformanceTierProperties{
		// 		{
		// 			ID: to.Ptr("Basic"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](0),
		// 			MaxStorageMB: to.Ptr[int32](2097152),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("Basic"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("B_Gen5_1"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](1048576),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](1),
		// 				},
		// 				{
		// 					Edition: to.Ptr("Basic"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("B_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](1048576),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 			}},
		// 		},
		// 		{
		// 			ID: to.Ptr("GeneralPurpose"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](16777216),
		// 			MaxStorageMB: to.Ptr[int32](16777216),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_4"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](4),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_8"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](8),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_16"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](16),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_32"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_64"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 			}},
		// 		},
		// 		{
		// 			ID: to.Ptr("MemoryOptimized"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](16777216),
		// 			MaxStorageMB: to.Ptr[int32](16777216),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_4"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](4),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_8"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](8),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_16"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](16),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_32"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 			}},
		// 	}},
		// }
	}
}
Output:

type LocationBasedPerformanceTierClientListOptions added in v0.3.0

type LocationBasedPerformanceTierClientListOptions struct {
}

LocationBasedPerformanceTierClientListOptions contains the optional parameters for the LocationBasedPerformanceTierClient.NewListPager method.

type LocationBasedPerformanceTierClientListResponse added in v0.3.0

type LocationBasedPerformanceTierClientListResponse struct {
	// A list of performance tiers.
	PerformanceTierListResult
}

LocationBasedPerformanceTierClientListResponse contains the response from method LocationBasedPerformanceTierClient.NewListPager.

type LogFile

type LogFile struct {
	// The properties of the log file.
	Properties *LogFileProperties

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

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

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

LogFile - Represents a log file.

func (LogFile) MarshalJSON

func (l LogFile) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LogFile.

func (*LogFile) UnmarshalJSON added in v1.1.0

func (l *LogFile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LogFile.

type LogFileListResult

type LogFileListResult struct {
	// The list of log files.
	Value []*LogFile
}

LogFileListResult - A list of log files.

func (LogFileListResult) MarshalJSON

func (l LogFileListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LogFileListResult.

func (*LogFileListResult) UnmarshalJSON added in v1.1.0

func (l *LogFileListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LogFileListResult.

type LogFileProperties

type LogFileProperties struct {
	// Size of the log file.
	SizeInKB *int64

	// Type of the log file.
	Type *string

	// The url to download the log file from.
	URL *string

	// READ-ONLY; Creation timestamp of the log file.
	CreatedTime *time.Time

	// READ-ONLY; Last modified timestamp of the log file.
	LastModifiedTime *time.Time
}

LogFileProperties - The properties of a log file.

func (LogFileProperties) MarshalJSON

func (l LogFileProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LogFileProperties.

func (*LogFileProperties) UnmarshalJSON

func (l *LogFileProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LogFileProperties.

type LogFilesClient

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

LogFilesClient contains the methods for the LogFiles group. Don't use this type directly, use NewLogFilesClient() instead.

func NewLogFilesClient

func NewLogFilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LogFilesClient, error)

NewLogFilesClient creates a new instance of LogFilesClient 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 (*LogFilesClient) NewListByServerPager added in v0.5.0

func (client *LogFilesClient) NewListByServerPager(resourceGroupName string, serverName string, options *LogFilesClientListByServerOptions) *runtime.Pager[LogFilesClientListByServerResponse]

NewListByServerPager - List all the log files in a given server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - LogFilesClientListByServerOptions contains the optional parameters for the LogFilesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/LogFileListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLogFilesClient().NewListByServerPager("TestGroup", "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.LogFileListResult = armpostgresql.LogFileListResult{
		// 	Value: []*armpostgresql.LogFile{
		// 		{
		// 			Name: to.Ptr("postgresql-2017-06-22_010000.log"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/logFiles"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/logFiles/postgresql-2017-06-22_010000.log"),
		// 			Properties: &armpostgresql.LogFileProperties{
		// 				Type: to.Ptr("text"),
		// 				CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()),
		// 				LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-22T01:59:36.000Z"); return t}()),
		// 				SizeInKB: to.Ptr[int64](4),
		// 				URL: to.Ptr("https://wasd2stageneu1btlm4.file.core.windows.net/42679871f6cc4302b39ab9c2e3044df3/pg_log/postgresql-2017-06-22_010000.log?sv=2015-04-05&sr=f&sig=gqIQsa6VyGyUNpzYYPWLP5gM%2BeF1so9GYbHKu6Zs0DM%3D&se=2017-06-22T03%3A21%3A09Z&sp=r"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("postgresql-2017-06-22_020000.log"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/logFiles"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/logFiles/postgresql-2017-06-22_020000.log"),
		// 			Properties: &armpostgresql.LogFileProperties{
		// 				Type: to.Ptr("text"),
		// 				CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()),
		// 				LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-22T02:19:36.000Z"); return t}()),
		// 				SizeInKB: to.Ptr[int64](1),
		// 				URL: to.Ptr("https://wasd2stageneu1btlm4.file.core.windows.net/42679871f6cc4302b39ab9c2e3044df3/pg_log/postgresql-2017-06-22_020000.log?sv=2015-04-05&sr=f&sig=i99UWBlYfR0tKaxix8yHAOnfym4HV9Auto6BbZogyRs%3D&se=2017-06-22T03%3A21%3A09Z&sp=r"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type LogFilesClientListByServerOptions added in v0.3.0

type LogFilesClientListByServerOptions struct {
}

LogFilesClientListByServerOptions contains the optional parameters for the LogFilesClient.NewListByServerPager method.

type LogFilesClientListByServerResponse added in v0.3.0

type LogFilesClientListByServerResponse struct {
	// A list of log files.
	LogFileListResult
}

LogFilesClientListByServerResponse contains the response from method LogFilesClient.NewListByServerPager.

type MinimalTLSVersionEnum

type MinimalTLSVersionEnum string

MinimalTLSVersionEnum - Enforce a minimal Tls version for the server.

const (
	MinimalTLSVersionEnumTLS10                  MinimalTLSVersionEnum = "TLS1_0"
	MinimalTLSVersionEnumTLS11                  MinimalTLSVersionEnum = "TLS1_1"
	MinimalTLSVersionEnumTLS12                  MinimalTLSVersionEnum = "TLS1_2"
	MinimalTLSVersionEnumTLSEnforcementDisabled MinimalTLSVersionEnum = "TLSEnforcementDisabled"
)

func PossibleMinimalTLSVersionEnumValues

func PossibleMinimalTLSVersionEnumValues() []MinimalTLSVersionEnum

PossibleMinimalTLSVersionEnumValues returns the possible values for the MinimalTLSVersionEnum const type.

type NameAvailability

type NameAvailability struct {
	// Error Message.
	Message *string

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

	// Reason for name being unavailable.
	Reason *string
}

NameAvailability - Represents a resource name availability.

func (NameAvailability) MarshalJSON added in v1.1.0

func (n NameAvailability) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NameAvailability.

func (*NameAvailability) UnmarshalJSON added in v1.1.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

	// Resource type used for verification.
	Type *string
}

NameAvailabilityRequest - Request from client to check resource name availability.

func (NameAvailabilityRequest) MarshalJSON added in v1.1.0

func (n NameAvailabilityRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NameAvailabilityRequest.

func (*NameAvailabilityRequest) UnmarshalJSON added in v1.1.0

func (n *NameAvailabilityRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityRequest.

type Operation

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

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

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

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

Operation - REST API operation definition.

func (Operation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; Operation description.
	Description *string

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

	// READ-ONLY; Operation resource provider name.
	Provider *string

	// READ-ONLY; Resource on which the operation is performed.
	Resource *string
}

OperationDisplay - Display metadata associated with the operation.

func (OperationDisplay) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// The list of resource provider operations.
	Value []*Operation
}

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 v1.1.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) List

List - Lists all of the available REST API operations. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOperationsClient().List(ctx, 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.OperationListResult = armpostgresql.OperationListResult{
	// 	Value: []*armpostgresql.Operation{
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/performanceTiers/read"),
	// 			Display: &armpostgresql.OperationDisplay{
	// 				Description: to.Ptr("Returns the list of Performance Tiers available."),
	// 				Operation: to.Ptr("List Performance Tiers"),
	// 				Provider: to.Ptr("Microsoft DB for PostgreSQL"),
	// 				Resource: to.Ptr("Performance Tiers"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/read"),
	// 			Display: &armpostgresql.OperationDisplay{
	// 				Description: to.Ptr("Return the list of servers or gets the properties for the specified server."),
	// 				Operation: to.Ptr("List/Get PostgreSQL Servers"),
	// 				Provider: to.Ptr("Microsoft DB for PostgreSQL"),
	// 				Resource: to.Ptr("PostgreSQL Server"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/write"),
	// 			Display: &armpostgresql.OperationDisplay{
	// 				Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."),
	// 				Operation: to.Ptr("Create/Update PostgreSQL Server"),
	// 				Provider: to.Ptr("Microsoft DB for PostgreSQL"),
	// 				Resource: to.Ptr("PostgreSQL Server"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/delete"),
	// 			Display: &armpostgresql.OperationDisplay{
	// 				Description: to.Ptr("Deletes an existing server."),
	// 				Operation: to.Ptr("Delete PostgreSQL Server"),
	// 				Provider: to.Ptr("Microsoft DB for PostgreSQL"),
	// 				Resource: to.Ptr("PostgreSQL Server"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforPostgreSQL/performanceTiers/read"),
	// 			Display: &armpostgresql.OperationDisplay{
	// 				Description: to.Ptr("Returns the list of Performance Tiers available."),
	// 				Operation: to.Ptr("List Performance Tiers"),
	// 				Provider: to.Ptr("Microsoft DB for PostgreSQL"),
	// 				Resource: to.Ptr("Performance Tiers"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/read"),
	// 			Display: &armpostgresql.OperationDisplay{
	// 				Description: to.Ptr("Return the list of firewall rules for a server 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/servers/firewallRules/write"),
	// 			Display: &armpostgresql.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/servers/firewallRules/delete"),
	// 			Display: &armpostgresql.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/servers/providers/Microsoft.Insights/metricDefinitions/read"),
	// 			Display: &armpostgresql.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/servers/providers/Microsoft.Insights/diagnosticSettings/read"),
	// 			Display: &armpostgresql.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/servers/providers/Microsoft.Insights/diagnosticSettings/write"),
	// 			Display: &armpostgresql.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.3.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	// A list of resource provider operations.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type PerformanceTierListResult

type PerformanceTierListResult struct {
	// The list of performance tiers
	Value []*PerformanceTierProperties
}

PerformanceTierListResult - A list of performance tiers.

func (PerformanceTierListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PerformanceTierListResult.

func (*PerformanceTierListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceTierListResult.

type PerformanceTierProperties

type PerformanceTierProperties struct {
	// ID of the performance tier.
	ID *string

	// Maximum Backup retention in days for the performance tier edition
	MaxBackupRetentionDays *int32

	// Max storage allowed for a server.
	MaxLargeStorageMB *int32

	// Max storage allowed for a server.
	MaxStorageMB *int32

	// Minimum Backup retention in days for the performance tier edition
	MinBackupRetentionDays *int32

	// Max storage allowed for a server.
	MinLargeStorageMB *int32

	// Max storage allowed for a server.
	MinStorageMB *int32

	// Service level objectives associated with the performance tier
	ServiceLevelObjectives []*PerformanceTierServiceLevelObjectives
}

PerformanceTierProperties - Performance tier properties

func (PerformanceTierProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PerformanceTierProperties.

func (*PerformanceTierProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceTierProperties.

type PerformanceTierServiceLevelObjectives

type PerformanceTierServiceLevelObjectives struct {
	// Edition of the performance tier.
	Edition *string

	// Hardware generation associated with the service level objective
	HardwareGeneration *string

	// ID for the service level objective.
	ID *string

	// Maximum Backup retention in days for the performance tier edition
	MaxBackupRetentionDays *int32

	// Max storage allowed for a server.
	MaxStorageMB *int32

	// Minimum Backup retention in days for the performance tier edition
	MinBackupRetentionDays *int32

	// Max storage allowed for a server.
	MinStorageMB *int32

	// vCore associated with the service level objective
	VCore *int32
}

PerformanceTierServiceLevelObjectives - Service level objectives for performance tier.

func (PerformanceTierServiceLevelObjectives) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type PerformanceTierServiceLevelObjectives.

func (*PerformanceTierServiceLevelObjectives) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceTierServiceLevelObjectives.

type PrivateEndpointConnection

type PrivateEndpointConnection struct {
	// Resource properties.
	Properties *PrivateEndpointConnectionProperties

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

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

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

PrivateEndpointConnection - A private endpoint connection

func (PrivateEndpointConnection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.

func (*PrivateEndpointConnection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.

type PrivateEndpointConnectionListResult

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

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

PrivateEndpointConnectionListResult - A list of private endpoint connections.

func (PrivateEndpointConnectionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.

func (*PrivateEndpointConnectionListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.

type PrivateEndpointConnectionProperties

type PrivateEndpointConnectionProperties struct {
	// Private endpoint which the connection belongs to.
	PrivateEndpoint *PrivateEndpointProperty

	// Connection state of the private endpoint connection.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty

	// READ-ONLY; State of the private endpoint connection.
	ProvisioningState *string
}

PrivateEndpointConnectionProperties - Properties of a private endpoint connection.

func (PrivateEndpointConnectionProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.

func (*PrivateEndpointConnectionProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.

type PrivateEndpointConnectionsClient

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

PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead.

func NewPrivateEndpointConnectionsClient

func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values.

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

func (*PrivateEndpointConnectionsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdate.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "Default", "test-svr", "private-endpoint-connection-name", armpostgresql.PrivateEndpointConnection{
		Properties: &armpostgresql.PrivateEndpointConnectionProperties{
			PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{
				Description: to.Ptr("Approved by johndoe@contoso.com"),
				Status:      to.Ptr("Approved"),
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PrivateEndpointConnection = armpostgresql.PrivateEndpointConnection{
	// 	Name: to.Ptr("private-endpoint-connection-name"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"),
	// 	Properties: &armpostgresql.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{
	// 			ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{
	// 			Description: to.Ptr("Approved by johndoe@contoso.com"),
	// 			ActionsRequired: to.Ptr("None"),
	// 			Status: to.Ptr("Approved"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) BeginDelete

func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)

BeginDelete - Deletes a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "Default", "test-svr", "private-endpoint-connection-name", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*PrivateEndpointConnectionsClient) BeginUpdateTags

func (client *PrivateEndpointConnectionsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters TagsObject, options *PrivateEndpointConnectionsClientBeginUpdateTagsOptions) (*runtime.Poller[PrivateEndpointConnectionsClientUpdateTagsResponse], error)

BeginUpdateTags - Updates private endpoint connection with the specified tags. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • parameters - Parameters supplied to the Update private endpoint connection Tags operation.
  • options - PrivateEndpointConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdateTags method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdateTags.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginUpdateTags(ctx, "Default", "test-svr", "private-endpoint-connection-name", armpostgresql.TagsObject{
		Tags: map[string]*string{
			"key1": to.Ptr("val1"),
			"key2": to.Ptr("val2"),
			"key3": to.Ptr("val3"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PrivateEndpointConnection = armpostgresql.PrivateEndpointConnection{
	// 	Name: to.Ptr("private-endpoint-connection-name"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"),
	// 	Properties: &armpostgresql.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{
	// 			ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{
	// 			Description: to.Ptr("Approved by johndoe@contoso.com"),
	// 			ActionsRequired: to.Ptr("None"),
	// 			Status: to.Ptr("Approved"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) Get

func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)

Get - Gets a private endpoint connection. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • privateEndpointConnectionName - The name of the private endpoint connection.
  • options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "Default", "test-svr", "private-endpoint-connection-name", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PrivateEndpointConnection = armpostgresql.PrivateEndpointConnection{
	// 	Name: to.Ptr("private-endpoint-connection-name"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"),
	// 	Properties: &armpostgresql.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{
	// 			ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{
	// 			Description: to.Ptr("Auto-approved"),
	// 			ActionsRequired: to.Ptr("None"),
	// 			Status: to.Ptr("Approved"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) NewListByServerPager added in v0.5.0

NewListByServerPager - Gets all private endpoint connections on a server.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByServerPager("Default", "test-svr", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.PrivateEndpointConnectionListResult = armpostgresql.PrivateEndpointConnectionListResult{
		// 	Value: []*armpostgresql.PrivateEndpointConnection{
		// 		{
		// 			Name: to.Ptr("private-endpoint-connection-name"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"),
		// 			Properties: &armpostgresql.PrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{
		// 					ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{
		// 					Description: to.Ptr("Auto-approved"),
		// 					ActionsRequired: to.Ptr("None"),
		// 					Status: to.Ptr("Approved"),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("private-endpoint-connection-name-2"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"),
		// 			Properties: &armpostgresql.PrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{
		// 					ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{
		// 					Description: to.Ptr("Auto-approved"),
		// 					ActionsRequired: to.Ptr("None"),
		// 					Status: to.Ptr("Approved"),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions added in v0.3.0

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

PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.

type PrivateEndpointConnectionsClientBeginDeleteOptions added in v0.3.0

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

PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.

type PrivateEndpointConnectionsClientBeginUpdateTagsOptions added in v0.3.0

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

PrivateEndpointConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdateTags method.

type PrivateEndpointConnectionsClientCreateOrUpdateResponse added in v0.3.0

type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct {
	// A private endpoint connection
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate.

type PrivateEndpointConnectionsClientDeleteResponse added in v0.3.0

type PrivateEndpointConnectionsClientDeleteResponse struct {
}

PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete.

type PrivateEndpointConnectionsClientGetOptions added in v0.3.0

type PrivateEndpointConnectionsClientGetOptions struct {
}

PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.

type PrivateEndpointConnectionsClientGetResponse added in v0.3.0

type PrivateEndpointConnectionsClientGetResponse struct {
	// A private endpoint connection
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.

type PrivateEndpointConnectionsClientListByServerOptions added in v0.3.0

type PrivateEndpointConnectionsClientListByServerOptions struct {
}

PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServerPager method.

type PrivateEndpointConnectionsClientListByServerResponse added in v0.3.0

type PrivateEndpointConnectionsClientListByServerResponse struct {
	// A list of private endpoint connections.
	PrivateEndpointConnectionListResult
}

PrivateEndpointConnectionsClientListByServerResponse contains the response from method PrivateEndpointConnectionsClient.NewListByServerPager.

type PrivateEndpointConnectionsClientUpdateTagsResponse added in v0.3.0

type PrivateEndpointConnectionsClientUpdateTagsResponse struct {
	// A private endpoint connection
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientUpdateTagsResponse contains the response from method PrivateEndpointConnectionsClient.BeginUpdateTags.

type PrivateEndpointProperty

type PrivateEndpointProperty struct {
	// Resource id of the private endpoint.
	ID *string
}

func (PrivateEndpointProperty) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperty.

func (*PrivateEndpointProperty) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperty.

type PrivateEndpointProvisioningState

type PrivateEndpointProvisioningState string

PrivateEndpointProvisioningState - State of the private endpoint connection.

const (
	PrivateEndpointProvisioningStateApproving PrivateEndpointProvisioningState = "Approving"
	PrivateEndpointProvisioningStateDropping  PrivateEndpointProvisioningState = "Dropping"
	PrivateEndpointProvisioningStateFailed    PrivateEndpointProvisioningState = "Failed"
	PrivateEndpointProvisioningStateReady     PrivateEndpointProvisioningState = "Ready"
	PrivateEndpointProvisioningStateRejecting PrivateEndpointProvisioningState = "Rejecting"
)

func PossiblePrivateEndpointProvisioningStateValues

func PossiblePrivateEndpointProvisioningStateValues() []PrivateEndpointProvisioningState

PossiblePrivateEndpointProvisioningStateValues returns the possible values for the PrivateEndpointProvisioningState const type.

type PrivateLinkResource

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

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

	// READ-ONLY; The private link resource group id.
	Properties *PrivateLinkResourceProperties

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

PrivateLinkResource - A private link resource

func (PrivateLinkResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.

func (*PrivateLinkResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.

type PrivateLinkResourceListResult

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

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

PrivateLinkResourceListResult - A list of private link resources

func (PrivateLinkResourceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.

func (*PrivateLinkResourceListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.

type PrivateLinkResourceProperties

type PrivateLinkResourceProperties struct {
	// READ-ONLY; The private link resource group id.
	GroupID *string

	// READ-ONLY; The private link resource required member names.
	RequiredMembers []*string
}

PrivateLinkResourceProperties - Properties of a private link resource.

func (PrivateLinkResourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.

func (*PrivateLinkResourceProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.

type PrivateLinkResourcesClient

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

PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. Don't use this type directly, use NewPrivateLinkResourcesClient() instead.

func NewPrivateLinkResourcesClient

func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error)

NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values.

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

func (*PrivateLinkResourcesClient) Get

Get - Gets a private link resource for PostgreSQL server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • groupName - The name of the private link resource.
  • options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateLinkResourcesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "Default", "test-svr", "plr", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PrivateLinkResource = armpostgresql.PrivateLinkResource{
	// 	Name: to.Ptr("plr"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateLinkResources"),
	// 	ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateLinkResources/plr"),
	// 	Properties: &armpostgresql.PrivateLinkResourceProperties{
	// 		GroupID: to.Ptr("postgresqlServer"),
	// 		RequiredMembers: []*string{
	// 			to.Ptr("postgresqlServer")},
	// 		},
	// 	}
}
Output:

func (*PrivateLinkResourcesClient) NewListByServerPager added in v0.5.0

NewListByServerPager - Gets the private link resources for PostgreSQL server.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateLinkResourcesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateLinkResourcesClient().NewListByServerPager("Default", "test-svr", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.PrivateLinkResourceListResult = armpostgresql.PrivateLinkResourceListResult{
		// 	Value: []*armpostgresql.PrivateLinkResource{
		// 		{
		// 			Name: to.Ptr("plr"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateLinkResources"),
		// 			ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateLinkResources/plr"),
		// 			Properties: &armpostgresql.PrivateLinkResourceProperties{
		// 				GroupID: to.Ptr("postgresqlServer"),
		// 				RequiredMembers: []*string{
		// 					to.Ptr("postgresqlServer")},
		// 				},
		// 		}},
		// 	}
	}
}
Output:

type PrivateLinkResourcesClientGetOptions added in v0.3.0

type PrivateLinkResourcesClientGetOptions struct {
}

PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method.

type PrivateLinkResourcesClientGetResponse added in v0.3.0

type PrivateLinkResourcesClientGetResponse struct {
	// A private link resource
	PrivateLinkResource
}

PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get.

type PrivateLinkResourcesClientListByServerOptions added in v0.3.0

type PrivateLinkResourcesClientListByServerOptions struct {
}

PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager method.

type PrivateLinkResourcesClientListByServerResponse added in v0.3.0

type PrivateLinkResourcesClientListByServerResponse struct {
	// A list of private link resources
	PrivateLinkResourceListResult
}

PrivateLinkResourcesClientListByServerResponse contains the response from method PrivateLinkResourcesClient.NewListByServerPager.

type PrivateLinkServiceConnectionStateActionsRequire

type PrivateLinkServiceConnectionStateActionsRequire string

PrivateLinkServiceConnectionStateActionsRequire - The actions required for private link service connection.

const (
	PrivateLinkServiceConnectionStateActionsRequireNone PrivateLinkServiceConnectionStateActionsRequire = "None"
)

func PossiblePrivateLinkServiceConnectionStateActionsRequireValues

func PossiblePrivateLinkServiceConnectionStateActionsRequireValues() []PrivateLinkServiceConnectionStateActionsRequire

PossiblePrivateLinkServiceConnectionStateActionsRequireValues returns the possible values for the PrivateLinkServiceConnectionStateActionsRequire const type.

type PrivateLinkServiceConnectionStateProperty

type PrivateLinkServiceConnectionStateProperty struct {
	// REQUIRED; The private link service connection description.
	Description *string

	// REQUIRED; The private link service connection status.
	Status *string

	// READ-ONLY; The actions required for private link service connection.
	ActionsRequired *string
}

func (PrivateLinkServiceConnectionStateProperty) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionStateProperty.

func (*PrivateLinkServiceConnectionStateProperty) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionStateProperty.

type PrivateLinkServiceConnectionStateStatus

type PrivateLinkServiceConnectionStateStatus string

PrivateLinkServiceConnectionStateStatus - The private link service connection status.

const (
	PrivateLinkServiceConnectionStateStatusApproved     PrivateLinkServiceConnectionStateStatus = "Approved"
	PrivateLinkServiceConnectionStateStatusDisconnected PrivateLinkServiceConnectionStateStatus = "Disconnected"
	PrivateLinkServiceConnectionStateStatusPending      PrivateLinkServiceConnectionStateStatus = "Pending"
	PrivateLinkServiceConnectionStateStatusRejected     PrivateLinkServiceConnectionStateStatus = "Rejected"
)

func PossiblePrivateLinkServiceConnectionStateStatusValues

func PossiblePrivateLinkServiceConnectionStateStatusValues() []PrivateLinkServiceConnectionStateStatus

PossiblePrivateLinkServiceConnectionStateStatusValues returns the possible values for the PrivateLinkServiceConnectionStateStatus const type.

type ProxyResource

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

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

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

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

func (ProxyResource) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ProxyResource.

func (*ProxyResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.

type PublicNetworkAccessEnum

type PublicNetworkAccessEnum string

PublicNetworkAccessEnum - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'

const (
	PublicNetworkAccessEnumDisabled PublicNetworkAccessEnum = "Disabled"
	PublicNetworkAccessEnumEnabled  PublicNetworkAccessEnum = "Enabled"
)

func PossiblePublicNetworkAccessEnumValues

func PossiblePublicNetworkAccessEnumValues() []PublicNetworkAccessEnum

PossiblePublicNetworkAccessEnumValues returns the possible values for the PublicNetworkAccessEnum const type.

type RecoverableServerProperties

type RecoverableServerProperties struct {
	// READ-ONLY; Edition of the performance tier.
	Edition *string

	// READ-ONLY; Hardware generation associated with the service level objective
	HardwareGeneration *string

	// READ-ONLY; The last available backup date time.
	LastAvailableBackupDateTime *string

	// READ-ONLY; The service level objective
	ServiceLevelObjective *string

	// READ-ONLY; vCore associated with the service level objective
	VCore *int32

	// READ-ONLY; The PostgreSQL version
	Version *string
}

RecoverableServerProperties - The recoverable server's properties.

func (RecoverableServerProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type RecoverableServerProperties.

func (*RecoverableServerProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableServerProperties.

type RecoverableServerResource

type RecoverableServerResource struct {
	// Resource properties.
	Properties *RecoverableServerProperties

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

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

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

RecoverableServerResource - A recoverable server resource.

func (RecoverableServerResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecoverableServerResource.

func (*RecoverableServerResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableServerResource.

type RecoverableServersClient

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

RecoverableServersClient contains the methods for the RecoverableServers group. Don't use this type directly, use NewRecoverableServersClient() instead.

func NewRecoverableServersClient

func NewRecoverableServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecoverableServersClient, error)

NewRecoverableServersClient creates a new instance of RecoverableServersClient 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 (*RecoverableServersClient) Get

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

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - RecoverableServersClientGetOptions contains the optional parameters for the RecoverableServersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/RecoverableServersGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecoverableServersClient().Get(ctx, "testrg", "pgtestsvc4", 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.RecoverableServerResource = armpostgresql.RecoverableServerResource{
	// 	Name: to.Ptr("recoverableServers"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/recoverableServers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/recoverableServers"),
	// 	Properties: &armpostgresql.RecoverableServerProperties{
	// 		Edition: to.Ptr("GeneralPurpose"),
	// 		HardwareGeneration: to.Ptr("Gen5"),
	// 		LastAvailableBackupDateTime: to.Ptr("2020-11-20T01:06:29.78Z"),
	// 		ServiceLevelObjective: to.Ptr("GP_Gen5_2"),
	// 		VCore: to.Ptr[int32](2),
	// 		Version: to.Ptr("9.6"),
	// 	},
	// }
}
Output:

type RecoverableServersClientGetOptions added in v0.3.0

type RecoverableServersClientGetOptions struct {
}

RecoverableServersClientGetOptions contains the optional parameters for the RecoverableServersClient.Get method.

type RecoverableServersClientGetResponse added in v0.3.0

type RecoverableServersClientGetResponse struct {
	// A recoverable server resource.
	RecoverableServerResource
}

RecoverableServersClientGetResponse contains the response from method RecoverableServersClient.Get.

type ReplicasClient

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

ReplicasClient contains the methods for the Replicas group. Don't use this type directly, use NewReplicasClient() instead.

func NewReplicasClient

func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicasClient, error)

NewReplicasClient creates a new instance of ReplicasClient 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 (*ReplicasClient) NewListByServerPager added in v0.5.0

func (client *ReplicasClient) NewListByServerPager(resourceGroupName string, serverName string, options *ReplicasClientListByServerOptions) *runtime.Pager[ReplicasClientListByServerResponse]

NewListByServerPager - List all the replicas for a given server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ReplicasClientListByServerOptions contains the optional parameters for the ReplicasClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ReplicasListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReplicasClient().NewListByServerPager("TestGroup_WestCentralUS", "testserver-master", 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.ServerListResult = armpostgresql.ServerListResult{
		// 	Value: []*armpostgresql.Server{
		// 		{
		// 			Name: to.Ptr("testserver-replica1"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica1"),
		// 			Location: to.Ptr("westcentralus"),
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("postgres"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("testserver-replica1.postgres.database.azure.com"),
		// 				MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"),
		// 				ReplicaCapacity: to.Ptr[int32](0),
		// 				ReplicationRole: to.Ptr("Replica"),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](2048000),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine6),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("GP_Gen4_16"),
		// 				Capacity: to.Ptr[int32](16),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testserver-replica2"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica2"),
		// 			Location: to.Ptr("westcentralus"),
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("postgres"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("testserver-replica2.postgres.database.azure.com"),
		// 				MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"),
		// 				ReplicaCapacity: to.Ptr[int32](0),
		// 				ReplicationRole: to.Ptr("Replica"),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](2048000),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine6),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("GP_Gen4_16"),
		// 				Capacity: to.Ptr[int32](16),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testserver-replica3"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica3"),
		// 			Location: to.Ptr("westcentralus"),
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("postgres"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("testserver-replica3.postgres.database.azure.com"),
		// 				MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"),
		// 				ReplicaCapacity: to.Ptr[int32](0),
		// 				ReplicationRole: to.Ptr("Replica"),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](2048000),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine6),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("GP_Gen4_16"),
		// 				Capacity: to.Ptr[int32](16),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testserver-replica4"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica4"),
		// 			Location: to.Ptr("westcentralus"),
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("postgres"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("testserver-replica4.postgres.database.azure.com"),
		// 				MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"),
		// 				ReplicaCapacity: to.Ptr[int32](0),
		// 				ReplicationRole: to.Ptr("Replica"),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](2048000),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine6),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("GP_Gen4_16"),
		// 				Capacity: to.Ptr[int32](16),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testserver-replica5"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica5"),
		// 			Location: to.Ptr("westcentralus"),
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("postgres"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("testserver-replica5.postgres.database.azure.com"),
		// 				MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"),
		// 				ReplicaCapacity: to.Ptr[int32](0),
		// 				ReplicationRole: to.Ptr("Replica"),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](2048000),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine6),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("GP_Gen4_16"),
		// 				Capacity: to.Ptr[int32](16),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ReplicasClientListByServerOptions added in v0.3.0

type ReplicasClientListByServerOptions struct {
}

ReplicasClientListByServerOptions contains the optional parameters for the ReplicasClient.NewListByServerPager method.

type ReplicasClientListByServerResponse added in v0.3.0

type ReplicasClientListByServerResponse struct {
	// A list of servers.
	ServerListResult
}

ReplicasClientListByServerResponse contains the response from method ReplicasClient.NewListByServerPager.

type Resource

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

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

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

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

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourceIdentity

type ResourceIdentity struct {
	// The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal
	// for the resource.
	Type *IdentityType

	// READ-ONLY; The Azure Active Directory principal id.
	PrincipalID *string

	// READ-ONLY; The Azure Active Directory tenant id.
	TenantID *string
}

ResourceIdentity - Azure Active Directory identity configuration for a resource.

func (ResourceIdentity) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceIdentity.

func (*ResourceIdentity) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceIdentity.

type SKU

type SKU struct {
	// REQUIRED; The name of the sku, typically, tier + family + cores, e.g. BGen41, GPGen58.
	Name *string

	// The scale up/out capacity, representing server's compute units.
	Capacity *int32

	// The family of hardware.
	Family *string

	// The size code, to be interpreted by resource as appropriate.
	Size *string

	// The tier of the particular SKU, e.g. Basic.
	Tier *SKUTier
}

SKU - Billing information related properties of a server.

func (SKU) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SKU.

func (*SKU) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKU.

type SKUTier

type SKUTier string

SKUTier - The tier of the particular SKU, e.g. Basic.

const (
	SKUTierBasic           SKUTier = "Basic"
	SKUTierGeneralPurpose  SKUTier = "GeneralPurpose"
	SKUTierMemoryOptimized SKUTier = "MemoryOptimized"
)

func PossibleSKUTierValues

func PossibleSKUTierValues() []SKUTier

PossibleSKUTierValues returns the possible values for the SKUTier const type.

type SSLEnforcementEnum

type SSLEnforcementEnum string

SSLEnforcementEnum - Enable ssl enforcement or not when connect to server.

const (
	SSLEnforcementEnumDisabled SSLEnforcementEnum = "Disabled"
	SSLEnforcementEnumEnabled  SSLEnforcementEnum = "Enabled"
)

func PossibleSSLEnforcementEnumValues

func PossibleSSLEnforcementEnumValues() []SSLEnforcementEnum

PossibleSSLEnforcementEnumValues returns the possible values for the SSLEnforcementEnum const type.

type SecurityAlertPolicyName

type SecurityAlertPolicyName string
const (
	SecurityAlertPolicyNameDefault SecurityAlertPolicyName = "Default"
)

func PossibleSecurityAlertPolicyNameValues

func PossibleSecurityAlertPolicyNameValues() []SecurityAlertPolicyName

PossibleSecurityAlertPolicyNameValues returns the possible values for the SecurityAlertPolicyName const type.

type SecurityAlertPolicyProperties

type SecurityAlertPolicyProperties struct {
	// REQUIRED; Specifies the state of the policy, whether it is enabled or disabled.
	State *ServerSecurityAlertPolicyState

	// Specifies an array of alerts that are disabled. Allowed values are: SqlInjection, SqlInjectionVulnerability, AccessAnomaly
	DisabledAlerts []*string

	// Specifies that the alert is sent to the account administrators.
	EmailAccountAdmins *bool

	// Specifies an array of e-mail addresses to which the alert is sent.
	EmailAddresses []*string

	// Specifies the number of days to keep in the Threat Detection audit logs.
	RetentionDays *int32

	// Specifies the identifier key of the Threat Detection audit storage account.
	StorageAccountAccessKey *string

	// Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat
	// Detection audit logs.
	StorageEndpoint *string
}

SecurityAlertPolicyProperties - Properties of a security alert policy.

func (SecurityAlertPolicyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SecurityAlertPolicyProperties.

func (*SecurityAlertPolicyProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertPolicyProperties.

type Server

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

	// The Azure Active Directory identity of the server.
	Identity *ResourceIdentity

	// Properties of the server.
	Properties *ServerProperties

	// The SKU (pricing tier) of the server.
	SKU *SKU

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

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

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

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

Server - Represents a server.

func (Server) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Server.

func (*Server) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Server.

type ServerAdministratorProperties

type ServerAdministratorProperties struct {
	// CONSTANT; The type of administrator.
	// Field has constant value "ActiveDirectory", any specified value is ignored.
	AdministratorType *string

	// REQUIRED; The server administrator login account name.
	Login *string

	// REQUIRED; The server administrator Sid (Secure ID).
	Sid *string

	// REQUIRED; The server Active Directory Administrator tenant id.
	TenantID *string
}

ServerAdministratorProperties - The properties of an server Administrator.

func (ServerAdministratorProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServerAdministratorProperties.

func (*ServerAdministratorProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerAdministratorProperties.

type ServerAdministratorResource

type ServerAdministratorResource struct {
	// Properties of the server AAD administrator.
	Properties *ServerAdministratorProperties

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

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

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

ServerAdministratorResource - Represents a and external administrator to be created.

func (ServerAdministratorResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerAdministratorResource.

func (*ServerAdministratorResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerAdministratorResource.

type ServerAdministratorResourceListResult

type ServerAdministratorResourceListResult struct {
	// The list of server Active Directory Administrators for the server.
	Value []*ServerAdministratorResource
}

ServerAdministratorResourceListResult - The response to a list Active Directory Administrators request.

func (ServerAdministratorResourceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerAdministratorResourceListResult.

func (*ServerAdministratorResourceListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerAdministratorResourceListResult.

type ServerAdministratorsClient

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

ServerAdministratorsClient contains the methods for the ServerAdministrators group. Don't use this type directly, use NewServerAdministratorsClient() instead.

func NewServerAdministratorsClient

func NewServerAdministratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerAdministratorsClient, error)

NewServerAdministratorsClient creates a new instance of ServerAdministratorsClient 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 (*ServerAdministratorsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or update active directory administrator on an existing server. The update action will overwrite the existing administrator. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • properties - The required parameters for creating or updating an AAD server administrator.
  • options - ServerAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAdministratorsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminCreateUpdate.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerAdministratorsClient().BeginCreateOrUpdate(ctx, "testrg", "pgtestsvc4", armpostgresql.ServerAdministratorResource{
		Properties: &armpostgresql.ServerAdministratorProperties{
			AdministratorType: to.Ptr("ActiveDirectory"),
			Login:             to.Ptr("bob@contoso.com"),
			Sid:               to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
			TenantID:          to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
		},
	}, 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.ServerAdministratorResource = armpostgresql.ServerAdministratorResource{
	// 	Name: to.Ptr("activeDirectory"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/administrators/activeDirectory"),
	// 	Properties: &armpostgresql.ServerAdministratorProperties{
	// 		AdministratorType: to.Ptr("ActiveDirectory"),
	// 		Login: to.Ptr("bob@contoso.com"),
	// 		Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
	// 		TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
	// 	},
	// }
}
Output:

func (*ServerAdministratorsClient) BeginDelete

BeginDelete - Deletes server active directory administrator. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAdministratorsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerAdministratorsClient().BeginDelete(ctx, "testrg", "pgtestsvc4", 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 (*ServerAdministratorsClient) Get

Get - Gets information about a AAD server administrator. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerAdministratorsClientGetOptions contains the optional parameters for the ServerAdministratorsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServerAdministratorsClient().Get(ctx, "testrg", "pgtestsvc4", 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.ServerAdministratorResource = armpostgresql.ServerAdministratorResource{
	// 	Name: to.Ptr("activeDirectory"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/administrators/activeDirectory"),
	// 	Properties: &armpostgresql.ServerAdministratorProperties{
	// 		AdministratorType: to.Ptr("ActiveDirectory"),
	// 		Login: to.Ptr("bob@contoso.com"),
	// 		Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
	// 		TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
	// 	},
	// }
}
Output:

func (*ServerAdministratorsClient) NewListPager added in v0.5.0

NewListPager - Returns a list of server Administrators.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerAdministratorsClientListOptions contains the optional parameters for the ServerAdministratorsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServerAdministratorsClient().NewListPager("testrg", "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.ServerAdministratorResourceListResult = armpostgresql.ServerAdministratorResourceListResult{
		// 	Value: []*armpostgresql.ServerAdministratorResource{
		// 		{
		// 			Name: to.Ptr("ActiveDirectory"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/administrators/activeDirectory"),
		// 			Properties: &armpostgresql.ServerAdministratorProperties{
		// 				AdministratorType: to.Ptr("ActiveDirectory"),
		// 				Login: to.Ptr("bob@contoso.com"),
		// 				Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
		// 				TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ServerAdministratorsClientBeginCreateOrUpdateOptions added in v0.3.0

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

ServerAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAdministratorsClient.BeginCreateOrUpdate method.

type ServerAdministratorsClientBeginDeleteOptions added in v0.3.0

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

ServerAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAdministratorsClient.BeginDelete method.

type ServerAdministratorsClientCreateOrUpdateResponse added in v0.3.0

type ServerAdministratorsClientCreateOrUpdateResponse struct {
	// Represents a and external administrator to be created.
	ServerAdministratorResource
}

ServerAdministratorsClientCreateOrUpdateResponse contains the response from method ServerAdministratorsClient.BeginCreateOrUpdate.

type ServerAdministratorsClientDeleteResponse added in v0.3.0

type ServerAdministratorsClientDeleteResponse struct {
}

ServerAdministratorsClientDeleteResponse contains the response from method ServerAdministratorsClient.BeginDelete.

type ServerAdministratorsClientGetOptions added in v0.3.0

type ServerAdministratorsClientGetOptions struct {
}

ServerAdministratorsClientGetOptions contains the optional parameters for the ServerAdministratorsClient.Get method.

type ServerAdministratorsClientGetResponse added in v0.3.0

type ServerAdministratorsClientGetResponse struct {
	// Represents a and external administrator to be created.
	ServerAdministratorResource
}

ServerAdministratorsClientGetResponse contains the response from method ServerAdministratorsClient.Get.

type ServerAdministratorsClientListOptions added in v0.3.0

type ServerAdministratorsClientListOptions struct {
}

ServerAdministratorsClientListOptions contains the optional parameters for the ServerAdministratorsClient.NewListPager method.

type ServerAdministratorsClientListResponse added in v0.3.0

type ServerAdministratorsClientListResponse struct {
	// The response to a list Active Directory Administrators request.
	ServerAdministratorResourceListResult
}

ServerAdministratorsClientListResponse contains the response from method ServerAdministratorsClient.NewListPager.

type ServerBasedPerformanceTierClient

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

ServerBasedPerformanceTierClient contains the methods for the ServerBasedPerformanceTier group. Don't use this type directly, use NewServerBasedPerformanceTierClient() instead.

func NewServerBasedPerformanceTierClient

func NewServerBasedPerformanceTierClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerBasedPerformanceTierClient, error)

NewServerBasedPerformanceTierClient creates a new instance of ServerBasedPerformanceTierClient 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 (*ServerBasedPerformanceTierClient) NewListPager added in v0.5.0

NewListPager - List all the performance tiers for a PostgreSQL server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerBasedPerformanceTierClientListOptions contains the optional parameters for the ServerBasedPerformanceTierClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/PerformanceTiersListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServerBasedPerformanceTierClient().NewListPager("TestGroup", "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.PerformanceTierListResult = armpostgresql.PerformanceTierListResult{
		// 	Value: []*armpostgresql.PerformanceTierProperties{
		// 		{
		// 			ID: to.Ptr("Basic"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](0),
		// 			MaxStorageMB: to.Ptr[int32](2097152),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("Basic"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("B_Gen5_1"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](1048576),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](1),
		// 				},
		// 				{
		// 					Edition: to.Ptr("Basic"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("B_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](1048576),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 			}},
		// 		},
		// 		{
		// 			ID: to.Ptr("GeneralPurpose"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](16777216),
		// 			MaxStorageMB: to.Ptr[int32](16777216),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_4"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](4),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_8"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](8),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_16"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](16),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_32"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_64"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 			}},
		// 		},
		// 		{
		// 			ID: to.Ptr("MemoryOptimized"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](16777216),
		// 			MaxStorageMB: to.Ptr[int32](16777216),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_4"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](4),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_8"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](8),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_16"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](16),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_32"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 			}},
		// 	}},
		// }
	}
}
Output:

type ServerBasedPerformanceTierClientListOptions added in v0.3.0

type ServerBasedPerformanceTierClientListOptions struct {
}

ServerBasedPerformanceTierClientListOptions contains the optional parameters for the ServerBasedPerformanceTierClient.NewListPager method.

type ServerBasedPerformanceTierClientListResponse added in v0.3.0

type ServerBasedPerformanceTierClientListResponse struct {
	// A list of performance tiers.
	PerformanceTierListResult
}

ServerBasedPerformanceTierClientListResponse contains the response from method ServerBasedPerformanceTierClient.NewListPager.

type ServerForCreate

type ServerForCreate struct {
	// REQUIRED; The location the resource resides in.
	Location *string

	// REQUIRED; Properties of the server.
	Properties ServerPropertiesForCreateClassification

	// The Azure Active Directory identity of the server.
	Identity *ResourceIdentity

	// The SKU (pricing tier) of the server.
	SKU *SKU

	// Application-specific metadata in the form of key-value pairs.
	Tags map[string]*string
}

ServerForCreate - Represents a server to be created.

func (ServerForCreate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerForCreate.

func (*ServerForCreate) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerForCreate.

type ServerKey

type ServerKey struct {
	// Properties of the ServerKey Resource.
	Properties *ServerKeyProperties

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

	// READ-ONLY; Kind of encryption protector used to protect the key.
	Kind *string

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

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

ServerKey - A PostgreSQL Server key.

func (ServerKey) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerKey.

func (*ServerKey) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerKey.

type ServerKeyListResult

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

	// READ-ONLY; A list of PostgreSQL Server keys.
	Value []*ServerKey
}

ServerKeyListResult - A list of PostgreSQL Server keys.

func (ServerKeyListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerKeyListResult.

func (*ServerKeyListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyListResult.

type ServerKeyProperties

type ServerKeyProperties struct {
	// REQUIRED; The key type like 'AzureKeyVault'.
	ServerKeyType *ServerKeyType

	// The URI of the key.
	URI *string

	// READ-ONLY; The key creation date.
	CreationDate *time.Time
}

ServerKeyProperties - Properties for a key execution.

func (ServerKeyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerKeyProperties.

func (*ServerKeyProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyProperties.

type ServerKeyType

type ServerKeyType string

ServerKeyType - The key type like 'AzureKeyVault'.

const (
	ServerKeyTypeAzureKeyVault ServerKeyType = "AzureKeyVault"
)

func PossibleServerKeyTypeValues

func PossibleServerKeyTypeValues() []ServerKeyType

PossibleServerKeyTypeValues returns the possible values for the ServerKeyType const type.

type ServerKeysClient

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

ServerKeysClient contains the methods for the ServerKeys group. Don't use this type directly, use NewServerKeysClient() instead.

func NewServerKeysClient

func NewServerKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerKeysClient, error)

NewServerKeysClient creates a new instance of ServerKeysClient 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 (*ServerKeysClient) BeginCreateOrUpdate

func (client *ServerKeysClient) BeginCreateOrUpdate(ctx context.Context, serverName string, keyName string, resourceGroupName string, parameters ServerKey, options *ServerKeysClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerKeysClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates a PostgreSQL Server key. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-01-01

  • serverName - The name of the server.
  • keyName - The name of the PostgreSQL Server key to be operated on (updated or created).
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • parameters - The requested PostgreSQL Server key resource state.
  • options - ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyCreateOrUpdate.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerKeysClient().BeginCreateOrUpdate(ctx, "testserver", "someVault_someKey_01234567890123456789012345678901", "testrg", armpostgresql.ServerKey{
		Properties: &armpostgresql.ServerKeyProperties{
			ServerKeyType: to.Ptr(armpostgresql.ServerKeyTypeAzureKeyVault),
			URI:           to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"),
		},
	}, 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.ServerKey = armpostgresql.ServerKey{
	// 	Name: to.Ptr("omeVault_someKey_01234567890123456789012345678901"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"),
	// 	Kind: to.Ptr("azurekeyvault"),
	// 	Properties: &armpostgresql.ServerKeyProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-01T00:00:00.000Z"); return t}()),
	// 		ServerKeyType: to.Ptr(armpostgresql.ServerKeyTypeAzureKeyVault),
	// 		URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"),
	// 	},
	// }
}
Output:

func (*ServerKeysClient) BeginDelete

func (client *ServerKeysClient) BeginDelete(ctx context.Context, serverName string, keyName string, resourceGroupName string, options *ServerKeysClientBeginDeleteOptions) (*runtime.Poller[ServerKeysClientDeleteResponse], error)

BeginDelete - Deletes the PostgreSQL Server key with the given name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-01-01

  • serverName - The name of the server.
  • keyName - The name of the PostgreSQL Server key to be deleted.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerKeysClient().BeginDelete(ctx, "testserver", "someVault_someKey_01234567890123456789012345678901", "testrg", 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 (*ServerKeysClient) Get

func (client *ServerKeysClient) Get(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientGetOptions) (ServerKeysClientGetResponse, error)

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

Generated from API version 2020-01-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • keyName - The name of the PostgreSQL Server key to be retrieved.
  • options - ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServerKeysClient().Get(ctx, "testrg", "testserver", "someVault_someKey_01234567890123456789012345678901", 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.ServerKey = armpostgresql.ServerKey{
	// 	Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"),
	// 	Kind: to.Ptr("azurekeyvault"),
	// 	Properties: &armpostgresql.ServerKeyProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()),
	// 		ServerKeyType: to.Ptr(armpostgresql.ServerKeyTypeAzureKeyVault),
	// 		URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"),
	// 	},
	// }
}
Output:

func (*ServerKeysClient) NewListPager added in v0.5.0

func (client *ServerKeysClient) NewListPager(resourceGroupName string, serverName string, options *ServerKeysClientListOptions) *runtime.Pager[ServerKeysClientListResponse]

NewListPager - Gets a list of Server keys.

Generated from API version 2020-01-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerKeysClientListOptions contains the optional parameters for the ServerKeysClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServerKeysClient().NewListPager("testrg", "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.ServerKeyListResult = armpostgresql.ServerKeyListResult{
		// 	Value: []*armpostgresql.ServerKey{
		// 		{
		// 			Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"),
		// 			Kind: to.Ptr("azurekeyvault"),
		// 			Properties: &armpostgresql.ServerKeyProperties{
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()),
		// 				ServerKeyType: to.Ptr(armpostgresql.ServerKeyTypeAzureKeyVault),
		// 				URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ServerKeysClientBeginCreateOrUpdateOptions added in v0.3.0

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

ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate method.

type ServerKeysClientBeginDeleteOptions added in v0.3.0

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

ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method.

type ServerKeysClientCreateOrUpdateResponse added in v0.3.0

type ServerKeysClientCreateOrUpdateResponse struct {
	// A PostgreSQL Server key.
	ServerKey
}

ServerKeysClientCreateOrUpdateResponse contains the response from method ServerKeysClient.BeginCreateOrUpdate.

type ServerKeysClientDeleteResponse added in v0.3.0

type ServerKeysClientDeleteResponse struct {
}

ServerKeysClientDeleteResponse contains the response from method ServerKeysClient.BeginDelete.

type ServerKeysClientGetOptions added in v0.3.0

type ServerKeysClientGetOptions struct {
}

ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method.

type ServerKeysClientGetResponse added in v0.3.0

type ServerKeysClientGetResponse struct {
	// A PostgreSQL Server key.
	ServerKey
}

ServerKeysClientGetResponse contains the response from method ServerKeysClient.Get.

type ServerKeysClientListOptions added in v0.3.0

type ServerKeysClientListOptions struct {
}

ServerKeysClientListOptions contains the optional parameters for the ServerKeysClient.NewListPager method.

type ServerKeysClientListResponse added in v0.3.0

type ServerKeysClientListResponse struct {
	// A list of PostgreSQL Server keys.
	ServerKeyListResult
}

ServerKeysClientListResponse contains the response from method ServerKeysClient.NewListPager.

type ServerListResult

type ServerListResult struct {
	// The list of servers
	Value []*Server
}

ServerListResult - A list of servers.

func (ServerListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerListResult.

func (*ServerListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerListResult.

type ServerParametersClient

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

ServerParametersClient contains the methods for the ServerParameters group. Don't use this type directly, use NewServerParametersClient() instead.

func NewServerParametersClient

func NewServerParametersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerParametersClient, error)

NewServerParametersClient creates a new instance of ServerParametersClient 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 (*ServerParametersClient) BeginListUpdateConfigurations

BeginListUpdateConfigurations - Update a list of configurations in a given server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • value - The parameters for updating a list of server configuration.
  • options - ServerParametersClientBeginListUpdateConfigurationsOptions contains the optional parameters for the ServerParametersClient.BeginListUpdateConfigurations method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationsUpdateByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerParametersClient().BeginListUpdateConfigurations(ctx, "TestGroup", "testserver", armpostgresql.ConfigurationListResult{}, 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.ConfigurationListResult = armpostgresql.ConfigurationListResult{
	// 	Value: []*armpostgresql.Configuration{
	// 		{
	// 			Name: to.Ptr("array_nulls"),
	// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"),
	// 			Properties: &armpostgresql.ConfigurationProperties{
	// 				Description: to.Ptr("Enable input of NULL elements in arrays."),
	// 				AllowedValues: to.Ptr("on,off"),
	// 				DataType: to.Ptr("Boolean"),
	// 				DefaultValue: to.Ptr("on"),
	// 				Source: to.Ptr("system-default"),
	// 				Value: to.Ptr("on"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("backslash_quote"),
	// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/backslash_quote"),
	// 			Properties: &armpostgresql.ConfigurationProperties{
	// 				Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."),
	// 				AllowedValues: to.Ptr("safe_encoding,on,off"),
	// 				DataType: to.Ptr("Enumeration"),
	// 				DefaultValue: to.Ptr("safe_encoding"),
	// 				Source: to.Ptr("system-default"),
	// 				Value: to.Ptr("safe_encoding"),
	// 			},
	// 	}},
	// }
}
Output:

type ServerParametersClientBeginListUpdateConfigurationsOptions added in v0.3.0

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

ServerParametersClientBeginListUpdateConfigurationsOptions contains the optional parameters for the ServerParametersClient.BeginListUpdateConfigurations method.

type ServerParametersClientListUpdateConfigurationsResponse added in v0.3.0

type ServerParametersClientListUpdateConfigurationsResponse struct {
	// A list of server configurations.
	ConfigurationListResult
}

ServerParametersClientListUpdateConfigurationsResponse contains the response from method ServerParametersClient.BeginListUpdateConfigurations.

type ServerPrivateEndpointConnection

type ServerPrivateEndpointConnection struct {
	// READ-ONLY; Resource ID of the Private Endpoint Connection.
	ID *string

	// READ-ONLY; Private endpoint connection properties
	Properties *ServerPrivateEndpointConnectionProperties
}

ServerPrivateEndpointConnection - A private endpoint connection under a server

func (ServerPrivateEndpointConnection) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServerPrivateEndpointConnection.

func (*ServerPrivateEndpointConnection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateEndpointConnection.

type ServerPrivateEndpointConnectionProperties

type ServerPrivateEndpointConnectionProperties struct {
	// Private endpoint which the connection belongs to.
	PrivateEndpoint *PrivateEndpointProperty

	// Connection state of the private endpoint connection.
	PrivateLinkServiceConnectionState *ServerPrivateLinkServiceConnectionStateProperty

	// READ-ONLY; State of the private endpoint connection.
	ProvisioningState *PrivateEndpointProvisioningState
}

ServerPrivateEndpointConnectionProperties - Properties of a private endpoint connection.

func (ServerPrivateEndpointConnectionProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type ServerPrivateEndpointConnectionProperties.

func (*ServerPrivateEndpointConnectionProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateEndpointConnectionProperties.

type ServerPrivateLinkServiceConnectionStateProperty

type ServerPrivateLinkServiceConnectionStateProperty struct {
	// REQUIRED; The private link service connection description.
	Description *string

	// REQUIRED; The private link service connection status.
	Status *PrivateLinkServiceConnectionStateStatus

	// READ-ONLY; The actions required for private link service connection.
	ActionsRequired *PrivateLinkServiceConnectionStateActionsRequire
}

func (ServerPrivateLinkServiceConnectionStateProperty) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type ServerPrivateLinkServiceConnectionStateProperty.

func (*ServerPrivateLinkServiceConnectionStateProperty) UnmarshalJSON added in v1.1.0

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateLinkServiceConnectionStateProperty.

type ServerProperties

type ServerProperties struct {
	// The administrator's login name of a server. Can only be specified when the server is being created (and is required for
	// creation).
	AdministratorLogin *string

	// Earliest restore point creation time (ISO8601 format)
	EarliestRestoreDate *time.Time

	// The fully qualified domain name of a server.
	FullyQualifiedDomainName *string

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// The master server id of a replica server.
	MasterServerID *string

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// The maximum number of replicas that a master server can have.
	ReplicaCapacity *int32

	// The replication role of the server.
	ReplicationRole *string

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// A state of a server that is visible to user.
	UserVisibleState *ServerState

	// Server version.
	Version *ServerVersion

	// READ-ONLY; Status showing whether the server data encryption is enabled with customer-managed keys.
	ByokEnforcement *string

	// READ-ONLY; List of private endpoint connections on a server
	PrivateEndpointConnections []*ServerPrivateEndpointConnection
}

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

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties.

type ServerPropertiesForCreate

type ServerPropertiesForCreate struct {
	// REQUIRED; The mode to create a new server.
	CreateMode *CreateMode

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// Server version.
	Version *ServerVersion
}

ServerPropertiesForCreate - The properties used to create a new server.

func (*ServerPropertiesForCreate) GetServerPropertiesForCreate

func (s *ServerPropertiesForCreate) GetServerPropertiesForCreate() *ServerPropertiesForCreate

GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForCreate.

func (ServerPropertiesForCreate) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForCreate.

func (*ServerPropertiesForCreate) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForCreate.

type ServerPropertiesForCreateClassification

type ServerPropertiesForCreateClassification interface {
	// GetServerPropertiesForCreate returns the ServerPropertiesForCreate content of the underlying type.
	GetServerPropertiesForCreate() *ServerPropertiesForCreate
}

ServerPropertiesForCreateClassification provides polymorphic access to related types. Call the interface's GetServerPropertiesForCreate() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *ServerPropertiesForCreate, *ServerPropertiesForDefaultCreate, *ServerPropertiesForGeoRestore, *ServerPropertiesForReplica, - *ServerPropertiesForRestore

type ServerPropertiesForDefaultCreate

type ServerPropertiesForDefaultCreate struct {
	// REQUIRED; The administrator's login name of a server. Can only be specified when the server is being created (and is required
	// for creation).
	AdministratorLogin *string

	// REQUIRED; The password of the administrator login.
	AdministratorLoginPassword *string

	// REQUIRED; The mode to create a new server.
	CreateMode *CreateMode

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// Server version.
	Version *ServerVersion
}

ServerPropertiesForDefaultCreate - The properties used to create a new server.

func (*ServerPropertiesForDefaultCreate) GetServerPropertiesForCreate added in v0.3.0

func (s *ServerPropertiesForDefaultCreate) GetServerPropertiesForCreate() *ServerPropertiesForCreate

GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForDefaultCreate.

func (ServerPropertiesForDefaultCreate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForDefaultCreate.

func (*ServerPropertiesForDefaultCreate) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForDefaultCreate.

type ServerPropertiesForGeoRestore

type ServerPropertiesForGeoRestore struct {
	// REQUIRED; The mode to create a new server.
	CreateMode *CreateMode

	// REQUIRED; The source server id to restore from.
	SourceServerID *string

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// Server version.
	Version *ServerVersion
}

ServerPropertiesForGeoRestore - The properties used to create a new server by restoring to a different region from a geo replicated backup.

func (*ServerPropertiesForGeoRestore) GetServerPropertiesForCreate added in v0.3.0

func (s *ServerPropertiesForGeoRestore) GetServerPropertiesForCreate() *ServerPropertiesForCreate

GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForGeoRestore.

func (ServerPropertiesForGeoRestore) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForGeoRestore.

func (*ServerPropertiesForGeoRestore) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForGeoRestore.

type ServerPropertiesForReplica

type ServerPropertiesForReplica struct {
	// REQUIRED; The mode to create a new server.
	CreateMode *CreateMode

	// REQUIRED; The master server id to create replica from.
	SourceServerID *string

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// Server version.
	Version *ServerVersion
}

ServerPropertiesForReplica - The properties to create a new replica.

func (*ServerPropertiesForReplica) GetServerPropertiesForCreate added in v0.3.0

func (s *ServerPropertiesForReplica) GetServerPropertiesForCreate() *ServerPropertiesForCreate

GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForReplica.

func (ServerPropertiesForReplica) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForReplica.

func (*ServerPropertiesForReplica) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForReplica.

type ServerPropertiesForRestore

type ServerPropertiesForRestore struct {
	// REQUIRED; The mode to create a new server.
	CreateMode *CreateMode

	// REQUIRED; Restore point creation time (ISO8601 format), specifying the time to restore from.
	RestorePointInTime *time.Time

	// REQUIRED; The source server id to restore from.
	SourceServerID *string

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// Server version.
	Version *ServerVersion
}

ServerPropertiesForRestore - The properties used to create a new server by restoring from a backup.

func (*ServerPropertiesForRestore) GetServerPropertiesForCreate added in v0.3.0

func (s *ServerPropertiesForRestore) GetServerPropertiesForCreate() *ServerPropertiesForCreate

GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForRestore.

func (ServerPropertiesForRestore) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForRestore.

func (*ServerPropertiesForRestore) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForRestore.

type ServerSecurityAlertPoliciesClient

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

ServerSecurityAlertPoliciesClient contains the methods for the ServerSecurityAlertPolicies group. Don't use this type directly, use NewServerSecurityAlertPoliciesClient() instead.

func NewServerSecurityAlertPoliciesClient

func NewServerSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerSecurityAlertPoliciesClient, error)

NewServerSecurityAlertPoliciesClient creates a new instance of ServerSecurityAlertPoliciesClient 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 (*ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates a threat detection policy. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • securityAlertPolicyName - The name of the threat detection policy.
  • parameters - The server security alert policy.
  • options - ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate method.
Example (UpdateAServersThreatDetectionPolicyWithAllParameters)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsCreateMax.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armpostgresql.SecurityAlertPolicyNameDefault, armpostgresql.ServerSecurityAlertPolicy{
		Properties: &armpostgresql.SecurityAlertPolicyProperties{
			DisabledAlerts: []*string{
				to.Ptr("Access_Anomaly"),
				to.Ptr("Usage_Anomaly")},
			EmailAccountAdmins: to.Ptr(true),
			EmailAddresses: []*string{
				to.Ptr("testSecurityAlert@microsoft.com")},
			RetentionDays:           to.Ptr[int32](5),
			State:                   to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateEnabled),
			StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="),
			StorageEndpoint:         to.Ptr("https://mystorage.blob.core.windows.net"),
		},
	}, 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.ServerSecurityAlertPolicy = armpostgresql.ServerSecurityAlertPolicy{
	// 	Name: to.Ptr("Default"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies/default"),
	// 	Properties: &armpostgresql.SecurityAlertPolicyProperties{
	// 		DisabledAlerts: []*string{
	// 			to.Ptr("Access_Anomaly"),
	// 			to.Ptr("Usage_Anomaly")},
	// 			EmailAccountAdmins: to.Ptr(true),
	// 			EmailAddresses: []*string{
	// 				to.Ptr("testSecurityAlert@microsoft.com")},
	// 				RetentionDays: to.Ptr[int32](5),
	// 				State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateEnabled),
	// 				StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"),
	// 			},
	// 		}
}
Output:

Example (UpdateAServersThreatDetectionPolicyWithMinimalParameters)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsCreateMin.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armpostgresql.SecurityAlertPolicyNameDefault, armpostgresql.ServerSecurityAlertPolicy{
		Properties: &armpostgresql.SecurityAlertPolicyProperties{
			EmailAccountAdmins: to.Ptr(true),
			State:              to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateDisabled),
		},
	}, 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.ServerSecurityAlertPolicy = armpostgresql.ServerSecurityAlertPolicy{
	// 	Name: to.Ptr("Default"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies/default"),
	// 	Properties: &armpostgresql.SecurityAlertPolicyProperties{
	// 		DisabledAlerts: []*string{
	// 			to.Ptr("")},
	// 			EmailAccountAdmins: to.Ptr(true),
	// 			EmailAddresses: []*string{
	// 				to.Ptr("")},
	// 				RetentionDays: to.Ptr[int32](0),
	// 				State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateEnabled),
	// 				StorageEndpoint: to.Ptr(""),
	// 			},
	// 		}
}
Output:

func (*ServerSecurityAlertPoliciesClient) Get

Get - Get a server's security alert policy. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • securityAlertPolicyName - The name of the security alert policy.
  • options - ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServerSecurityAlertPoliciesClient().Get(ctx, "securityalert-4799", "securityalert-6440", armpostgresql.SecurityAlertPolicyNameDefault, 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.ServerSecurityAlertPolicy = armpostgresql.ServerSecurityAlertPolicy{
	// 	Name: to.Ptr("Default"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies/default"),
	// 	Properties: &armpostgresql.SecurityAlertPolicyProperties{
	// 		DisabledAlerts: []*string{
	// 			to.Ptr("Access_Anomaly")},
	// 			EmailAccountAdmins: to.Ptr(true),
	// 			EmailAddresses: []*string{
	// 				to.Ptr("test@microsoft.com;user@microsoft.com")},
	// 				RetentionDays: to.Ptr[int32](0),
	// 				State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateDisabled),
	// 				StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"),
	// 			},
	// 		}
}
Output:

func (*ServerSecurityAlertPoliciesClient) NewListByServerPager added in v0.5.0

NewListByServerPager - Get the server's threat detection policies.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServerSecurityAlertPoliciesClient().NewListByServerPager("securityalert-4799", "securityalert-6440", 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.ServerSecurityAlertPolicyListResult = armpostgresql.ServerSecurityAlertPolicyListResult{
		// 	Value: []*armpostgresql.ServerSecurityAlertPolicy{
		// 		{
		// 			Name: to.Ptr("Default"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies"),
		// 			Properties: &armpostgresql.SecurityAlertPolicyProperties{
		// 				DisabledAlerts: []*string{
		// 					to.Ptr("Access_Anomaly")},
		// 					EmailAccountAdmins: to.Ptr(true),
		// 					EmailAddresses: []*string{
		// 						to.Ptr("test@microsoft.com;user@microsoft.com")},
		// 						RetentionDays: to.Ptr[int32](0),
		// 						State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateDisabled),
		// 						StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"),
		// 					},
		// 			}},
		// 		}
	}
}
Output:

type ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

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

ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate method.

type ServerSecurityAlertPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ServerSecurityAlertPoliciesClientCreateOrUpdateResponse struct {
	// A server security alert policy.
	ServerSecurityAlertPolicy
}

ServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate.

type ServerSecurityAlertPoliciesClientGetOptions added in v0.3.0

type ServerSecurityAlertPoliciesClientGetOptions struct {
}

ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get method.

type ServerSecurityAlertPoliciesClientGetResponse added in v0.3.0

type ServerSecurityAlertPoliciesClientGetResponse struct {
	// A server security alert policy.
	ServerSecurityAlertPolicy
}

ServerSecurityAlertPoliciesClientGetResponse contains the response from method ServerSecurityAlertPoliciesClient.Get.

type ServerSecurityAlertPoliciesClientListByServerOptions added in v0.3.0

type ServerSecurityAlertPoliciesClientListByServerOptions struct {
}

ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.NewListByServerPager method.

type ServerSecurityAlertPoliciesClientListByServerResponse added in v0.3.0

type ServerSecurityAlertPoliciesClientListByServerResponse struct {
	// A list of the server's security alert policies.
	ServerSecurityAlertPolicyListResult
}

ServerSecurityAlertPoliciesClientListByServerResponse contains the response from method ServerSecurityAlertPoliciesClient.NewListByServerPager.

type ServerSecurityAlertPolicy

type ServerSecurityAlertPolicy struct {
	// Resource properties.
	Properties *SecurityAlertPolicyProperties

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

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

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

ServerSecurityAlertPolicy - A server security alert policy.

func (ServerSecurityAlertPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerSecurityAlertPolicy.

func (*ServerSecurityAlertPolicy) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerSecurityAlertPolicy.

type ServerSecurityAlertPolicyListResult

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

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

ServerSecurityAlertPolicyListResult - A list of the server's security alert policies.

func (ServerSecurityAlertPolicyListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerSecurityAlertPolicyListResult.

func (*ServerSecurityAlertPolicyListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerSecurityAlertPolicyListResult.

type ServerSecurityAlertPolicyState

type ServerSecurityAlertPolicyState string

ServerSecurityAlertPolicyState - Specifies the state of the policy, whether it is enabled or disabled.

const (
	ServerSecurityAlertPolicyStateDisabled ServerSecurityAlertPolicyState = "Disabled"
	ServerSecurityAlertPolicyStateEnabled  ServerSecurityAlertPolicyState = "Enabled"
)

func PossibleServerSecurityAlertPolicyStateValues

func PossibleServerSecurityAlertPolicyStateValues() []ServerSecurityAlertPolicyState

PossibleServerSecurityAlertPolicyStateValues returns the possible values for the ServerSecurityAlertPolicyState const type.

type ServerState

type ServerState string

ServerState - A state of a server that is visible to user.

const (
	ServerStateDisabled     ServerState = "Disabled"
	ServerStateDropping     ServerState = "Dropping"
	ServerStateInaccessible ServerState = "Inaccessible"
	ServerStateReady        ServerState = "Ready"
)

func PossibleServerStateValues

func PossibleServerStateValues() []ServerState

PossibleServerStateValues returns the possible values for the ServerState const type.

type ServerUpdateParameters

type ServerUpdateParameters struct {
	// The Azure Active Directory identity of the server.
	Identity *ResourceIdentity

	// The properties that can be updated for a server.
	Properties *ServerUpdateParametersProperties

	// The SKU (pricing tier) of the server.
	SKU *SKU

	// Application-specific metadata in the form of key-value pairs.
	Tags map[string]*string
}

ServerUpdateParameters - Parameters allowed to update for a server.

func (ServerUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerUpdateParameters.

func (*ServerUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpdateParameters.

type ServerUpdateParametersProperties

type ServerUpdateParametersProperties struct {
	// The password of the administrator login.
	AdministratorLoginPassword *string

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// The replication role of the server.
	ReplicationRole *string

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// The version of a server.
	Version *ServerVersion
}

ServerUpdateParametersProperties - The properties that can be updated for a server.

func (ServerUpdateParametersProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServerUpdateParametersProperties.

func (*ServerUpdateParametersProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpdateParametersProperties.

type ServerVersion

type ServerVersion string

ServerVersion - The version of a server.

const (
	ServerVersionEleven ServerVersion = "11"
	ServerVersionNine5  ServerVersion = "9.5"
	ServerVersionNine6  ServerVersion = "9.6"
	ServerVersionTen    ServerVersion = "10"
	ServerVersionTen0   ServerVersion = "10.0"
	ServerVersionTen2   ServerVersion = "10.2"
)

func PossibleServerVersionValues

func PossibleServerVersionValues() []ServerVersion

PossibleServerVersionValues returns the possible values for the ServerVersion 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) BeginCreate

func (client *ServersClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForCreate, options *ServersClientBeginCreateOptions) (*runtime.Poller[ServersClientCreateResponse], error)

BeginCreate - Creates a new server, or will overwrite an existing server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • parameters - The required parameters for creating or updating a server.
  • options - ServersClientBeginCreateOptions contains the optional parameters for the ServersClient.BeginCreate method.
Example (CreateADatabaseAsAPointInTimeRestore)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreatePointInTimeRestore.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armpostgresql.ServerForCreate{
		Location: to.Ptr("brazilsouth"),
		Properties: &armpostgresql.ServerPropertiesForRestore{
			CreateMode:         to.Ptr(armpostgresql.CreateModePointInTimeRestore),
			RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T00:00:37.467Z"); return t }()),
			SourceServerID:     to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver"),
		},
		SKU: &armpostgresql.SKU{
			Name:     to.Ptr("B_Gen5_2"),
			Capacity: to.Ptr[int32](2),
			Family:   to.Ptr("Gen5"),
			Tier:     to.Ptr(armpostgresql.SKUTierBasic),
		},
		Tags: map[string]*string{
			"ElasticServer": to.Ptr("1"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Server = armpostgresql.Server{
	// 	Name: to.Ptr("targetserver"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/targetserver"),
	// 	Location: to.Ptr("brazilsouth"),
	// 	Tags: map[string]*string{
	// 		"ElasticServer": to.Ptr("1"),
	// 	},
	// 	Properties: &armpostgresql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("cloudsa"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T21:08:24.637Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("targetserver.postgres.database.azure.com"),
	// 		SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
	// 		StorageProfile: &armpostgresql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](7),
	// 			GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
	// 			StorageMB: to.Ptr[int32](128000),
	// 		},
	// 		UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
	// 		Version: to.Ptr(armpostgresql.ServerVersionNine6),
	// 	},
	// 	SKU: &armpostgresql.SKU{
	// 		Name: to.Ptr("B_Gen5_2"),
	// 		Capacity: to.Ptr[int32](2),
	// 		Family: to.Ptr("Gen5"),
	// 		Tier: to.Ptr(armpostgresql.SKUTierBasic),
	// 	},
	// }
}
Output:

Example (CreateANewServer)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreate.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TestGroup", "pgtestsvc4", armpostgresql.ServerForCreate{
		Location: to.Ptr("westus"),
		Properties: &armpostgresql.ServerPropertiesForDefaultCreate{
			CreateMode:        to.Ptr(armpostgresql.CreateModeDefault),
			MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12),
			SSLEnforcement:    to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
			StorageProfile: &armpostgresql.StorageProfile{
				BackupRetentionDays: to.Ptr[int32](7),
				GeoRedundantBackup:  to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
				StorageMB:           to.Ptr[int32](128000),
			},
			AdministratorLogin:         to.Ptr("cloudsa"),
			AdministratorLoginPassword: to.Ptr("<administratorLoginPassword>"),
		},
		SKU: &armpostgresql.SKU{
			Name:     to.Ptr("B_Gen5_2"),
			Capacity: to.Ptr[int32](2),
			Family:   to.Ptr("Gen5"),
			Tier:     to.Ptr(armpostgresql.SKUTierBasic),
		},
		Tags: map[string]*string{
			"ElasticServer": to.Ptr("1"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Server = armpostgresql.Server{
	// 	Name: to.Ptr("pgtestsvc4"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"ElasticServer": to.Ptr("1"),
	// 	},
	// 	Properties: &armpostgresql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("cloudsa"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"),
	// 		SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
	// 		StorageProfile: &armpostgresql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](7),
	// 			GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
	// 			StorageMB: to.Ptr[int32](128000),
	// 		},
	// 		UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
	// 		Version: to.Ptr(armpostgresql.ServerVersionNine6),
	// 	},
	// 	SKU: &armpostgresql.SKU{
	// 		Name: to.Ptr("B_Gen5_2"),
	// 		Capacity: to.Ptr[int32](2),
	// 		Family: to.Ptr("Gen5"),
	// 		Tier: to.Ptr(armpostgresql.SKUTierBasic),
	// 	},
	// }
}
Output:

Example (CreateAReplicaServer)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreateReplicaMode.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TestGroup_WestCentralUS", "testserver-replica1", armpostgresql.ServerForCreate{
		Location: to.Ptr("westcentralus"),
		Properties: &armpostgresql.ServerPropertiesForReplica{
			CreateMode:     to.Ptr(armpostgresql.CreateModeReplica),
			SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"),
		},
		SKU: &armpostgresql.SKU{
			Name:     to.Ptr("GP_Gen5_2"),
			Capacity: to.Ptr[int32](2),
			Family:   to.Ptr("Gen5"),
			Tier:     to.Ptr(armpostgresql.SKUTierGeneralPurpose),
		},
	}, 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.Server = armpostgresql.Server{
	// 	Name: to.Ptr("testserver-replica1"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica1"),
	// 	Location: to.Ptr("westcentralus"),
	// 	Properties: &armpostgresql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("postgres"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-20T00:17:56.677Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("testserver-replica1.postgres.database.azure.com"),
	// 		MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"),
	// 		ReplicaCapacity: to.Ptr[int32](0),
	// 		ReplicationRole: to.Ptr("Replica"),
	// 		SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled),
	// 		StorageProfile: &armpostgresql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](7),
	// 			GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
	// 			StorageMB: to.Ptr[int32](2048000),
	// 		},
	// 		UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
	// 		Version: to.Ptr(armpostgresql.ServerVersionNine6),
	// 	},
	// 	SKU: &armpostgresql.SKU{
	// 		Name: to.Ptr("GP_Gen5_2"),
	// 		Capacity: to.Ptr[int32](2),
	// 		Family: to.Ptr("Gen4"),
	// 		Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose),
	// 	},
	// }
}
Output:

Example (CreateAServerAsAGeoRestore)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreateGeoRestoreMode.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armpostgresql.ServerForCreate{
		Location: to.Ptr("westus"),
		Properties: &armpostgresql.ServerPropertiesForGeoRestore{
			CreateMode:     to.Ptr(armpostgresql.CreateModeGeoRestore),
			SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver"),
		},
		SKU: &armpostgresql.SKU{
			Name:     to.Ptr("GP_Gen5_2"),
			Capacity: to.Ptr[int32](2),
			Family:   to.Ptr("Gen5"),
			Tier:     to.Ptr(armpostgresql.SKUTierGeneralPurpose),
		},
		Tags: map[string]*string{
			"ElasticServer": to.Ptr("1"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Server = armpostgresql.Server{
	// 	Name: to.Ptr("targetserver"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/targetserver"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"ElasticServer": to.Ptr("1"),
	// 	},
	// 	Properties: &armpostgresql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("cloudsa"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("targetserver.postgres.database.azure.com"),
	// 		SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
	// 		StorageProfile: &armpostgresql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](7),
	// 			GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
	// 			StorageMB: to.Ptr[int32](128000),
	// 		},
	// 		UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
	// 		Version: to.Ptr(armpostgresql.ServerVersionNine6),
	// 	},
	// 	SKU: &armpostgresql.SKU{
	// 		Name: to.Ptr("GP_Gen5_2"),
	// 		Capacity: to.Ptr[int32](2),
	// 		Family: to.Ptr("Gen5"),
	// 		Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose),
	// 	},
	// }
}
Output:

func (*ServersClient) BeginDelete

func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*runtime.Poller[ServersClientDeleteResponse], error)

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

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "TestGroup", "testserver", 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 (*ServersClient) BeginRestart

func (client *ServersClient) BeginRestart(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRestartOptions) (*runtime.Poller[ServersClientRestartResponse], error)

BeginRestart - Restarts a server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerRestart.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "TestGroup", "testserver", 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 (*ServersClient) BeginUpdate

func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdateParameters, options *ServersClientBeginUpdateOptions) (*runtime.Poller[ServersClientUpdateResponse], error)

BeginUpdate - Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • parameters - The required parameters for updating a server.
  • options - ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerUpdate.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", armpostgresql.ServerUpdateParameters{
		Properties: &armpostgresql.ServerUpdateParametersProperties{
			AdministratorLoginPassword: to.Ptr("<administratorLoginPassword>"),
			MinimalTLSVersion:          to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12),
			SSLEnforcement:             to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
		},
	}, 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.Server = armpostgresql.Server{
	// 	Name: to.Ptr("pgtestsvc4"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"ElasticServer": to.Ptr("1"),
	// 	},
	// 	Properties: &armpostgresql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("cloudsa"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"),
	// 		MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12),
	// 		SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
	// 		StorageProfile: &armpostgresql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](7),
	// 			GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
	// 			StorageMB: to.Ptr[int32](128000),
	// 		},
	// 		UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
	// 		Version: to.Ptr(armpostgresql.ServerVersionNine6),
	// 	},
	// 	SKU: &armpostgresql.SKU{
	// 		Name: to.Ptr("B_Gen4_2"),
	// 		Capacity: to.Ptr[int32](2),
	// 		Family: to.Ptr("Gen4"),
	// 		Tier: to.Ptr(armpostgresql.SKUTierBasic),
	// 	},
	// }
}
Output:

func (*ServersClient) Get

func (client *ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientGetOptions) (ServersClientGetResponse, error)

Get - Gets information about a server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "pgtestsvc1", 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.Server = armpostgresql.Server{
	// 	Name: to.Ptr("pgtestsvc1"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"),
	// 	Location: to.Ptr("westus"),
	// 	Properties: &armpostgresql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("testuser"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:00:58.924Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"),
	// 		MasterServerID: to.Ptr(""),
	// 		MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12),
	// 		PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{
	// 			{
	// 				ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"),
	// 				Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{
	// 					PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{
	// 						ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
	// 					},
	// 					PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{
	// 						Description: to.Ptr("Auto-approved"),
	// 						ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone),
	// 						Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved),
	// 					},
	// 					ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")),
	// 				},
	// 		}},
	// 		PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled),
	// 		ReplicationRole: to.Ptr(""),
	// 		SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
	// 		StorageProfile: &armpostgresql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](10),
	// 			GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
	// 			StorageMB: to.Ptr[int32](5120),
	// 		},
	// 		UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
	// 		Version: to.Ptr(armpostgresql.ServerVersionNine5),
	// 	},
	// 	SKU: &armpostgresql.SKU{
	// 		Name: to.Ptr("B_Gen4_1"),
	// 		Capacity: to.Ptr[int32](1),
	// 		Family: to.Ptr("Gen4"),
	// 		Tier: to.Ptr(armpostgresql.SKUTierBasic),
	// 	},
	// }
}
Output:

func (*ServersClient) NewListByResourceGroupPager added in v0.5.0

func (client *ServersClient) NewListByResourceGroupPager(resourceGroupName string, options *ServersClientListByResourceGroupOptions) *runtime.Pager[ServersClientListByResourceGroupResponse]

NewListByResourceGroupPager - List all the servers in a given resource group.

Generated from API version 2017-12-01

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServersClient().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.ServerListResult = armpostgresql.ServerListResult{
		// 	Value: []*armpostgresql.Server{
		// 		{
		// 			Name: to.Ptr("pgtestsvc1"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("testuser"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:01:55.149Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"),
		// 				PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{
		// 				},
		// 				PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](10),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](5120),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine5),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("B_Gen4_1"),
		// 				Capacity: to.Ptr[int32](1),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierBasic),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("pgtestsvc2"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("testuser"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T21:01:55.149Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("pgtestsvc2.postgres.database.azure.com"),
		// 				PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{
		// 					{
		// 						ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"),
		// 						Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{
		// 							PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{
		// 								ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
		// 							},
		// 							PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{
		// 								Description: to.Ptr("Auto-approved"),
		// 								ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone),
		// 								Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved),
		// 							},
		// 							ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")),
		// 						},
		// 				}},
		// 				PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](5120),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine6),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("GP_Gen4_2"),
		// 				Capacity: to.Ptr[int32](2),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("pgtestsvc4"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"),
		// 			Location: to.Ptr("westus"),
		// 			Tags: map[string]*string{
		// 				"ElasticServer": to.Ptr("1"),
		// 			},
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("cloudsa"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"),
		// 				PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{
		// 				},
		// 				PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](128000),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine6),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("B_Gen4_2"),
		// 				Capacity: to.Ptr[int32](2),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierBasic),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ServersClient) NewListPager added in v0.5.0

NewListPager - List all the servers in a given subscription.

Generated from API version 2017-12-01

  • options - ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServersClient().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.ServerListResult = armpostgresql.ServerListResult{
		// 	Value: []*armpostgresql.Server{
		// 		{
		// 			Name: to.Ptr("pgtestsvc1"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("testuser"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:01:55.149Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"),
		// 				MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS11),
		// 				PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{
		// 				},
		// 				PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](10),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](5120),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine5),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("B_Gen4_1"),
		// 				Capacity: to.Ptr[int32](1),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierBasic),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("pgtestsvc2"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("testuser"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T21:01:55.149Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("pgtestsvc2.postgres.database.azure.com"),
		// 				MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12),
		// 				PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{
		// 					{
		// 						ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"),
		// 						Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{
		// 							PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{
		// 								ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
		// 							},
		// 							PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{
		// 								Description: to.Ptr("Auto-approved"),
		// 								ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone),
		// 								Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved),
		// 							},
		// 							ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")),
		// 						},
		// 				}},
		// 				PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](5120),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine6),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("GP_Gen4_2"),
		// 				Capacity: to.Ptr[int32](2),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("pgtestsvc3"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg1/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc3"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("testuser"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T00:11:08.550Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("pgtestsvc3.postgres.database.azure.com"),
		// 				MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS10),
		// 				PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{
		// 					{
		// 						ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc3/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"),
		// 						Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{
		// 							PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{
		// 								ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
		// 							},
		// 							PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{
		// 								Description: to.Ptr("Auto-approved"),
		// 								ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone),
		// 								Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved),
		// 							},
		// 							ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")),
		// 						},
		// 				}},
		// 				PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](35),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupEnabled),
		// 					StorageMB: to.Ptr[int32](204800),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine6),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("GP_Gen4_4"),
		// 				Capacity: to.Ptr[int32](4),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("pgtestsvc4"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"),
		// 			Location: to.Ptr("westus"),
		// 			Tags: map[string]*string{
		// 				"ElasticServer": to.Ptr("1"),
		// 			},
		// 			Properties: &armpostgresql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("cloudsa"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"),
		// 				MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS10),
		// 				PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{
		// 				},
		// 				PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armpostgresql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](128000),
		// 				},
		// 				UserVisibleState: to.Ptr(armpostgresql.ServerStateReady),
		// 				Version: to.Ptr(armpostgresql.ServerVersionNine6),
		// 			},
		// 			SKU: &armpostgresql.SKU{
		// 				Name: to.Ptr("B_Gen4_2"),
		// 				Capacity: to.Ptr[int32](2),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armpostgresql.SKUTierBasic),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ServersClientBeginCreateOptions added in v0.3.0

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

ServersClientBeginCreateOptions contains the optional parameters for the ServersClient.BeginCreate method.

type ServersClientBeginDeleteOptions added in v0.3.0

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

ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method.

type ServersClientBeginRestartOptions added in v0.3.0

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

ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method.

type ServersClientBeginUpdateOptions added in v0.3.0

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

ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method.

type ServersClientCreateResponse added in v0.3.0

type ServersClientCreateResponse struct {
	// Represents a server.
	Server
}

ServersClientCreateResponse contains the response from method ServersClient.BeginCreate.

type ServersClientDeleteResponse added in v0.3.0

type ServersClientDeleteResponse struct {
}

ServersClientDeleteResponse contains the response from method ServersClient.BeginDelete.

type ServersClientGetOptions added in v0.3.0

type ServersClientGetOptions struct {
}

ServersClientGetOptions contains the optional parameters for the ServersClient.Get method.

type ServersClientGetResponse added in v0.3.0

type ServersClientGetResponse struct {
	// Represents a server.
	Server
}

ServersClientGetResponse contains the response from method ServersClient.Get.

type ServersClientListByResourceGroupOptions added in v0.3.0

type ServersClientListByResourceGroupOptions struct {
}

ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager method.

type ServersClientListByResourceGroupResponse added in v0.3.0

type ServersClientListByResourceGroupResponse struct {
	// A list of servers.
	ServerListResult
}

ServersClientListByResourceGroupResponse contains the response from method ServersClient.NewListByResourceGroupPager.

type ServersClientListOptions added in v0.3.0

type ServersClientListOptions struct {
}

ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method.

type ServersClientListResponse added in v0.3.0

type ServersClientListResponse struct {
	// A list of servers.
	ServerListResult
}

ServersClientListResponse contains the response from method ServersClient.NewListPager.

type ServersClientRestartResponse added in v0.3.0

type ServersClientRestartResponse struct {
}

ServersClientRestartResponse contains the response from method ServersClient.BeginRestart.

type ServersClientUpdateResponse added in v0.3.0

type ServersClientUpdateResponse struct {
	// Represents a server.
	Server
}

ServersClientUpdateResponse contains the response from method ServersClient.BeginUpdate.

type StorageAutogrow

type StorageAutogrow string

StorageAutogrow - Enable Storage Auto Grow.

const (
	StorageAutogrowDisabled StorageAutogrow = "Disabled"
	StorageAutogrowEnabled  StorageAutogrow = "Enabled"
)

func PossibleStorageAutogrowValues

func PossibleStorageAutogrowValues() []StorageAutogrow

PossibleStorageAutogrowValues returns the possible values for the StorageAutogrow const type.

type StorageProfile

type StorageProfile struct {
	// Backup retention days for the server.
	BackupRetentionDays *int32

	// Enable Geo-redundant or not for server backup.
	GeoRedundantBackup *GeoRedundantBackup

	// Enable Storage Auto Grow.
	StorageAutogrow *StorageAutogrow

	// Max storage allowed for a server.
	StorageMB *int32
}

StorageProfile - Storage Profile properties of a server

func (StorageProfile) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type StorageProfile.

func (*StorageProfile) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type StorageProfile.

type TagsObject

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

TagsObject - Tags object for patch operations.

func (TagsObject) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TagsObject.

func (*TagsObject) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject.

type TrackedResource

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

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

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

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

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

TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'

func (TrackedResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

func (*TrackedResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

type VirtualNetworkRule

type VirtualNetworkRule struct {
	// Resource properties.
	Properties *VirtualNetworkRuleProperties

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

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

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

VirtualNetworkRule - A virtual network rule.

func (VirtualNetworkRule) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule.

func (*VirtualNetworkRule) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule.

type VirtualNetworkRuleListResult

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

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

VirtualNetworkRuleListResult - A list of virtual network rules.

func (VirtualNetworkRuleListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleListResult.

func (*VirtualNetworkRuleListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRuleListResult.

type VirtualNetworkRuleProperties

type VirtualNetworkRuleProperties struct {
	// REQUIRED; The ARM resource id of the virtual network subnet.
	VirtualNetworkSubnetID *string

	// Create firewall rule before the virtual network has vnet service endpoint enabled.
	IgnoreMissingVnetServiceEndpoint *bool

	// READ-ONLY; Virtual Network Rule State
	State *VirtualNetworkRuleState
}

VirtualNetworkRuleProperties - Properties of a virtual network rule.

func (VirtualNetworkRuleProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleProperties.

func (*VirtualNetworkRuleProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRuleProperties.

type VirtualNetworkRuleState

type VirtualNetworkRuleState string

VirtualNetworkRuleState - Virtual Network Rule State

const (
	VirtualNetworkRuleStateDeleting     VirtualNetworkRuleState = "Deleting"
	VirtualNetworkRuleStateInProgress   VirtualNetworkRuleState = "InProgress"
	VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing"
	VirtualNetworkRuleStateReady        VirtualNetworkRuleState = "Ready"
	VirtualNetworkRuleStateUnknown      VirtualNetworkRuleState = "Unknown"
)

func PossibleVirtualNetworkRuleStateValues

func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState

PossibleVirtualNetworkRuleStateValues returns the possible values for the VirtualNetworkRuleState const type.

type VirtualNetworkRulesClient

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

VirtualNetworkRulesClient contains the methods for the VirtualNetworkRules group. Don't use this type directly, use NewVirtualNetworkRulesClient() instead.

func NewVirtualNetworkRulesClient

func NewVirtualNetworkRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkRulesClient, error)

NewVirtualNetworkRulesClient creates a new instance of VirtualNetworkRulesClient 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 (*VirtualNetworkRulesClient) BeginCreateOrUpdate

func (client *VirtualNetworkRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, options *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkRulesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates an existing virtual network rule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • virtualNetworkRuleName - The name of the virtual network rule.
  • parameters - The requested virtual Network Rule Resource state.
  • options - VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesCreateOrUpdate.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/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworkRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", armpostgresql.VirtualNetworkRule{
		Properties: &armpostgresql.VirtualNetworkRuleProperties{
			IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
			VirtualNetworkSubnetID:           to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
		},
	}, 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.VirtualNetworkRule = armpostgresql.VirtualNetworkRule{
	// 	Name: to.Ptr("vnet-firewall-rule"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"),
	// 	Properties: &armpostgresql.VirtualNetworkRuleProperties{
	// 		IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
	// 		VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
	// 	},
	// }
}
Output:

func (*VirtualNetworkRulesClient) BeginDelete

func (client *VirtualNetworkRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkRulesClientDeleteResponse], error)

BeginDelete - Deletes the virtual network rule with the given name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • virtualNetworkRuleName - The name of the virtual network rule.
  • options - VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworkRulesClient().BeginDelete(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", 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 (*VirtualNetworkRulesClient) Get

func (client *VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientGetOptions) (VirtualNetworkRulesClientGetResponse, error)

Get - Gets a virtual network rule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • virtualNetworkRuleName - The name of the virtual network rule.
  • options - VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualNetworkRulesClient().Get(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", 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.VirtualNetworkRule = armpostgresql.VirtualNetworkRule{
	// 	Name: to.Ptr("vnet-firewall-rule"),
	// 	Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"),
	// 	Properties: &armpostgresql.VirtualNetworkRuleProperties{
	// 		IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
	// 		State: to.Ptr(armpostgresql.VirtualNetworkRuleStateReady),
	// 		VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
	// 	},
	// }
}
Output:

func (*VirtualNetworkRulesClient) NewListByServerPager added in v0.5.0

NewListByServerPager - Gets a list of virtual network rules in a server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualNetworkRulesClient().NewListByServerPager("TestGroup", "vnet-test-svr", 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.VirtualNetworkRuleListResult = armpostgresql.VirtualNetworkRuleListResult{
		// 	Value: []*armpostgresql.VirtualNetworkRule{
		// 		{
		// 			Name: to.Ptr("vnet-firewall-rule"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"),
		// 			Properties: &armpostgresql.VirtualNetworkRuleProperties{
		// 				IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
		// 				State: to.Ptr(armpostgresql.VirtualNetworkRuleStateReady),
		// 				VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("vnet-firewall-rule"),
		// 			Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"),
		// 			Properties: &armpostgresql.VirtualNetworkRuleProperties{
		// 				IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
		// 				State: to.Ptr(armpostgresql.VirtualNetworkRuleStateReady),
		// 				VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type VirtualNetworkRulesClientBeginCreateOrUpdateOptions added in v0.3.0

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

VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate method.

type VirtualNetworkRulesClientBeginDeleteOptions added in v0.3.0

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

VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete method.

type VirtualNetworkRulesClientCreateOrUpdateResponse added in v0.3.0

type VirtualNetworkRulesClientCreateOrUpdateResponse struct {
	// A virtual network rule.
	VirtualNetworkRule
}

VirtualNetworkRulesClientCreateOrUpdateResponse contains the response from method VirtualNetworkRulesClient.BeginCreateOrUpdate.

type VirtualNetworkRulesClientDeleteResponse added in v0.3.0

type VirtualNetworkRulesClientDeleteResponse struct {
}

VirtualNetworkRulesClientDeleteResponse contains the response from method VirtualNetworkRulesClient.BeginDelete.

type VirtualNetworkRulesClientGetOptions added in v0.3.0

type VirtualNetworkRulesClientGetOptions struct {
}

VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method.

type VirtualNetworkRulesClientGetResponse added in v0.3.0

type VirtualNetworkRulesClientGetResponse struct {
	// A virtual network rule.
	VirtualNetworkRule
}

VirtualNetworkRulesClientGetResponse contains the response from method VirtualNetworkRulesClient.Get.

type VirtualNetworkRulesClientListByServerOptions added in v0.3.0

type VirtualNetworkRulesClientListByServerOptions struct {
}

VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.NewListByServerPager method.

type VirtualNetworkRulesClientListByServerResponse added in v0.3.0

type VirtualNetworkRulesClientListByServerResponse struct {
	// A list of virtual network rules.
	VirtualNetworkRuleListResult
}

VirtualNetworkRulesClientListByServerResponse contains the response from method VirtualNetworkRulesClient.NewListByServerPager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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