Documentation
¶
Index ¶
- type Backup
- type CapabilitiesListResult
- type CapabilityProperties
- type CheckNameAvailabilityClient
- type CheckNameAvailabilityClientExecuteOptions
- type CheckNameAvailabilityClientExecuteResponse
- type CloudError
- type Configuration
- type ConfigurationDataType
- type ConfigurationListResult
- type ConfigurationProperties
- type ConfigurationsClient
- func (client *ConfigurationsClient) BeginPut(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[ConfigurationsClientPutResponse], error)
- func (client *ConfigurationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[ConfigurationsClientUpdateResponse], error)
- func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, ...) (ConfigurationsClientGetResponse, error)
- func (client *ConfigurationsClient) NewListByServerPager(resourceGroupName string, serverName string, ...) *runtime.Pager[ConfigurationsClientListByServerResponse]
- type ConfigurationsClientBeginPutOptions
- type ConfigurationsClientBeginUpdateOptions
- type ConfigurationsClientGetOptions
- type ConfigurationsClientGetResponse
- type ConfigurationsClientListByServerOptions
- type ConfigurationsClientListByServerResponse
- type ConfigurationsClientPutResponse
- type ConfigurationsClientUpdateResponse
- type CreateMode
- type CreateModeForUpdate
- type CreatedByType
- type Database
- type DatabaseListResult
- type DatabaseProperties
- type DatabasesClient
- func (client *DatabasesClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[DatabasesClientCreateResponse], error)
- func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[DatabasesClientDeleteResponse], error)
- func (client *DatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, ...) (DatabasesClientGetResponse, error)
- func (client *DatabasesClient) NewListByServerPager(resourceGroupName string, serverName string, ...) *runtime.Pager[DatabasesClientListByServerResponse]
- type DatabasesClientBeginCreateOptions
- type DatabasesClientBeginDeleteOptions
- type DatabasesClientCreateResponse
- type DatabasesClientDeleteResponse
- type DatabasesClientGetOptions
- type DatabasesClientGetResponse
- type DatabasesClientListByServerOptions
- type DatabasesClientListByServerResponse
- type DelegatedSubnetUsage
- type ErrorAdditionalInfo
- type ErrorResponse
- type FailoverMode
- type FirewallRule
- type FirewallRuleListResult
- type FirewallRuleProperties
- type FirewallRulesClient
- func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[FirewallRulesClientCreateOrUpdateResponse], error)
- func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[FirewallRulesClientDeleteResponse], error)
- func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, ...) (FirewallRulesClientGetResponse, error)
- func (client *FirewallRulesClient) NewListByServerPager(resourceGroupName string, serverName string, ...) *runtime.Pager[FirewallRulesClientListByServerResponse]
- type FirewallRulesClientBeginCreateOrUpdateOptions
- type FirewallRulesClientBeginDeleteOptions
- type FirewallRulesClientCreateOrUpdateResponse
- type FirewallRulesClientDeleteResponse
- type FirewallRulesClientGetOptions
- type FirewallRulesClientGetResponse
- type FirewallRulesClientListByServerOptions
- type FirewallRulesClientListByServerResponse
- type FlexibleServerEditionCapability
- type GeoRedundantBackupEnum
- type GetPrivateDNSZoneSuffixClient
- type GetPrivateDNSZoneSuffixClientExecuteOptions
- type GetPrivateDNSZoneSuffixClientExecuteResponse
- type HighAvailability
- type HighAvailabilityMode
- type HyperscaleNodeEditionCapability
- type LocationBasedCapabilitiesClient
- type LocationBasedCapabilitiesClientExecuteOptions
- type LocationBasedCapabilitiesClientExecuteResponse
- type MaintenanceWindow
- type NameAvailability
- type NameAvailabilityRequest
- type Network
- type NodeTypeCapability
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationOrigin
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type ProxyResource
- type Reason
- type Resource
- type RestartParameter
- type SKU
- type SKUTier
- type Server
- type ServerForUpdate
- type ServerHAState
- type ServerListResult
- type ServerProperties
- type ServerPropertiesForUpdate
- type ServerPublicNetworkAccessState
- type ServerState
- type ServerVersion
- type ServerVersionCapability
- type ServersClient
- func (client *ServersClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[ServersClientCreateResponse], error)
- func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[ServersClientDeleteResponse], error)
- func (client *ServersClient) BeginRestart(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[ServersClientRestartResponse], error)
- func (client *ServersClient) BeginStart(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[ServersClientStartResponse], error)
- func (client *ServersClient) BeginStop(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[ServersClientStopResponse], error)
- func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, ...) (*runtime.Poller[ServersClientUpdateResponse], error)
- func (client *ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string, ...) (ServersClientGetResponse, error)
- func (client *ServersClient) NewListByResourceGroupPager(resourceGroupName string, options *ServersClientListByResourceGroupOptions) *runtime.Pager[ServersClientListByResourceGroupResponse]
- func (client *ServersClient) NewListPager(options *ServersClientListOptions) *runtime.Pager[ServersClientListResponse]
- type ServersClientBeginCreateOptions
- type ServersClientBeginDeleteOptions
- type ServersClientBeginRestartOptions
- type ServersClientBeginStartOptions
- type ServersClientBeginStopOptions
- type ServersClientBeginUpdateOptions
- type ServersClientCreateResponse
- type ServersClientDeleteResponse
- type ServersClientGetOptions
- type ServersClientGetResponse
- type ServersClientListByResourceGroupOptions
- type ServersClientListByResourceGroupResponse
- type ServersClientListOptions
- type ServersClientListResponse
- type ServersClientRestartResponse
- type ServersClientStartResponse
- type ServersClientStopResponse
- type ServersClientUpdateResponse
- type Storage
- type StorageEditionCapability
- type StorageMBCapability
- type SystemData
- type TrackedResource
- type VcoreCapability
- type VirtualNetworkSubnetUsageClient
- type VirtualNetworkSubnetUsageClientExecuteOptions
- type VirtualNetworkSubnetUsageClientExecuteResponse
- type VirtualNetworkSubnetUsageParameter
- type VirtualNetworkSubnetUsageResult
Examples ¶
- CheckNameAvailabilityClient.Execute
- ConfigurationsClient.BeginPut
- ConfigurationsClient.BeginUpdate
- ConfigurationsClient.Get
- ConfigurationsClient.NewListByServerPager
- DatabasesClient.BeginCreate
- DatabasesClient.BeginDelete
- DatabasesClient.Get
- DatabasesClient.NewListByServerPager
- FirewallRulesClient.BeginCreateOrUpdate
- FirewallRulesClient.BeginDelete
- FirewallRulesClient.Get
- FirewallRulesClient.NewListByServerPager
- GetPrivateDNSZoneSuffixClient.Execute
- LocationBasedCapabilitiesClient.NewExecutePager
- OperationsClient.List
- ServersClient.BeginCreate
- ServersClient.BeginDelete
- ServersClient.BeginRestart
- ServersClient.BeginStart
- ServersClient.BeginStop
- ServersClient.BeginUpdate
- ServersClient.Get
- ServersClient.NewListByResourceGroupPager
- ServersClient.NewListPager
- VirtualNetworkSubnetUsageClient.Execute
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backup ¶
type Backup struct {
// Backup retention days for the server.
BackupRetentionDays *int32 `json:"backupRetentionDays,omitempty"`
// A value indicating whether Geo-Redundant backup is enabled on the server.
GeoRedundantBackup *GeoRedundantBackupEnum `json:"geoRedundantBackup,omitempty"`
// READ-ONLY; The earliest restore point time (ISO8601 format) for server.
EarliestRestoreDate *time.Time `json:"earliestRestoreDate,omitempty" azure:"ro"`
}
Backup properties of a server
func (Backup) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Backup.
func (*Backup) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Backup.
type CapabilitiesListResult ¶
type CapabilitiesListResult struct {
// READ-ONLY; Link to retrieve next page of results.
NextLink *string `json:"nextLink,omitempty" azure:"ro"`
// READ-ONLY; A list of supported capabilities.
Value []*CapabilityProperties `json:"value,omitempty" azure:"ro"`
}
CapabilitiesListResult - location capability
func (CapabilitiesListResult) MarshalJSON ¶
func (c CapabilitiesListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapabilitiesListResult.
func (*CapabilitiesListResult) UnmarshalJSON ¶ added in v1.1.0
func (c *CapabilitiesListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapabilitiesListResult.
type CapabilityProperties ¶
type CapabilityProperties struct {
// READ-ONLY; A value indicating whether a new server in this region can have geo-backups to paired region.
GeoBackupSupported *bool `json:"geoBackupSupported,omitempty" azure:"ro"`
// READ-ONLY; The status
Status *string `json:"status,omitempty" azure:"ro"`
// READ-ONLY
SupportedFlexibleServerEditions []*FlexibleServerEditionCapability `json:"supportedFlexibleServerEditions,omitempty" azure:"ro"`
// READ-ONLY; Supported high availability mode
SupportedHAMode []*string `json:"supportedHAMode,omitempty" azure:"ro"`
// READ-ONLY
SupportedHyperscaleNodeEditions []*HyperscaleNodeEditionCapability `json:"supportedHyperscaleNodeEditions,omitempty" azure:"ro"`
// READ-ONLY; zone name
Zone *string `json:"zone,omitempty" azure:"ro"`
// READ-ONLY; A value indicating whether a new server in this region can have geo-backups to paired region.
ZoneRedundantHaAndGeoBackupSupported *bool `json:"zoneRedundantHaAndGeoBackupSupported,omitempty" azure:"ro"`
// READ-ONLY; A value indicating whether a new server in this region can support multi zone HA.
ZoneRedundantHaSupported *bool `json:"zoneRedundantHaSupported,omitempty" azure:"ro"`
}
CapabilityProperties - Location capabilities.
func (CapabilityProperties) MarshalJSON ¶
func (c CapabilityProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapabilityProperties.
func (*CapabilityProperties) UnmarshalJSON ¶ added in v1.1.0
func (c *CapabilityProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapabilityProperties.
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 ¶
func (client *CheckNameAvailabilityClient) Execute(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest, options *CheckNameAvailabilityClientExecuteOptions) (CheckNameAvailabilityClientExecuteResponse, error)
Execute - Check the availability of name for resource If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewCheckNameAvailabilityClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Execute(ctx,
armpostgresqlflexibleservers.NameAvailabilityRequest{
Name: to.Ptr("name1"),
Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"),
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
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 {
NameAvailability
}
CheckNameAvailabilityClientExecuteResponse contains the response from method CheckNameAvailabilityClient.Execute.
type CloudError ¶
type CloudError struct {
// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows
// the OData error response format.)
Error *ErrorResponse `json:"error,omitempty"`
}
CloudError - An error response from the Batch service.
func (CloudError) MarshalJSON ¶ added in v1.1.0
func (c CloudError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudError.
func (*CloudError) UnmarshalJSON ¶ added in v1.1.0
func (c *CloudError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudError.
type Configuration ¶
type Configuration struct {
// The properties of a configuration.
Properties *ConfigurationProperties `json:"properties,omitempty"`
// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty" azure:"ro"`
// READ-ONLY; The name of the resource
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The system metadata relating to this resource.
SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty" azure:"ro"`
}
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 ConfigurationDataType ¶
type ConfigurationDataType string
ConfigurationDataType - Data type of the configuration.
const ( ConfigurationDataTypeBoolean ConfigurationDataType = "Boolean" ConfigurationDataTypeEnumeration ConfigurationDataType = "Enumeration" ConfigurationDataTypeInteger ConfigurationDataType = "Integer" ConfigurationDataTypeNumeric ConfigurationDataType = "Numeric" )
func PossibleConfigurationDataTypeValues ¶
func PossibleConfigurationDataTypeValues() []ConfigurationDataType
PossibleConfigurationDataTypeValues returns the possible values for the ConfigurationDataType const type.
type ConfigurationListResult ¶
type ConfigurationListResult struct {
// The link used to get the next page of operations.
NextLink *string `json:"nextLink,omitempty"`
// The list of server configurations.
Value []*Configuration `json:"value,omitempty"`
}
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 `json:"source,omitempty"`
// Value of the configuration.
Value *string `json:"value,omitempty"`
// READ-ONLY; Allowed values of the configuration.
AllowedValues *string `json:"allowedValues,omitempty" azure:"ro"`
// READ-ONLY; Data type of the configuration.
DataType *ConfigurationDataType `json:"dataType,omitempty" azure:"ro"`
// READ-ONLY; Default value of the configuration.
DefaultValue *string `json:"defaultValue,omitempty" azure:"ro"`
// READ-ONLY; Description of the configuration.
Description *string `json:"description,omitempty" azure:"ro"`
// READ-ONLY; Configuration documentation link.
DocumentationLink *string `json:"documentationLink,omitempty" azure:"ro"`
// READ-ONLY; Configuration is pending restart or not.
IsConfigPendingRestart *bool `json:"isConfigPendingRestart,omitempty" azure:"ro"`
// READ-ONLY; Configuration dynamic or static.
IsDynamicConfig *bool `json:"isDynamicConfig,omitempty" azure:"ro"`
// READ-ONLY; Configuration read-only or not.
IsReadOnly *bool `json:"isReadOnly,omitempty" azure:"ro"`
// READ-ONLY; Configuration unit.
Unit *string `json:"unit,omitempty" azure:"ro"`
}
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) BeginPut ¶
func (client *ConfigurationsClient) BeginPut(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginPutOptions) (*runtime.Poller[ConfigurationsClientPutResponse], error)
BeginPut - Updates a configuration of a server. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-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 - ConfigurationsClientBeginPutOptions contains the optional parameters for the ConfigurationsClient.BeginPut method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/ConfigurationUpdate.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewConfigurationsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginPut(ctx,
"testrg",
"testserver",
"event_scheduler",
armpostgresqlflexibleservers.Configuration{
Properties: &armpostgresqlflexibleservers.ConfigurationProperties{
Source: to.Ptr("user-override"),
Value: to.Ptr("on"),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
func (*ConfigurationsClient) BeginUpdate ¶
func (client *ConfigurationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginUpdateOptions) (*runtime.Poller[ConfigurationsClientUpdateResponse], error)
BeginUpdate - Updates a configuration of a server. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-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 - ConfigurationsClientBeginUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/ConfigurationUpdate.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewConfigurationsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginUpdate(ctx,
"testrg",
"testserver",
"event_scheduler",
armpostgresqlflexibleservers.Configuration{
Properties: &armpostgresqlflexibleservers.ConfigurationProperties{
Source: to.Ptr("user-override"),
Value: to.Ptr("on"),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
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 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewConfigurationsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"testrg",
"testserver",
"array_nulls",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-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.ListByServer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewConfigurationsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListByServerPager("testrg",
"testserver",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
type ConfigurationsClientBeginPutOptions ¶ added in v0.3.0
type ConfigurationsClientBeginPutOptions struct {
// Resumes the LRO from the provided token.
ResumeToken string
}
ConfigurationsClientBeginPutOptions contains the optional parameters for the ConfigurationsClient.BeginPut method.
type ConfigurationsClientBeginUpdateOptions ¶ added in v0.3.0
type ConfigurationsClientBeginUpdateOptions struct {
// Resumes the LRO from the provided token.
ResumeToken string
}
ConfigurationsClientBeginUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginUpdate method.
type ConfigurationsClientGetOptions ¶ added in v0.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 {
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.ListByServer method.
type ConfigurationsClientListByServerResponse ¶ added in v0.3.0
type ConfigurationsClientListByServerResponse struct {
ConfigurationListResult
}
ConfigurationsClientListByServerResponse contains the response from method ConfigurationsClient.ListByServer.
type ConfigurationsClientPutResponse ¶ added in v0.3.0
type ConfigurationsClientPutResponse struct {
Configuration
}
ConfigurationsClientPutResponse contains the response from method ConfigurationsClient.Put.
type ConfigurationsClientUpdateResponse ¶ added in v0.3.0
type ConfigurationsClientUpdateResponse struct {
Configuration
}
ConfigurationsClientUpdateResponse contains the response from method ConfigurationsClient.Update.
type CreateMode ¶
type CreateMode string
CreateMode - The mode to create a new PostgreSQL server.
const ( CreateModeCreate CreateMode = "Create" CreateModeDefault CreateMode = "Default" CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" CreateModeUpdate CreateMode = "Update" )
func PossibleCreateModeValues ¶
func PossibleCreateModeValues() []CreateMode
PossibleCreateModeValues returns the possible values for the CreateMode const type.
type CreateModeForUpdate ¶
type CreateModeForUpdate string
CreateModeForUpdate - The mode to update a new PostgreSQL server.
const ( CreateModeForUpdateDefault CreateModeForUpdate = "Default" CreateModeForUpdateUpdate CreateModeForUpdate = "Update" )
func PossibleCreateModeForUpdateValues ¶
func PossibleCreateModeForUpdateValues() []CreateModeForUpdate
PossibleCreateModeForUpdateValues returns the possible values for the CreateModeForUpdate const type.
type CreatedByType ¶
type CreatedByType string
CreatedByType - The type of identity that created the resource.
const ( CreatedByTypeApplication CreatedByType = "Application" CreatedByTypeKey CreatedByType = "Key" CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" CreatedByTypeUser CreatedByType = "User" )
func PossibleCreatedByTypeValues ¶
func PossibleCreatedByTypeValues() []CreatedByType
PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
type Database ¶
type Database struct {
// The properties of a database.
Properties *DatabaseProperties `json:"properties,omitempty"`
// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty" azure:"ro"`
// READ-ONLY; The name of the resource
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The system metadata relating to this resource.
SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty" azure:"ro"`
}
Database - Represents a Database.
func (Database) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Database.
func (*Database) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Database.
type DatabaseListResult ¶
type DatabaseListResult struct {
// The link used to get the next page of databases.
NextLink *string `json:"nextLink,omitempty"`
// The list of databases housed in a server
Value []*Database `json:"value,omitempty"`
}
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 `json:"charset,omitempty"`
// The collation of the database.
Collation *string `json:"collation,omitempty"`
}
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) BeginCreate ¶
func (client *DatabasesClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOptions) (*runtime.Poller[DatabasesClientCreateResponse], error)
BeginCreate - Creates a new database or updates an existing database. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-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 - DatabasesClientBeginCreateOptions contains the optional parameters for the DatabasesClient.BeginCreate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewDatabasesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginCreate(ctx,
"TestGroup",
"testserver",
"db1",
armpostgresqlflexibleservers.Database{
Properties: &armpostgresqlflexibleservers.DatabaseProperties{
Charset: to.Ptr("utf8"),
Collation: to.Ptr("en_US.utf8"),
},
},
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)
}
// TODO: use response item
_ = res
}
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 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewDatabasesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.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)
}
}
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 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewDatabasesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"TestGroup",
"testserver",
"db1",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-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.ListByServer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/DatabasesListByServer.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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewDatabasesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListByServerPager("TestGroup",
"testserver",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
type DatabasesClientBeginCreateOptions ¶ added in v0.3.0
type DatabasesClientBeginCreateOptions struct {
// Resumes the LRO from the provided token.
ResumeToken string
}
DatabasesClientBeginCreateOptions contains the optional parameters for the DatabasesClient.BeginCreate 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 DatabasesClientCreateResponse ¶ added in v0.3.0
type DatabasesClientCreateResponse struct {
Database
}
DatabasesClientCreateResponse contains the response from method DatabasesClient.Create.
type DatabasesClientDeleteResponse ¶ added in v0.3.0
type DatabasesClientDeleteResponse struct {
}
DatabasesClientDeleteResponse contains the response from method DatabasesClient.Delete.
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 {
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.ListByServer method.
type DatabasesClientListByServerResponse ¶ added in v0.3.0
type DatabasesClientListByServerResponse struct {
DatabaseListResult
}
DatabasesClientListByServerResponse contains the response from method DatabasesClient.ListByServer.
type DelegatedSubnetUsage ¶
type DelegatedSubnetUsage struct {
// READ-ONLY; name of the subnet
SubnetName *string `json:"subnetName,omitempty" azure:"ro"`
// READ-ONLY; Number of used delegated subnets
Usage *int64 `json:"usage,omitempty" azure:"ro"`
}
DelegatedSubnetUsage - Delegated subnet usage data.
func (DelegatedSubnetUsage) MarshalJSON ¶ added in v1.1.0
func (d DelegatedSubnetUsage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DelegatedSubnetUsage.
func (*DelegatedSubnetUsage) UnmarshalJSON ¶ added in v1.1.0
func (d *DelegatedSubnetUsage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DelegatedSubnetUsage.
type ErrorAdditionalInfo ¶
type ErrorAdditionalInfo struct {
// READ-ONLY; The additional info.
Info interface{} `json:"info,omitempty" azure:"ro"`
// READ-ONLY; The additional info type.
Type *string `json:"type,omitempty" azure:"ro"`
}
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 `json:"additionalInfo,omitempty" azure:"ro"`
// READ-ONLY; The error code.
Code *string `json:"code,omitempty" azure:"ro"`
// READ-ONLY; The error details.
Details []*ErrorResponse `json:"details,omitempty" azure:"ro"`
// READ-ONLY; The error message.
Message *string `json:"message,omitempty" azure:"ro"`
// READ-ONLY; The error target.
Target *string `json:"target,omitempty" azure:"ro"`
}
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 FailoverMode ¶
type FailoverMode string
FailoverMode - Failover mode.
const ( FailoverModeForcedFailover FailoverMode = "ForcedFailover" FailoverModeForcedSwitchover FailoverMode = "ForcedSwitchover" FailoverModePlannedFailover FailoverMode = "PlannedFailover" FailoverModePlannedSwitchover FailoverMode = "PlannedSwitchover" )
func PossibleFailoverModeValues ¶
func PossibleFailoverModeValues() []FailoverMode
PossibleFailoverModeValues returns the possible values for the FailoverMode const type.
type FirewallRule ¶
type FirewallRule struct {
// REQUIRED; The properties of a firewall rule.
Properties *FirewallRuleProperties `json:"properties,omitempty"`
// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty" azure:"ro"`
// READ-ONLY; The name of the resource
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The system metadata relating to this resource.
SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty" azure:"ro"`
}
FirewallRule - Represents a server 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 link used to get the next page of operations.
NextLink *string `json:"nextLink,omitempty"`
// The list of firewall rules in a server.
Value []*FirewallRule `json:"value,omitempty"`
}
FirewallRuleListResult - A list of firewall rules.
func (FirewallRuleListResult) MarshalJSON ¶
func (f FirewallRuleListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FirewallRuleListResult.
func (*FirewallRuleListResult) UnmarshalJSON ¶ added in 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 `json:"endIpAddress,omitempty"`
// REQUIRED; The start IP address of the server firewall rule. Must be IPv4 format.
StartIPAddress *string `json:"startIpAddress,omitempty"`
}
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 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewFirewallRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginCreateOrUpdate(ctx,
"testrg",
"testserver",
"rule1",
armpostgresqlflexibleservers.FirewallRule{
Properties: &armpostgresqlflexibleservers.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)
}
// TODO: use response item
_ = res
}
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 PostgreSQL server firewall rule. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewFirewallRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginDelete(ctx,
"testrg",
"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)
}
}
func (*FirewallRulesClient) Get ¶
func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (FirewallRulesClientGetResponse, error)
Get - List all the firewall rules in a given server. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewFirewallRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"testrg",
"testserver",
"rule1",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
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 PostgreSQL server. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-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.ListByServer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewFirewallRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListByServerPager("testrg",
"testserver",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
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 {
FirewallRule
}
FirewallRulesClientCreateOrUpdateResponse contains the response from method FirewallRulesClient.CreateOrUpdate.
type FirewallRulesClientDeleteResponse ¶ added in v0.3.0
type FirewallRulesClientDeleteResponse struct {
}
FirewallRulesClientDeleteResponse contains the response from method FirewallRulesClient.Delete.
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 {
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.ListByServer method.
type FirewallRulesClientListByServerResponse ¶ added in v0.3.0
type FirewallRulesClientListByServerResponse struct {
FirewallRuleListResult
}
FirewallRulesClientListByServerResponse contains the response from method FirewallRulesClient.ListByServer.
type FlexibleServerEditionCapability ¶
type FlexibleServerEditionCapability struct {
// READ-ONLY; Server edition name
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The status
Status *string `json:"status,omitempty" azure:"ro"`
// READ-ONLY; The list of server versions supported by this server edition.
SupportedServerVersions []*ServerVersionCapability `json:"supportedServerVersions,omitempty" azure:"ro"`
// READ-ONLY; The list of editions supported by this server edition.
SupportedStorageEditions []*StorageEditionCapability `json:"supportedStorageEditions,omitempty" azure:"ro"`
}
FlexibleServerEditionCapability - Flexible server edition capabilities.
func (FlexibleServerEditionCapability) MarshalJSON ¶
func (f FlexibleServerEditionCapability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FlexibleServerEditionCapability.
func (*FlexibleServerEditionCapability) UnmarshalJSON ¶ added in v1.1.0
func (f *FlexibleServerEditionCapability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type FlexibleServerEditionCapability.
type GeoRedundantBackupEnum ¶
type GeoRedundantBackupEnum string
GeoRedundantBackupEnum - A value indicating whether Geo-Redundant backup is enabled on the server.
const ( GeoRedundantBackupEnumDisabled GeoRedundantBackupEnum = "Disabled" GeoRedundantBackupEnumEnabled GeoRedundantBackupEnum = "Enabled" )
func PossibleGeoRedundantBackupEnumValues ¶
func PossibleGeoRedundantBackupEnumValues() []GeoRedundantBackupEnum
PossibleGeoRedundantBackupEnumValues returns the possible values for the GeoRedundantBackupEnum const type.
type GetPrivateDNSZoneSuffixClient ¶
type GetPrivateDNSZoneSuffixClient struct {
// contains filtered or unexported fields
}
GetPrivateDNSZoneSuffixClient contains the methods for the GetPrivateDNSZoneSuffix group. Don't use this type directly, use NewGetPrivateDNSZoneSuffixClient() instead.
func NewGetPrivateDNSZoneSuffixClient ¶
func NewGetPrivateDNSZoneSuffixClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GetPrivateDNSZoneSuffixClient, error)
NewGetPrivateDNSZoneSuffixClient creates a new instance of GetPrivateDNSZoneSuffixClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*GetPrivateDNSZoneSuffixClient) Execute ¶
func (client *GetPrivateDNSZoneSuffixClient) Execute(ctx context.Context, options *GetPrivateDNSZoneSuffixClientExecuteOptions) (GetPrivateDNSZoneSuffixClientExecuteResponse, error)
Execute - Get private DNS zone suffix in the cloud If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-01 options - GetPrivateDNSZoneSuffixClientExecuteOptions contains the optional parameters for the GetPrivateDNSZoneSuffixClient.Execute method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/GetPrivateDnsZoneSuffix.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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewGetPrivateDNSZoneSuffixClient(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Execute(ctx,
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
type GetPrivateDNSZoneSuffixClientExecuteOptions ¶ added in v0.3.0
type GetPrivateDNSZoneSuffixClientExecuteOptions struct {
}
GetPrivateDNSZoneSuffixClientExecuteOptions contains the optional parameters for the GetPrivateDNSZoneSuffixClient.Execute method.
type GetPrivateDNSZoneSuffixClientExecuteResponse ¶ added in v0.3.0
type GetPrivateDNSZoneSuffixClientExecuteResponse struct {
// Represents a resource name availability.
Value *string
}
GetPrivateDNSZoneSuffixClientExecuteResponse contains the response from method GetPrivateDNSZoneSuffixClient.Execute.
type HighAvailability ¶
type HighAvailability struct {
// The HA mode for the server.
Mode *HighAvailabilityMode `json:"mode,omitempty"`
// availability zone information of the standby.
StandbyAvailabilityZone *string `json:"standbyAvailabilityZone,omitempty"`
// READ-ONLY; A state of a HA server that is visible to user.
State *ServerHAState `json:"state,omitempty" azure:"ro"`
}
HighAvailability - High availability properties of a server
func (HighAvailability) MarshalJSON ¶ added in v1.1.0
func (h HighAvailability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type HighAvailability.
func (*HighAvailability) UnmarshalJSON ¶ added in v1.1.0
func (h *HighAvailability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type HighAvailability.
type HighAvailabilityMode ¶
type HighAvailabilityMode string
HighAvailabilityMode - The HA mode for the server.
const ( HighAvailabilityModeDisabled HighAvailabilityMode = "Disabled" HighAvailabilityModeZoneRedundant HighAvailabilityMode = "ZoneRedundant" )
func PossibleHighAvailabilityModeValues ¶
func PossibleHighAvailabilityModeValues() []HighAvailabilityMode
PossibleHighAvailabilityModeValues returns the possible values for the HighAvailabilityMode const type.
type HyperscaleNodeEditionCapability ¶
type HyperscaleNodeEditionCapability struct {
// READ-ONLY; Server edition name
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The status
Status *string `json:"status,omitempty" azure:"ro"`
// READ-ONLY; The list of Node Types supported by this server edition.
SupportedNodeTypes []*NodeTypeCapability `json:"supportedNodeTypes,omitempty" azure:"ro"`
// READ-ONLY; The list of server versions supported by this server edition.
SupportedServerVersions []*ServerVersionCapability `json:"supportedServerVersions,omitempty" azure:"ro"`
// READ-ONLY; The list of editions supported by this server edition.
SupportedStorageEditions []*StorageEditionCapability `json:"supportedStorageEditions,omitempty" azure:"ro"`
}
HyperscaleNodeEditionCapability - Hyperscale node edition capabilities.
func (HyperscaleNodeEditionCapability) MarshalJSON ¶
func (h HyperscaleNodeEditionCapability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type HyperscaleNodeEditionCapability.
func (*HyperscaleNodeEditionCapability) UnmarshalJSON ¶ added in v1.1.0
func (h *HyperscaleNodeEditionCapability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type HyperscaleNodeEditionCapability.
type LocationBasedCapabilitiesClient ¶
type LocationBasedCapabilitiesClient struct {
// contains filtered or unexported fields
}
LocationBasedCapabilitiesClient contains the methods for the LocationBasedCapabilities group. Don't use this type directly, use NewLocationBasedCapabilitiesClient() instead.
func NewLocationBasedCapabilitiesClient ¶
func NewLocationBasedCapabilitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationBasedCapabilitiesClient, error)
NewLocationBasedCapabilitiesClient creates a new instance of LocationBasedCapabilitiesClient 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 (*LocationBasedCapabilitiesClient) NewExecutePager ¶ added in v0.5.0
func (client *LocationBasedCapabilitiesClient) NewExecutePager(locationName string, options *LocationBasedCapabilitiesClientExecuteOptions) *runtime.Pager[LocationBasedCapabilitiesClientExecuteResponse]
NewExecutePager - Get capabilities at specified location in a given subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-01 locationName - The name of the location. options - LocationBasedCapabilitiesClientExecuteOptions contains the optional parameters for the LocationBasedCapabilitiesClient.Execute method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/CapabilitiesByLocation.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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewLocationBasedCapabilitiesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewExecutePager("westus",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
type LocationBasedCapabilitiesClientExecuteOptions ¶ added in v0.3.0
type LocationBasedCapabilitiesClientExecuteOptions struct {
}
LocationBasedCapabilitiesClientExecuteOptions contains the optional parameters for the LocationBasedCapabilitiesClient.Execute method.
type LocationBasedCapabilitiesClientExecuteResponse ¶ added in v0.3.0
type LocationBasedCapabilitiesClientExecuteResponse struct {
CapabilitiesListResult
}
LocationBasedCapabilitiesClientExecuteResponse contains the response from method LocationBasedCapabilitiesClient.Execute.
type MaintenanceWindow ¶
type MaintenanceWindow struct {
// indicates whether custom window is enabled or disabled
CustomWindow *string `json:"customWindow,omitempty"`
// day of week for maintenance window
DayOfWeek *int32 `json:"dayOfWeek,omitempty"`
// start hour for maintenance window
StartHour *int32 `json:"startHour,omitempty"`
// start minute for maintenance window
StartMinute *int32 `json:"startMinute,omitempty"`
}
MaintenanceWindow - Maintenance window properties of a server.
func (MaintenanceWindow) MarshalJSON ¶ added in v1.1.0
func (m MaintenanceWindow) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MaintenanceWindow.
func (*MaintenanceWindow) UnmarshalJSON ¶ added in v1.1.0
func (m *MaintenanceWindow) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindow.
type NameAvailability ¶
type NameAvailability struct {
// READ-ONLY; Error Message.
Message *string `json:"message,omitempty" azure:"ro"`
// READ-ONLY; name of the PostgreSQL server.
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; Indicates whether the resource name is available.
NameAvailable *bool `json:"nameAvailable,omitempty" azure:"ro"`
// READ-ONLY; The name availability reason.
Reason *Reason `json:"reason,omitempty" azure:"ro"`
// READ-ONLY; type of the server
Type *string `json:"type,omitempty" azure:"ro"`
}
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 `json:"name,omitempty"`
// Resource type used for verification.
Type *string `json:"type,omitempty"`
}
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 Network ¶
type Network struct {
// delegated subnet arm resource id.
DelegatedSubnetResourceID *string `json:"delegatedSubnetResourceId,omitempty"`
// private dns zone arm resource id.
PrivateDNSZoneArmResourceID *string `json:"privateDnsZoneArmResourceId,omitempty"`
// READ-ONLY; public network access is enabled or not
PublicNetworkAccess *ServerPublicNetworkAccessState `json:"publicNetworkAccess,omitempty" azure:"ro"`
}
Network properties of a server
func (Network) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements the json.Marshaller interface for type Network.
func (*Network) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Network.
type NodeTypeCapability ¶
type NodeTypeCapability struct {
// READ-ONLY; note type name
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; note type
NodeType *string `json:"nodeType,omitempty" azure:"ro"`
// READ-ONLY; The status
Status *string `json:"status,omitempty" azure:"ro"`
}
NodeTypeCapability - node type capability
func (NodeTypeCapability) MarshalJSON ¶ added in v1.1.0
func (n NodeTypeCapability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NodeTypeCapability.
func (*NodeTypeCapability) UnmarshalJSON ¶ added in v1.1.0
func (n *NodeTypeCapability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NodeTypeCapability.
type Operation ¶
type Operation struct {
// Indicates whether the operation is a data action
IsDataAction *bool `json:"isDataAction,omitempty"`
// READ-ONLY; The localized display information for this particular operation or action.
Display *OperationDisplay `json:"display,omitempty" azure:"ro"`
// READ-ONLY; The name of the operation being performed on this particular object.
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The intended executor of the operation.
Origin *OperationOrigin `json:"origin,omitempty" azure:"ro"`
// READ-ONLY; Additional descriptions for the operation.
Properties map[string]interface{} `json:"properties,omitempty" azure:"ro"`
}
Operation - REST API operation definition.
func (Operation) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct {
// READ-ONLY; Operation description.
Description *string `json:"description,omitempty" azure:"ro"`
// READ-ONLY; Localized friendly name for the operation.
Operation *string `json:"operation,omitempty" azure:"ro"`
// READ-ONLY; Operation resource provider name.
Provider *string `json:"provider,omitempty" azure:"ro"`
// READ-ONLY; Resource on which the operation is performed.
Resource *string `json:"resource,omitempty" azure:"ro"`
}
OperationDisplay - Display metadata associated with the operation.
func (OperationDisplay) MarshalJSON ¶ added in 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 {
// URL client should use to fetch the next page (per server side paging). It's null for now, added for future use.
NextLink *string `json:"nextLink,omitempty"`
// Collection of available operation details
Value []*Operation `json:"value,omitempty"`
}
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 ¶
func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error)
List - Lists all of the available REST API operations. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewOperationsClient(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.List(ctx,
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
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 {
OperationListResult
}
OperationsClientListResponse contains the response from method OperationsClient.List.
type ProxyResource ¶
type ProxyResource struct {
// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty" azure:"ro"`
// READ-ONLY; The name of the resource
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty" azure:"ro"`
}
ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location
func (ProxyResource) MarshalJSON ¶ added in 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 Reason ¶ added in v0.3.0
type Reason string
Reason - The name availability reason.
func PossibleReasonValues ¶ added in v0.3.0
func PossibleReasonValues() []Reason
PossibleReasonValues returns the possible values for the Reason const type.
type Resource ¶
type Resource struct {
// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty" azure:"ro"`
// READ-ONLY; The name of the resource
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty" azure:"ro"`
}
Resource - Common fields that are returned in the response for all Azure Resource Manager resources
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
type RestartParameter ¶
type RestartParameter struct {
// Failover mode.
FailoverMode *FailoverMode `json:"failoverMode,omitempty"`
// Indicates whether to restart the server with failover.
RestartWithFailover *bool `json:"restartWithFailover,omitempty"`
}
RestartParameter - Represents server restart parameters.
func (RestartParameter) MarshalJSON ¶ added in v1.1.0
func (r RestartParameter) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestartParameter.
func (*RestartParameter) UnmarshalJSON ¶ added in v1.1.0
func (r *RestartParameter) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestartParameter.
type SKU ¶
type SKU struct {
// REQUIRED; The name of the sku, typically, tier + family + cores, e.g. StandardD4sv3.
Name *string `json:"name,omitempty"`
// REQUIRED; The tier of the particular SKU, e.g. Burstable.
Tier *SKUTier `json:"tier,omitempty"`
}
SKU - Sku information related properties of a server.
func (SKU) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements the json.Marshaller interface for type SKU.
func (*SKU) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type SKU.
type SKUTier ¶
type SKUTier string
SKUTier - The tier of the particular SKU, e.g. Burstable.
func PossibleSKUTierValues ¶
func PossibleSKUTierValues() []SKUTier
PossibleSKUTierValues returns the possible values for the SKUTier const type.
type Server ¶
type Server struct {
// REQUIRED; The geo-location where the resource lives
Location *string `json:"location,omitempty"`
// Properties of the server.
Properties *ServerProperties `json:"properties,omitempty"`
// The SKU (pricing tier) of the server.
SKU *SKU `json:"sku,omitempty"`
// Resource tags.
Tags map[string]*string `json:"tags,omitempty"`
// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty" azure:"ro"`
// READ-ONLY; The name of the resource
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The system metadata relating to this resource.
SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty" azure:"ro"`
}
Server - Represents a server.
func (Server) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Server.
func (*Server) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Server.
type ServerForUpdate ¶
type ServerForUpdate struct {
// The location the resource resides in.
Location *string `json:"location,omitempty"`
// Properties of the server.
Properties *ServerPropertiesForUpdate `json:"properties,omitempty"`
// The SKU (pricing tier) of the server.
SKU *SKU `json:"sku,omitempty"`
// Application-specific metadata in the form of key-value pairs.
Tags map[string]*string `json:"tags,omitempty"`
}
ServerForUpdate - Represents a server to be updated.
func (ServerForUpdate) MarshalJSON ¶
func (s ServerForUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerForUpdate.
func (*ServerForUpdate) UnmarshalJSON ¶ added in v1.1.0
func (s *ServerForUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerForUpdate.
type ServerHAState ¶
type ServerHAState string
ServerHAState - A state of a HA server that is visible to user.
const ( ServerHAStateCreatingStandby ServerHAState = "CreatingStandby" ServerHAStateFailingOver ServerHAState = "FailingOver" ServerHAStateHealthy ServerHAState = "Healthy" ServerHAStateNotEnabled ServerHAState = "NotEnabled" ServerHAStateRemovingStandby ServerHAState = "RemovingStandby" ServerHAStateReplicatingData ServerHAState = "ReplicatingData" )
func PossibleServerHAStateValues ¶
func PossibleServerHAStateValues() []ServerHAState
PossibleServerHAStateValues returns the possible values for the ServerHAState const type.
type ServerListResult ¶
type ServerListResult struct {
// The link used to get the next page of operations.
NextLink *string `json:"nextLink,omitempty"`
// The list of flexible servers
Value []*Server `json:"value,omitempty"`
}
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 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 `json:"administratorLogin,omitempty"`
// The administrator login password (required for server creation).
AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
// availability zone information of the server.
AvailabilityZone *string `json:"availabilityZone,omitempty"`
// Backup properties of a server.
Backup *Backup `json:"backup,omitempty"`
// The mode to create a new PostgreSQL server.
CreateMode *CreateMode `json:"createMode,omitempty"`
// High availability properties of a server.
HighAvailability *HighAvailability `json:"highAvailability,omitempty"`
// Maintenance window properties of a server.
MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
// Network properties of a server.
Network *Network `json:"network,omitempty"`
// Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when 'createMode' is 'PointInTimeRestore'.
PointInTimeUTC *time.Time `json:"pointInTimeUTC,omitempty"`
// The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore'.
SourceServerResourceID *string `json:"sourceServerResourceId,omitempty"`
// Storage properties of a server.
Storage *Storage `json:"storage,omitempty"`
// PostgreSQL Server version.
Version *ServerVersion `json:"version,omitempty"`
// READ-ONLY; The fully qualified domain name of a server.
FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty" azure:"ro"`
// READ-ONLY; The minor version of the server.
MinorVersion *string `json:"minorVersion,omitempty" azure:"ro"`
// READ-ONLY; A state of a server that is visible to user.
State *ServerState `json:"state,omitempty" azure:"ro"`
}
ServerProperties - The properties of a server.
func (ServerProperties) MarshalJSON ¶
func (s ServerProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerProperties.
func (*ServerProperties) UnmarshalJSON ¶
func (s *ServerProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties.
type ServerPropertiesForUpdate ¶
type ServerPropertiesForUpdate struct {
// The password of the administrator login.
AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
// Backup properties of a server.
Backup *Backup `json:"backup,omitempty"`
// The mode to update a new PostgreSQL server.
CreateMode *CreateModeForUpdate `json:"createMode,omitempty"`
// High availability properties of a server.
HighAvailability *HighAvailability `json:"highAvailability,omitempty"`
// Maintenance window properties of a server.
MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
// Storage properties of a server.
Storage *Storage `json:"storage,omitempty"`
}
func (ServerPropertiesForUpdate) MarshalJSON ¶ added in v1.1.0
func (s ServerPropertiesForUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForUpdate.
func (*ServerPropertiesForUpdate) UnmarshalJSON ¶ added in v1.1.0
func (s *ServerPropertiesForUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForUpdate.
type ServerPublicNetworkAccessState ¶
type ServerPublicNetworkAccessState string
ServerPublicNetworkAccessState - public network access is enabled or not
const ( ServerPublicNetworkAccessStateDisabled ServerPublicNetworkAccessState = "Disabled" ServerPublicNetworkAccessStateEnabled ServerPublicNetworkAccessState = "Enabled" )
func PossibleServerPublicNetworkAccessStateValues ¶
func PossibleServerPublicNetworkAccessStateValues() []ServerPublicNetworkAccessState
PossibleServerPublicNetworkAccessStateValues returns the possible values for the ServerPublicNetworkAccessState 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" ServerStateReady ServerState = "Ready" ServerStateStarting ServerState = "Starting" ServerStateStopped ServerState = "Stopped" ServerStateStopping ServerState = "Stopping" ServerStateUpdating ServerState = "Updating" )
func PossibleServerStateValues ¶
func PossibleServerStateValues() []ServerState
PossibleServerStateValues returns the possible values for the ServerState const type.
type ServerVersion ¶
type ServerVersion string
ServerVersion - The version of a server.
const ( ServerVersionEleven ServerVersion = "11" ServerVersionFourteen ServerVersion = "14" ServerVersionThirteen ServerVersion = "13" ServerVersionTwelve ServerVersion = "12" )
func PossibleServerVersionValues ¶
func PossibleServerVersionValues() []ServerVersion
PossibleServerVersionValues returns the possible values for the ServerVersion const type.
type ServerVersionCapability ¶
type ServerVersionCapability struct {
// READ-ONLY; server version
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The status
Status *string `json:"status,omitempty" azure:"ro"`
// READ-ONLY
SupportedVcores []*VcoreCapability `json:"supportedVcores,omitempty" azure:"ro"`
}
ServerVersionCapability - Server version capabilities.
func (ServerVersionCapability) MarshalJSON ¶
func (s ServerVersionCapability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServerVersionCapability.
func (*ServerVersionCapability) UnmarshalJSON ¶ added in v1.1.0
func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServerVersionCapability.
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 Server, options *ServersClientBeginCreateOptions) (*runtime.Poller[ServersClientCreateResponse], error)
BeginCreate - Creates a new server. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-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 ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginCreate(ctx,
"testrg",
"pgtestsvc5",
armpostgresqlflexibleservers.Server{
Location: to.Ptr("westus"),
Properties: &armpostgresqlflexibleservers.ServerProperties{
CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModePointInTimeRestore),
PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T00:04:59.4078005+00:00"); return t }()),
SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"),
},
},
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)
}
// TODO: use response item
_ = res
}
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 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginDelete(ctx,
"testrg",
"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)
}
}
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 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginRestart(ctx,
"testrg",
"testserver",
&armpostgresqlflexibleservers.ServersClientBeginRestartOptions{Parameters: 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)
}
}
func (*ServersClient) BeginStart ¶
func (client *ServersClient) BeginStart(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStartOptions) (*runtime.Poller[ServersClientStartResponse], error)
BeginStart - Starts a server. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-01 resourceGroupName - The name of the resource group. The name is case insensitive. serverName - The name of the server. options - ServersClientBeginStartOptions contains the optional parameters for the ServersClient.BeginStart method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/ServerStart.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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginStart(ctx,
"testrg",
"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)
}
}
func (*ServersClient) BeginStop ¶
func (client *ServersClient) BeginStop(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStopOptions) (*runtime.Poller[ServersClientStopResponse], error)
BeginStop - Stops a server. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-01 resourceGroupName - The name of the resource group. The name is case insensitive. serverName - The name of the server. options - ServersClientBeginStopOptions contains the optional parameters for the ServersClient.BeginStop method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/ServerStop.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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginStop(ctx,
"testrg",
"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)
}
}
func (*ServersClient) BeginUpdate ¶
func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForUpdate, 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 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginUpdate(ctx,
"TestGroup",
"pgtestsvc4",
armpostgresqlflexibleservers.ServerForUpdate{
Location: to.Ptr("westus"),
Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{
AdministratorLoginPassword: to.Ptr("newpassword"),
Backup: &armpostgresqlflexibleservers.Backup{
BackupRetentionDays: to.Ptr[int32](20),
},
CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate),
Storage: &armpostgresqlflexibleservers.Storage{
StorageSizeGB: to.Ptr[int32](1024),
},
},
SKU: &armpostgresqlflexibleservers.SKU{
Name: to.Ptr("Standard_D8s_v3"),
Tier: to.Ptr(armpostgresqlflexibleservers.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)
}
// TODO: use response item
_ = res
}
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 2021-06-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/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"testrg",
"pgtestsvc1",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-01 resourceGroupName - The name of the resource group. The name is case insensitive. options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.ListByResourceGroup method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListByResourceGroupPager("testrg",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
func (*ServersClient) NewListPager ¶ added in v0.5.0
func (client *ServersClient) NewListPager(options *ServersClientListOptions) *runtime.Pager[ServersClientListResponse]
NewListPager - List all the servers in a given subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-01 options - ServersClientListOptions contains the optional parameters for the ServersClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager(nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
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 {
// The parameters for restarting a server.
Parameters *RestartParameter
// Resumes the LRO from the provided token.
ResumeToken string
}
ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method.
type ServersClientBeginStartOptions ¶ added in v0.3.0
type ServersClientBeginStartOptions struct {
// Resumes the LRO from the provided token.
ResumeToken string
}
ServersClientBeginStartOptions contains the optional parameters for the ServersClient.BeginStart method.
type ServersClientBeginStopOptions ¶ added in v0.3.0
type ServersClientBeginStopOptions struct {
// Resumes the LRO from the provided token.
ResumeToken string
}
ServersClientBeginStopOptions contains the optional parameters for the ServersClient.BeginStop 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 {
Server
}
ServersClientCreateResponse contains the response from method ServersClient.Create.
type ServersClientDeleteResponse ¶ added in v0.3.0
type ServersClientDeleteResponse struct {
}
ServersClientDeleteResponse contains the response from method ServersClient.Delete.
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 {
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.ListByResourceGroup method.
type ServersClientListByResourceGroupResponse ¶ added in v0.3.0
type ServersClientListByResourceGroupResponse struct {
ServerListResult
}
ServersClientListByResourceGroupResponse contains the response from method ServersClient.ListByResourceGroup.
type ServersClientListOptions ¶ added in v0.3.0
type ServersClientListOptions struct {
}
ServersClientListOptions contains the optional parameters for the ServersClient.List method.
type ServersClientListResponse ¶ added in v0.3.0
type ServersClientListResponse struct {
ServerListResult
}
ServersClientListResponse contains the response from method ServersClient.List.
type ServersClientRestartResponse ¶ added in v0.3.0
type ServersClientRestartResponse struct {
}
ServersClientRestartResponse contains the response from method ServersClient.Restart.
type ServersClientStartResponse ¶ added in v0.3.0
type ServersClientStartResponse struct {
}
ServersClientStartResponse contains the response from method ServersClient.Start.
type ServersClientStopResponse ¶ added in v0.3.0
type ServersClientStopResponse struct {
}
ServersClientStopResponse contains the response from method ServersClient.Stop.
type ServersClientUpdateResponse ¶ added in v0.3.0
type ServersClientUpdateResponse struct {
Server
}
ServersClientUpdateResponse contains the response from method ServersClient.Update.
type Storage ¶
type Storage struct {
// Max storage allowed for a server.
StorageSizeGB *int32 `json:"storageSizeGB,omitempty"`
}
Storage properties of a server
func (Storage) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements the json.Marshaller interface for type Storage.
func (*Storage) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Storage.
type StorageEditionCapability ¶
type StorageEditionCapability struct {
// READ-ONLY; storage edition name
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The status
Status *string `json:"status,omitempty" azure:"ro"`
// READ-ONLY
SupportedStorageMB []*StorageMBCapability `json:"supportedStorageMB,omitempty" azure:"ro"`
}
StorageEditionCapability - storage edition capability
func (StorageEditionCapability) MarshalJSON ¶
func (s StorageEditionCapability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageEditionCapability.
func (*StorageEditionCapability) UnmarshalJSON ¶ added in v1.1.0
func (s *StorageEditionCapability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageEditionCapability.
type StorageMBCapability ¶
type StorageMBCapability struct {
// READ-ONLY; storage MB name
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The status
Status *string `json:"status,omitempty" azure:"ro"`
// READ-ONLY; storage size in MB
StorageSizeMB *int64 `json:"storageSizeMB,omitempty" azure:"ro"`
// READ-ONLY; supported IOPS
SupportedIops *int64 `json:"supportedIops,omitempty" azure:"ro"`
}
StorageMBCapability - storage size in MB capability
func (StorageMBCapability) MarshalJSON ¶ added in v1.1.0
func (s StorageMBCapability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageMBCapability.
func (*StorageMBCapability) UnmarshalJSON ¶ added in v1.1.0
func (s *StorageMBCapability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageMBCapability.
type SystemData ¶
type SystemData struct {
// The timestamp of resource creation (UTC).
CreatedAt *time.Time `json:"createdAt,omitempty"`
// The identity that created the resource.
CreatedBy *string `json:"createdBy,omitempty"`
// The type of identity that created the resource.
CreatedByType *CreatedByType `json:"createdByType,omitempty"`
// The timestamp of resource last modification (UTC)
LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"`
// The identity that last modified the resource.
LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
// The type of identity that last modified the resource.
LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"`
}
SystemData - Metadata pertaining to creation and last modification of the resource.
func (SystemData) MarshalJSON ¶
func (s SystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SystemData.
func (*SystemData) UnmarshalJSON ¶
func (s *SystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
type TrackedResource ¶
type TrackedResource struct {
// REQUIRED; The geo-location where the resource lives
Location *string `json:"location,omitempty"`
// Resource tags.
Tags map[string]*string `json:"tags,omitempty"`
// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty" azure:"ro"`
// READ-ONLY; The name of the resource
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty" azure:"ro"`
}
TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
func (TrackedResource) MarshalJSON ¶
func (t TrackedResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TrackedResource.
func (*TrackedResource) UnmarshalJSON ¶ added in v1.1.0
func (t *TrackedResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.
type VcoreCapability ¶
type VcoreCapability struct {
// READ-ONLY; vCore name
Name *string `json:"name,omitempty" azure:"ro"`
// READ-ONLY; The status
Status *string `json:"status,omitempty" azure:"ro"`
// READ-ONLY; supported IOPS
SupportedIops *int64 `json:"supportedIops,omitempty" azure:"ro"`
// READ-ONLY; supported memory per vCore in MB
SupportedMemoryPerVcoreMB *int64 `json:"supportedMemoryPerVcoreMB,omitempty" azure:"ro"`
// READ-ONLY; supported vCores
VCores *int64 `json:"vCores,omitempty" azure:"ro"`
}
VcoreCapability - Vcores capability
func (VcoreCapability) MarshalJSON ¶ added in v1.1.0
func (v VcoreCapability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VcoreCapability.
func (*VcoreCapability) UnmarshalJSON ¶ added in v1.1.0
func (v *VcoreCapability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VcoreCapability.
type VirtualNetworkSubnetUsageClient ¶
type VirtualNetworkSubnetUsageClient struct {
// contains filtered or unexported fields
}
VirtualNetworkSubnetUsageClient contains the methods for the VirtualNetworkSubnetUsage group. Don't use this type directly, use NewVirtualNetworkSubnetUsageClient() instead.
func NewVirtualNetworkSubnetUsageClient ¶
func NewVirtualNetworkSubnetUsageClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkSubnetUsageClient, error)
NewVirtualNetworkSubnetUsageClient creates a new instance of VirtualNetworkSubnetUsageClient 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 (*VirtualNetworkSubnetUsageClient) Execute ¶
func (client *VirtualNetworkSubnetUsageClient) Execute(ctx context.Context, locationName string, parameters VirtualNetworkSubnetUsageParameter, options *VirtualNetworkSubnetUsageClientExecuteOptions) (VirtualNetworkSubnetUsageClientExecuteResponse, error)
Execute - Get virtual network subnet usage for a given vNet resource id. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-01 locationName - The name of the location. parameters - The required parameters for creating or updating a server. options - VirtualNetworkSubnetUsageClientExecuteOptions contains the optional parameters for the VirtualNetworkSubnetUsageClient.Execute method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2021-06-01/examples/VirtualNetworkSubnetUsage.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/armpostgresqlflexibleservers"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armpostgresqlflexibleservers.NewVirtualNetworkSubnetUsageClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Execute(ctx,
"westus",
armpostgresqlflexibleservers.VirtualNetworkSubnetUsageParameter{
VirtualNetworkArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"),
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
type VirtualNetworkSubnetUsageClientExecuteOptions ¶ added in v0.3.0
type VirtualNetworkSubnetUsageClientExecuteOptions struct {
}
VirtualNetworkSubnetUsageClientExecuteOptions contains the optional parameters for the VirtualNetworkSubnetUsageClient.Execute method.
type VirtualNetworkSubnetUsageClientExecuteResponse ¶ added in v0.3.0
type VirtualNetworkSubnetUsageClientExecuteResponse struct {
VirtualNetworkSubnetUsageResult
}
VirtualNetworkSubnetUsageClientExecuteResponse contains the response from method VirtualNetworkSubnetUsageClient.Execute.
type VirtualNetworkSubnetUsageParameter ¶
type VirtualNetworkSubnetUsageParameter struct {
// Virtual network resource id.
VirtualNetworkArmResourceID *string `json:"virtualNetworkArmResourceId,omitempty"`
}
VirtualNetworkSubnetUsageParameter - Virtual network subnet usage parameter
func (VirtualNetworkSubnetUsageParameter) MarshalJSON ¶ added in v1.1.0
func (v VirtualNetworkSubnetUsageParameter) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualNetworkSubnetUsageParameter.
func (*VirtualNetworkSubnetUsageParameter) UnmarshalJSON ¶ added in v1.1.0
func (v *VirtualNetworkSubnetUsageParameter) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkSubnetUsageParameter.
type VirtualNetworkSubnetUsageResult ¶
type VirtualNetworkSubnetUsageResult struct {
// READ-ONLY
DelegatedSubnetsUsage []*DelegatedSubnetUsage `json:"delegatedSubnetsUsage,omitempty" azure:"ro"`
// READ-ONLY; The location the resource resides in.
Location *string `json:"location,omitempty" azure:"ro"`
// READ-ONLY; The subscription ID.
SubscriptionID *string `json:"subscriptionId,omitempty" azure:"ro"`
}
VirtualNetworkSubnetUsageResult - Virtual network subnet usage data.
func (VirtualNetworkSubnetUsageResult) MarshalJSON ¶
func (v VirtualNetworkSubnetUsageResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualNetworkSubnetUsageResult.
func (*VirtualNetworkSubnetUsageResult) UnmarshalJSON ¶ added in v1.1.0
func (v *VirtualNetworkSubnetUsageResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkSubnetUsageResult.
Source Files
¶
- build.go
- checknameavailability_client.go
- configurations_client.go
- constants.go
- databases_client.go
- firewallrules_client.go
- getprivatednszonesuffix_client.go
- locationbasedcapabilities_client.go
- models.go
- models_serde.go
- operations_client.go
- response_types.go
- servers_client.go
- time_rfc3339.go
- virtualnetworksubnetusage_client.go