Aktualizuje istniejący serwer. Treść żądania może zawierać jedną lub wiele właściwości obecnych w normalnej definicji serwera.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}?api-version=2024-08-01
Parametry identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Nazwa grupy zasobów. Nazwa jest niewrażliwa na wielkość liter.
|
serverName
|
path |
True
|
string
minLength: 3 maxLength: 63 pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*
|
Nazwa serwera.
|
subscriptionId
|
path |
True
|
string
(uuid)
|
Identyfikator subskrypcji docelowej. Wartość musi być identyfikatorem UUID.
|
api-version
|
query |
True
|
string
minLength: 1
|
Wersja interfejsu API do użycia dla tej operacji.
|
Treść żądania
Nazwa |
Typ |
Opis |
parameters
|
ServerForUpdate
|
Parametry wymagane do zaktualizowania serwera elastycznego.
|
Odpowiedzi
Nazwa |
Typ |
Opis |
200 OK
|
Server
|
OK
|
202 Accepted
|
|
Zaakceptowano
Nagłówki
Location: string
|
Other Status Codes
|
ErrorResponse
|
Odpowiedź na błąd opisująca, dlaczego operacja nie powiodła się.
|
Zabezpieczenia
azure_auth
Przepływ OAuth2 w usłudze Microsoft Entra
Typ:
oauth2
Flow:
implicit
Adres URL autoryzacji:
https://login.microsoftonline.com/common/oauth2/authorize
Zakresy
Nazwa |
Opis |
user_impersonation
|
personifikacja konta użytkownika
|
Przykłady
Przykładowe żądanie
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2024-08-01
{
"properties": {
"replica": {
"promoteMode": "standalone",
"promoteOption": "forced"
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationPromoteOption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/
* PromoteReplicaAsForcedStandaloneServer.json
*/
/**
* Sample code: Promote a replica server as a Standalone server as forced, i.e. it will promote a replica server
* immediately without waiting for primary and replica to be in sync.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void
promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withReplica(new Replica().withPromoteMode(ReadReplicaPromoteMode.STANDALONE)
.withPromoteOption(ReplicationPromoteOption.FORCED)).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python promote_replica_as_forced_standalone_server.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="testResourceGroup",
server_name="pgtestsvc4-replica",
parameters={"properties": {"replica": {"promoteMode": "standalone", "promoteOption": "forced"}}},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsForcedStandaloneServer.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
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/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsForcedStandaloneServer.json
func ExampleServersClient_BeginUpdate_promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{
Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{
Replica: &armpostgresqlflexibleservers.Replica{
PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeStandalone),
PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionForced),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Server = armpostgresqlflexibleservers.Server{
// Name: to.Ptr("pgtestsvc4-replica"),
// Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "ElasticServer": to.Ptr("1"),
// },
// Properties: &armpostgresqlflexibleservers.ServerProperties{
// AdministratorLogin: to.Ptr("cloudsa"),
// AuthConfig: &armpostgresqlflexibleservers.AuthConfig{
// ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled),
// PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled),
// },
// AvailabilityZone: to.Ptr("1"),
// Backup: &armpostgresqlflexibleservers.Backup{
// BackupRetentionDays: to.Ptr[int32](20),
// EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()),
// GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled),
// },
// DataEncryption: &armpostgresqlflexibleservers.DataEncryption{
// Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged),
// },
// FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"),
// HighAvailability: &armpostgresqlflexibleservers.HighAvailability{
// Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant),
// StandbyAvailabilityZone: to.Ptr("2"),
// State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy),
// },
// MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{
// CustomWindow: to.Ptr("Disabled"),
// DayOfWeek: to.Ptr[int32](0),
// StartHour: to.Ptr[int32](0),
// StartMinute: to.Ptr[int32](0),
// },
// MinorVersion: to.Ptr("6"),
// Network: &armpostgresqlflexibleservers.Network{
// DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
// PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"),
// PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled),
// },
// Replica: &armpostgresqlflexibleservers.Replica{
// Capacity: to.Ptr[int32](0),
// Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleNone),
// },
// State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady),
// Storage: &armpostgresqlflexibleservers.Storage{
// AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled),
// Iops: to.Ptr[int32](5000),
// StorageSizeGB: to.Ptr[int32](1024),
// Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30),
// },
// Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve),
// },
// SKU: &armpostgresqlflexibleservers.SKU{
// Name: to.Ptr("Standard_D8s_v3"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsForcedStandaloneServer.json
*/
async function promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup";
const serverName = "pgtestsvc4-replica";
const parameters = {
replica: { promoteMode: "standalone", promoteOption: "forced" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsForcedStandaloneServer.json
// this example is just showing the usage of "Servers_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlFlexibleServerResource created on azure
// for more information of creating PostgreSqlFlexibleServerResource, please refer to the document of PostgreSqlFlexibleServerResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testResourceGroup";
string serverName = "pgtestsvc4-replica";
ResourceIdentifier postgreSqlFlexibleServerResourceId = PostgreSqlFlexibleServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
PostgreSqlFlexibleServerResource postgreSqlFlexibleServer = client.GetPostgreSqlFlexibleServerResource(postgreSqlFlexibleServerResourceId);
// invoke the operation
PostgreSqlFlexibleServerPatch patch = new PostgreSqlFlexibleServerPatch()
{
Replica = new PostgreSqlFlexibleServersReplica()
{
PromoteMode = ReadReplicaPromoteMode.Standalone,
PromoteOption = ReplicationPromoteOption.Forced,
},
};
ArmOperation<PostgreSqlFlexibleServerResource> lro = await postgreSqlFlexibleServer.UpdateAsync(WaitUntil.Completed, patch);
PostgreSqlFlexibleServerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlFlexibleServerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"sku": {
"name": "Standard_D8s_v3",
"tier": "GeneralPurpose"
},
"properties": {
"fullyQualifiedDomainName": "exampleserver.postgres.database.azure.com",
"version": "16",
"minorVersion": "8",
"administratorLogin": "administratorlogin",
"state": "Ready",
"availabilityZone": "1",
"dataEncryption": {
"type": "SystemManaged"
},
"authConfig": {
"activeDirectoryAuth": "Disabled",
"passwordAuth": "Enabled"
},
"storage": {
"storageSizeGB": 1024,
"autoGrow": "Enabled",
"tier": "P30",
"iops": 5000
},
"backup": {
"backupRetentionDays": 20,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2024-08-01T18:35:22.123456Z"
},
"network": {
"publicNetworkAccess": "Disabled",
"delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet",
"privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "2"
},
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replica": {
"role": "None",
"capacity": 0
}
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver",
"name": "exampleserver",
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Przykładowe żądanie
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2024-08-01
{
"properties": {
"replica": {
"promoteMode": "standalone",
"promoteOption": "planned"
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationPromoteOption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/
* PromoteReplicaAsPlannedStandaloneServer.json
*/
/**
* Sample code: Promote a replica server as a Standalone server as planned, i.e. it will wait for replication to
* complete.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withReplica(new Replica().withPromoteMode(ReadReplicaPromoteMode.STANDALONE)
.withPromoteOption(ReplicationPromoteOption.PLANNED)).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python promote_replica_as_planned_standalone_server.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="testResourceGroup",
server_name="pgtestsvc4-replica",
parameters={"properties": {"replica": {"promoteMode": "standalone", "promoteOption": "planned"}}},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsPlannedStandaloneServer.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
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/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsPlannedStandaloneServer.json
func ExampleServersClient_BeginUpdate_promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{
Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{
Replica: &armpostgresqlflexibleservers.Replica{
PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeStandalone),
PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionPlanned),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Server = armpostgresqlflexibleservers.Server{
// Name: to.Ptr("pgtestsvc4-replica"),
// Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "ElasticServer": to.Ptr("1"),
// },
// Properties: &armpostgresqlflexibleservers.ServerProperties{
// AdministratorLogin: to.Ptr("cloudsa"),
// AuthConfig: &armpostgresqlflexibleservers.AuthConfig{
// ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled),
// PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled),
// },
// AvailabilityZone: to.Ptr("1"),
// Backup: &armpostgresqlflexibleservers.Backup{
// BackupRetentionDays: to.Ptr[int32](20),
// EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()),
// GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled),
// },
// DataEncryption: &armpostgresqlflexibleservers.DataEncryption{
// Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged),
// },
// FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"),
// HighAvailability: &armpostgresqlflexibleservers.HighAvailability{
// Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant),
// StandbyAvailabilityZone: to.Ptr("2"),
// State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy),
// },
// MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{
// CustomWindow: to.Ptr("Disabled"),
// DayOfWeek: to.Ptr[int32](0),
// StartHour: to.Ptr[int32](0),
// StartMinute: to.Ptr[int32](0),
// },
// MinorVersion: to.Ptr("6"),
// Network: &armpostgresqlflexibleservers.Network{
// DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
// PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"),
// PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled),
// },
// Replica: &armpostgresqlflexibleservers.Replica{
// Capacity: to.Ptr[int32](0),
// Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleNone),
// },
// State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady),
// Storage: &armpostgresqlflexibleservers.Storage{
// AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled),
// Iops: to.Ptr[int32](5000),
// StorageSizeGB: to.Ptr[int32](1024),
// Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30),
// },
// Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve),
// },
// SKU: &armpostgresqlflexibleservers.SKU{
// Name: to.Ptr("Standard_D8s_v3"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsPlannedStandaloneServer.json
*/
async function promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup";
const serverName = "pgtestsvc4-replica";
const parameters = {
replica: { promoteMode: "standalone", promoteOption: "planned" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsPlannedStandaloneServer.json
// this example is just showing the usage of "Servers_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlFlexibleServerResource created on azure
// for more information of creating PostgreSqlFlexibleServerResource, please refer to the document of PostgreSqlFlexibleServerResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testResourceGroup";
string serverName = "pgtestsvc4-replica";
ResourceIdentifier postgreSqlFlexibleServerResourceId = PostgreSqlFlexibleServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
PostgreSqlFlexibleServerResource postgreSqlFlexibleServer = client.GetPostgreSqlFlexibleServerResource(postgreSqlFlexibleServerResourceId);
// invoke the operation
PostgreSqlFlexibleServerPatch patch = new PostgreSqlFlexibleServerPatch()
{
Replica = new PostgreSqlFlexibleServersReplica()
{
PromoteMode = ReadReplicaPromoteMode.Standalone,
PromoteOption = ReplicationPromoteOption.Planned,
},
};
ArmOperation<PostgreSqlFlexibleServerResource> lro = await postgreSqlFlexibleServer.UpdateAsync(WaitUntil.Completed, patch);
PostgreSqlFlexibleServerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlFlexibleServerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"sku": {
"name": "Standard_D8s_v3",
"tier": "GeneralPurpose"
},
"properties": {
"fullyQualifiedDomainName": "exampleserver.postgres.database.azure.com",
"version": "16",
"minorVersion": "8",
"administratorLogin": "administratorlogin",
"state": "Ready",
"availabilityZone": "1",
"dataEncryption": {
"type": "SystemManaged"
},
"authConfig": {
"activeDirectoryAuth": "Disabled",
"passwordAuth": "Enabled"
},
"storage": {
"storageSizeGB": 1024,
"autoGrow": "Enabled",
"tier": "P30",
"iops": 5000
},
"backup": {
"backupRetentionDays": 20,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2025-02-26T01:16:58.3723361+00:00"
},
"network": {
"publicNetworkAccess": "Disabled",
"delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet",
"privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "2"
},
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replica": {
"role": "None",
"capacity": 0
}
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver",
"name": "exampleserver",
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Switch over a read replica to primary server with forced data synchronization. Meaning that it doesn't wait for data in the read replica to be synchronized with its source server before it initiates the switching of roles between the read replica and the primary server.
Przykładowe żądanie
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2024-08-01
{
"properties": {
"replica": {
"promoteMode": "switchover",
"promoteOption": "forced"
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationPromoteOption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/
* PromoteReplicaAsForcedSwitchover.json
*/
/**
* Sample code: SwitchOver a replica server as forced, i.e. it will replica as Primary and original primary as
* replica immediately without waiting for primary and replica to be in sync.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void
switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withReplica(new Replica().withPromoteMode(ReadReplicaPromoteMode.SWITCHOVER)
.withPromoteOption(ReplicationPromoteOption.FORCED)).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python promote_replica_as_forced_switchover.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="testResourceGroup",
server_name="pgtestsvc4-replica",
parameters={"properties": {"replica": {"promoteMode": "switchover", "promoteOption": "forced"}}},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsForcedSwitchover.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
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/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsForcedSwitchover.json
func ExampleServersClient_BeginUpdate_switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{
Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{
Replica: &armpostgresqlflexibleservers.Replica{
PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeSwitchover),
PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionForced),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Server = armpostgresqlflexibleservers.Server{
// Name: to.Ptr("pgtestsvc4-replica"),
// Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "ElasticServer": to.Ptr("1"),
// },
// Properties: &armpostgresqlflexibleservers.ServerProperties{
// AdministratorLogin: to.Ptr("cloudsa"),
// AuthConfig: &armpostgresqlflexibleservers.AuthConfig{
// ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled),
// PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled),
// },
// AvailabilityZone: to.Ptr("1"),
// Backup: &armpostgresqlflexibleservers.Backup{
// BackupRetentionDays: to.Ptr[int32](20),
// EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()),
// GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled),
// },
// DataEncryption: &armpostgresqlflexibleservers.DataEncryption{
// Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged),
// },
// FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"),
// HighAvailability: &armpostgresqlflexibleservers.HighAvailability{
// Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant),
// StandbyAvailabilityZone: to.Ptr("2"),
// State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy),
// },
// MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{
// CustomWindow: to.Ptr("Disabled"),
// DayOfWeek: to.Ptr[int32](0),
// StartHour: to.Ptr[int32](0),
// StartMinute: to.Ptr[int32](0),
// },
// MinorVersion: to.Ptr("6"),
// Network: &armpostgresqlflexibleservers.Network{
// DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
// PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"),
// PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled),
// },
// Replica: &armpostgresqlflexibleservers.Replica{
// Capacity: to.Ptr[int32](5),
// Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary),
// },
// State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady),
// Storage: &armpostgresqlflexibleservers.Storage{
// AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled),
// Iops: to.Ptr[int32](5000),
// StorageSizeGB: to.Ptr[int32](1024),
// Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30),
// },
// Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve),
// },
// SKU: &armpostgresqlflexibleservers.SKU{
// Name: to.Ptr("Standard_D8s_v3"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsForcedSwitchover.json
*/
async function switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup";
const serverName = "pgtestsvc4-replica";
const parameters = {
replica: { promoteMode: "switchover", promoteOption: "forced" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsForcedSwitchover.json
// this example is just showing the usage of "Servers_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlFlexibleServerResource created on azure
// for more information of creating PostgreSqlFlexibleServerResource, please refer to the document of PostgreSqlFlexibleServerResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testResourceGroup";
string serverName = "pgtestsvc4-replica";
ResourceIdentifier postgreSqlFlexibleServerResourceId = PostgreSqlFlexibleServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
PostgreSqlFlexibleServerResource postgreSqlFlexibleServer = client.GetPostgreSqlFlexibleServerResource(postgreSqlFlexibleServerResourceId);
// invoke the operation
PostgreSqlFlexibleServerPatch patch = new PostgreSqlFlexibleServerPatch()
{
Replica = new PostgreSqlFlexibleServersReplica()
{
PromoteMode = ReadReplicaPromoteMode.Switchover,
PromoteOption = ReplicationPromoteOption.Forced,
},
};
ArmOperation<PostgreSqlFlexibleServerResource> lro = await postgreSqlFlexibleServer.UpdateAsync(WaitUntil.Completed, patch);
PostgreSqlFlexibleServerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlFlexibleServerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"sku": {
"name": "Standard_D8s_v3",
"tier": "GeneralPurpose"
},
"properties": {
"fullyQualifiedDomainName": "exampleserver.postgres.database.azure.com",
"version": "16",
"minorVersion": "8",
"administratorLogin": "administratorlogin",
"state": "Ready",
"availabilityZone": "1",
"dataEncryption": {
"type": "SystemManaged"
},
"authConfig": {
"activeDirectoryAuth": "Disabled",
"passwordAuth": "Enabled"
},
"storage": {
"storageSizeGB": 1024,
"autoGrow": "Enabled",
"tier": "P30",
"iops": 5000
},
"backup": {
"backupRetentionDays": 20,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2024-08-01T18:35:22.123456Z"
},
"network": {
"publicNetworkAccess": "Disabled",
"delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet",
"privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "2"
},
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replica": {
"role": "Primary",
"capacity": 5
}
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver",
"name": "exampleserver",
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Switch over a read replica to primary server with planned data synchronization. Meaning that it waits for data in the read replica to be fully synchronized with its source server before it initiates the switching of roles between the read replica and the primary server.
Przykładowe żądanie
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2024-08-01
{
"properties": {
"replica": {
"promoteMode": "switchover",
"promoteOption": "planned"
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationPromoteOption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/
* PromoteReplicaAsPlannedSwitchover.json
*/
/**
* Sample code: SwitchOver a replica server as planned, i.e. it will wait for replication to complete before
* promoting replica as Primary and original primary as replica.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void
switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withReplica(new Replica().withPromoteMode(ReadReplicaPromoteMode.SWITCHOVER)
.withPromoteOption(ReplicationPromoteOption.PLANNED)).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python promote_replica_as_planned_switchover.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="testResourceGroup",
server_name="pgtestsvc4-replica",
parameters={"properties": {"replica": {"promoteMode": "switchover", "promoteOption": "planned"}}},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsPlannedSwitchover.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
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/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsPlannedSwitchover.json
func ExampleServersClient_BeginUpdate_switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{
Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{
Replica: &armpostgresqlflexibleservers.Replica{
PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeSwitchover),
PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionPlanned),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Server = armpostgresqlflexibleservers.Server{
// Name: to.Ptr("pgtestsvc4-replica"),
// Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "ElasticServer": to.Ptr("1"),
// },
// Properties: &armpostgresqlflexibleservers.ServerProperties{
// AdministratorLogin: to.Ptr("cloudsa"),
// AuthConfig: &armpostgresqlflexibleservers.AuthConfig{
// ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled),
// PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled),
// },
// AvailabilityZone: to.Ptr("1"),
// Backup: &armpostgresqlflexibleservers.Backup{
// BackupRetentionDays: to.Ptr[int32](20),
// EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()),
// GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled),
// },
// DataEncryption: &armpostgresqlflexibleservers.DataEncryption{
// Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged),
// },
// FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"),
// HighAvailability: &armpostgresqlflexibleservers.HighAvailability{
// Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant),
// StandbyAvailabilityZone: to.Ptr("2"),
// State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy),
// },
// MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{
// CustomWindow: to.Ptr("Disabled"),
// DayOfWeek: to.Ptr[int32](0),
// StartHour: to.Ptr[int32](0),
// StartMinute: to.Ptr[int32](0),
// },
// MinorVersion: to.Ptr("6"),
// Network: &armpostgresqlflexibleservers.Network{
// DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
// PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"),
// PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled),
// },
// Replica: &armpostgresqlflexibleservers.Replica{
// Capacity: to.Ptr[int32](5),
// Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary),
// },
// State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady),
// Storage: &armpostgresqlflexibleservers.Storage{
// AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled),
// Iops: to.Ptr[int32](5000),
// StorageSizeGB: to.Ptr[int32](1024),
// Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30),
// },
// Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve),
// },
// SKU: &armpostgresqlflexibleservers.SKU{
// Name: to.Ptr("Standard_D8s_v3"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsPlannedSwitchover.json
*/
async function switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testResourceGroup";
const serverName = "pgtestsvc4-replica";
const parameters = {
replica: { promoteMode: "switchover", promoteOption: "planned" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/PromoteReplicaAsPlannedSwitchover.json
// this example is just showing the usage of "Servers_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlFlexibleServerResource created on azure
// for more information of creating PostgreSqlFlexibleServerResource, please refer to the document of PostgreSqlFlexibleServerResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testResourceGroup";
string serverName = "pgtestsvc4-replica";
ResourceIdentifier postgreSqlFlexibleServerResourceId = PostgreSqlFlexibleServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
PostgreSqlFlexibleServerResource postgreSqlFlexibleServer = client.GetPostgreSqlFlexibleServerResource(postgreSqlFlexibleServerResourceId);
// invoke the operation
PostgreSqlFlexibleServerPatch patch = new PostgreSqlFlexibleServerPatch()
{
Replica = new PostgreSqlFlexibleServersReplica()
{
PromoteMode = ReadReplicaPromoteMode.Switchover,
PromoteOption = ReplicationPromoteOption.Planned,
},
};
ArmOperation<PostgreSqlFlexibleServerResource> lro = await postgreSqlFlexibleServer.UpdateAsync(WaitUntil.Completed, patch);
PostgreSqlFlexibleServerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlFlexibleServerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"sku": {
"name": "Standard_D8s_v3",
"tier": "GeneralPurpose"
},
"properties": {
"fullyQualifiedDomainName": "exampleserver.postgres.database.azure.com",
"version": "16",
"minorVersion": "8",
"administratorLogin": "administratorlogin",
"state": "Ready",
"availabilityZone": "1",
"dataEncryption": {
"type": "SystemManaged"
},
"authConfig": {
"activeDirectoryAuth": "Disabled",
"passwordAuth": "Enabled"
},
"storage": {
"storageSizeGB": 1024,
"autoGrow": "Enabled",
"tier": "P30",
"iops": 5000
},
"backup": {
"backupRetentionDays": 20,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2024-08-01T18:35:22.123456Z"
},
"network": {
"publicNetworkAccess": "Disabled",
"delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet",
"privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "2"
},
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replica": {
"role": "Primary",
"capacity": 5
}
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver",
"name": "exampleserver",
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Update an existing flexible server to upgrade the major version of PostgreSQL database engine.
Przykładowe żądanie
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2024-08-01
{
"properties": {
"createMode": "Update",
"version": "16"
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/
* ServerUpdateWithMajorVersionUpgrade.json
*/
/**
* Sample code: ServerUpdateWithMajorVersionUpgrade.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void serverUpdateWithMajorVersionUpgrade(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE).getValue();
resource.update().withVersion(ServerVersion.ONE_FOUR).withCreateMode(CreateModeForUpdate.UPDATE).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python server_update_with_major_version_upgrade.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="testrg",
server_name="pgtestsvc4",
parameters={"properties": {"createMode": "Update", "version": "14"}},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithMajorVersionUpgrade.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
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/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithMajorVersionUpgrade.json
func ExampleServersClient_BeginUpdate_serverUpdateWithMajorVersionUpgrade() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{
Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{
CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate),
Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionFourteen),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Server = armpostgresqlflexibleservers.Server{
// Name: to.Ptr("pgtestsvc4"),
// Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "ElasticServer": to.Ptr("1"),
// },
// Properties: &armpostgresqlflexibleservers.ServerProperties{
// AdministratorLogin: to.Ptr("cloudsa"),
// AuthConfig: &armpostgresqlflexibleservers.AuthConfig{
// ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled),
// PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled),
// },
// AvailabilityZone: to.Ptr("1"),
// Backup: &armpostgresqlflexibleservers.Backup{
// BackupRetentionDays: to.Ptr[int32](7),
// EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()),
// GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled),
// },
// DataEncryption: &armpostgresqlflexibleservers.DataEncryption{
// Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged),
// },
// FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"),
// HighAvailability: &armpostgresqlflexibleservers.HighAvailability{
// Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant),
// StandbyAvailabilityZone: to.Ptr("2"),
// State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy),
// },
// MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{
// CustomWindow: to.Ptr("Disabled"),
// DayOfWeek: to.Ptr[int32](0),
// StartHour: to.Ptr[int32](0),
// StartMinute: to.Ptr[int32](0),
// },
// MinorVersion: to.Ptr("6"),
// Network: &armpostgresqlflexibleservers.Network{
// DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
// PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"),
// PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled),
// },
// State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady),
// Storage: &armpostgresqlflexibleservers.Storage{
// AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled),
// Iops: to.Ptr[int32](2300),
// StorageSizeGB: to.Ptr[int32](512),
// Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20),
// },
// Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionFourteen),
// },
// SKU: &armpostgresqlflexibleservers.SKU{
// Name: to.Ptr("Standard_D4s_v3"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithMajorVersionUpgrade.json
*/
async function serverUpdateWithMajorVersionUpgrade() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "testrg";
const serverName = "pgtestsvc4";
const parameters = { createMode: "Update", version: "14" };
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithMajorVersionUpgrade.json
// this example is just showing the usage of "Servers_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlFlexibleServerResource created on azure
// for more information of creating PostgreSqlFlexibleServerResource, please refer to the document of PostgreSqlFlexibleServerResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testrg";
string serverName = "pgtestsvc4";
ResourceIdentifier postgreSqlFlexibleServerResourceId = PostgreSqlFlexibleServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
PostgreSqlFlexibleServerResource postgreSqlFlexibleServer = client.GetPostgreSqlFlexibleServerResource(postgreSqlFlexibleServerResourceId);
// invoke the operation
PostgreSqlFlexibleServerPatch patch = new PostgreSqlFlexibleServerPatch()
{
Version = PostgreSqlFlexibleServerVersion.Ver14,
CreateMode = PostgreSqlFlexibleServerCreateModeForUpdate.Update,
};
ArmOperation<PostgreSqlFlexibleServerResource> lro = await postgreSqlFlexibleServer.UpdateAsync(WaitUntil.Completed, patch);
PostgreSqlFlexibleServerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlFlexibleServerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"sku": {
"name": "Standard_D4ds_v5",
"tier": "GeneralPurpose"
},
"properties": {
"fullyQualifiedDomainName": "exampleserver.exampleprivatednszone.postgres.database.azure.com",
"version": "16",
"minorVersion": "8",
"administratorLogin": "administratorlogin",
"state": "Ready",
"availabilityZone": "1",
"storage": {
"storageSizeGB": 512,
"autoGrow": "Enabled",
"tier": "P20",
"iops": 2300
},
"dataEncryption": {
"type": "SystemManaged"
},
"authConfig": {
"activeDirectoryAuth": "Disabled",
"passwordAuth": "Enabled"
},
"backup": {
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2024-08-01T18:35:22.123456Z"
},
"network": {
"publicNetworkAccess": "Disabled",
"delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet",
"privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "2"
},
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
}
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver",
"name": "exampleserver",
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Update an existing flexible server with custom maintenance window.
Przykładowe żądanie
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2024-08-01
{
"properties": {
"createMode": "Update",
"maintenanceWindow": {
"customWindow": "Enabled",
"dayOfWeek": 0,
"startHour": 8,
"startMinute": 0
}
}
}
Przykładowa odpowiedź
{
"sku": {
"name": "Standard_D4ds_v5",
"tier": "GeneralPurpose"
},
"properties": {
"fullyQualifiedDomainName": "exampleserver.exampleprivatednszone.postgres.database.azure.com",
"version": "16",
"minorVersion": "8",
"administratorLogin": "administratorlogin",
"state": "Ready",
"availabilityZone": "1",
"storage": {
"storageSizeGB": 512,
"autoGrow": "Disabled",
"tier": "P20",
"iops": 2300
},
"dataEncryption": {
"type": "SystemManaged"
},
"authConfig": {
"activeDirectoryAuth": "Disabled",
"passwordAuth": "Enabled"
},
"backup": {
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2024-08-01T18:35:22.123456Z"
},
"network": {
"publicNetworkAccess": "Disabled",
"delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet",
"privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "2"
},
"maintenanceWindow": {
"customWindow": "Enabled",
"dayOfWeek": 0,
"startHour": 8,
"startMinute": 0
}
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver",
"name": "exampleserver",
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Update an existing flexible server with data encryption based on customer managed key.
Przykładowe żądanie
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2024-08-01
{
"sku": {
"tier": "GeneralPurpose",
"name": "Standard_D8s_v3"
},
"identity": {
"userAssignedIdentities": {
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {},
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity": {}
},
"type": "UserAssigned"
},
"properties": {
"administratorLoginPassword": "examplenewpassword",
"createMode": "Update",
"dataEncryption": {
"type": "AzureKeyVault",
"primaryKeyURI": "https://exampleprimarykeyvault.vault.azure.net/keys/examplekey/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity",
"geoBackupKeyURI": "https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
"geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity"
},
"backup": {
"backupRetentionDays": 20
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.ArmServerKeyType;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup;
import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate;
import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku;
import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier;
import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity;
import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/
* ServerUpdateWithDataEncryptionEnabled.json
*/
/**
* Sample code: ServerUpdateWithDataEncryptionEnabled.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void serverUpdateWithDataEncryptionEnabled(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE).getValue();
resource.update().withSku(new Sku().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE))
.withIdentity(new UserAssignedIdentity().withUserAssignedIdentities(mapOf(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity",
new UserIdentity(),
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity",
new UserIdentity())).withType(IdentityType.USER_ASSIGNED))
.withAdministratorLoginPassword("newpassword").withBackup(new Backup().withBackupRetentionDays(20))
.withDataEncryption(new DataEncryption().withPrimaryKeyUri("fakeTokenPlaceholder")
.withPrimaryUserAssignedIdentityId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity")
.withGeoBackupKeyUri("fakeTokenPlaceholder")
.withGeoBackupUserAssignedIdentityId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity")
.withType(ArmServerKeyType.AZURE_KEY_VAULT))
.withCreateMode(CreateModeForUpdate.UPDATE).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python server_update_with_data_encryption_enabled.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="TestGroup",
server_name="pgtestsvc4",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": {},
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {},
},
},
"properties": {
"administratorLoginPassword": "newpassword",
"backup": {"backupRetentionDays": 20},
"createMode": "Update",
"dataEncryption": {
"geoBackupKeyURI": "https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787",
"geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity",
"primaryKeyURI": "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787",
"primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity",
"type": "AzureKeyVault",
},
},
"sku": {"name": "Standard_D8s_v3", "tier": "GeneralPurpose"},
},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithDataEncryptionEnabled.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
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/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithDataEncryptionEnabled.json
func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "TestGroup", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{
Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{
Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": {},
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {},
},
},
Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{
AdministratorLoginPassword: to.Ptr("newpassword"),
Backup: &armpostgresqlflexibleservers.Backup{
BackupRetentionDays: to.Ptr[int32](20),
},
CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate),
DataEncryption: &armpostgresqlflexibleservers.DataEncryption{
Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault),
GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787"),
GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"),
PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"),
PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"),
},
},
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)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Server = armpostgresqlflexibleservers.Server{
// Name: to.Ptr("pgtestsvc4"),
// Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "ElasticServer": to.Ptr("1"),
// },
// Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{
// Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{
// "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{
// ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"),
// },
// "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{
// ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"),
// },
// "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity-1": &armpostgresqlflexibleservers.UserIdentity{
// ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// PrincipalID: to.Ptr("90008082-e024-4cc3-8fcf-63bcdb9cf6b6"),
// },
// },
// },
// Properties: &armpostgresqlflexibleservers.ServerProperties{
// AdministratorLogin: to.Ptr("cloudsa"),
// AuthConfig: &armpostgresqlflexibleservers.AuthConfig{
// ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled),
// PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled),
// },
// AvailabilityZone: to.Ptr("1"),
// Backup: &armpostgresqlflexibleservers.Backup{
// BackupRetentionDays: to.Ptr[int32](20),
// EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()),
// GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled),
// },
// DataEncryption: &armpostgresqlflexibleservers.DataEncryption{
// Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault),
// GeoBackupEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid),
// GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787"),
// GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"),
// PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid),
// PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"),
// PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"),
// },
// FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"),
// HighAvailability: &armpostgresqlflexibleservers.HighAvailability{
// Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant),
// StandbyAvailabilityZone: to.Ptr("2"),
// State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy),
// },
// MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{
// CustomWindow: to.Ptr("Disabled"),
// DayOfWeek: to.Ptr[int32](0),
// StartHour: to.Ptr[int32](0),
// StartMinute: to.Ptr[int32](0),
// },
// MinorVersion: to.Ptr("6"),
// Network: &armpostgresqlflexibleservers.Network{
// DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
// PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"),
// PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled),
// },
// State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady),
// Storage: &armpostgresqlflexibleservers.Storage{
// AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled),
// Iops: to.Ptr[int32](5000),
// StorageSizeGB: to.Ptr[int32](1024),
// Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30),
// },
// Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve),
// },
// SKU: &armpostgresqlflexibleservers.SKU{
// Name: to.Ptr("Standard_D8s_v3"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithDataEncryptionEnabled.json
*/
async function serverUpdateWithDataEncryptionEnabled() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "TestGroup";
const serverName = "pgtestsvc4";
const parameters = {
administratorLoginPassword: "newpassword",
backup: { backupRetentionDays: 20 },
createMode: "Update",
dataEncryption: {
type: "AzureKeyVault",
geoBackupKeyURI:
"https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787",
geoBackupUserAssignedIdentityId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity",
primaryKeyURI:
"https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787",
primaryUserAssignedIdentityId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity",
},
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/ffffffffFfffFfffFfffFfffffffffff/resourceGroups/testresourcegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/testGeoUsermanagedidentity":
{},
"/subscriptions/ffffffffFfffFfffFfffFfffffffffff/resourceGroups/testresourcegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/testUsermanagedidentity":
{},
},
},
sku: { name: "Standard_D8s_v3", tier: "GeneralPurpose" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithDataEncryptionEnabled.json
// this example is just showing the usage of "Servers_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlFlexibleServerResource created on azure
// for more information of creating PostgreSqlFlexibleServerResource, please refer to the document of PostgreSqlFlexibleServerResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "TestGroup";
string serverName = "pgtestsvc4";
ResourceIdentifier postgreSqlFlexibleServerResourceId = PostgreSqlFlexibleServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
PostgreSqlFlexibleServerResource postgreSqlFlexibleServer = client.GetPostgreSqlFlexibleServerResource(postgreSqlFlexibleServerResourceId);
// invoke the operation
PostgreSqlFlexibleServerPatch patch = new PostgreSqlFlexibleServerPatch()
{
Sku = new PostgreSqlFlexibleServerSku("Standard_D8s_v3", PostgreSqlFlexibleServerSkuTier.GeneralPurpose),
Identity = new PostgreSqlFlexibleServerUserAssignedIdentity(PostgreSqlFlexibleServerIdentityType.UserAssigned)
{
UserAssignedIdentities =
{
["/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"] = new UserAssignedIdentity(),
["/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"] = new UserAssignedIdentity(),
},
},
AdministratorLoginPassword = "newpassword",
Backup = new PostgreSqlFlexibleServerBackupProperties()
{
BackupRetentionDays = 20,
},
DataEncryption = new PostgreSqlFlexibleServerDataEncryption()
{
PrimaryKeyUri = new Uri("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"),
PrimaryUserAssignedIdentityId = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"),
GeoBackupKeyUri = new Uri("https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787"),
GeoBackupUserAssignedIdentityId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity",
KeyType = PostgreSqlFlexibleServerKeyType.AzureKeyVault,
},
CreateMode = PostgreSqlFlexibleServerCreateModeForUpdate.Update,
};
ArmOperation<PostgreSqlFlexibleServerResource> lro = await postgreSqlFlexibleServer.UpdateAsync(WaitUntil.Completed, patch);
PostgreSqlFlexibleServerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlFlexibleServerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"sku": {
"name": "Standard_D8s_v3",
"tier": "GeneralPurpose"
},
"identity": {
"userAssignedIdentities": {
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {
"principalId": "pppppppp-pppp-pppp-pppp-pppppppppppp",
"clientId": "cccccccc-cccc-cccc-cccc-cccccccccccc"
},
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity-1": {
"principalId": "90008082-e024-4cc3-8fcf-63bcdb9cf6b6",
"clientId": "cccccccc-cccc-cccc-cccc-cccccccccccc"
},
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity": {
"principalId": "pppppppp-pppp-pppp-pppp-pppppppppppp",
"clientId": "cccccccc-cccc-cccc-cccc-cccccccccccc"
}
},
"type": "UserAssigned",
"tenantId": "cccccccc-cccc-cccc-cccc-cccccccccccc"
},
"properties": {
"fullyQualifiedDomainName": "exampleserver.exampleprivatednszone.postgres.database.azure.com",
"version": "16",
"minorVersion": "8",
"administratorLogin": "administratorlogin",
"state": "Ready",
"availabilityZone": "1",
"authConfig": {
"activeDirectoryAuth": "Disabled",
"passwordAuth": "Enabled"
},
"dataEncryption": {
"type": "AzureKeyVault",
"primaryKeyURI": "https://exampleprimarykeyvault.vault.azure.net/keys/examplekey/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity",
"geoBackupKeyURI": "https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
"geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity",
"primaryEncryptionKeyStatus": "Valid",
"geoBackupEncryptionKeyStatus": "Valid"
},
"storage": {
"storageSizeGB": 1024,
"autoGrow": "Disabled",
"tier": "P30",
"iops": 5000
},
"backup": {
"backupRetentionDays": 20,
"geoRedundantBackup": "Enabled",
"earliestRestoreDate": "2024-08-01T18:35:22.123456Z"
},
"network": {
"publicNetworkAccess": "Disabled",
"delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet",
"privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "2"
},
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
}
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver",
"name": "exampleserver",
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Update an existing flexible server with Microsoft Entra authentication enabled.
Przykładowe żądanie
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2024-08-01
{
"sku": {
"tier": "GeneralPurpose",
"name": "Standard_D8s_v3"
},
"properties": {
"administratorLoginPassword": "examplenewpassword",
"createMode": "Update",
"authConfig": {
"activeDirectoryAuth": "Enabled",
"passwordAuth": "Enabled",
"tenantId": "tttttt-tttt-tttt-tttt-tttttttttttt"
},
"storage": {
"storageSizeGB": 1024,
"autoGrow": "Disabled",
"tier": "P30"
},
"backup": {
"backupRetentionDays": 20
}
}
}
Przykładowa odpowiedź
{
"sku": {
"name": "Standard_D8s_v3",
"tier": "GeneralPurpose"
},
"properties": {
"fullyQualifiedDomainName": "exampleserver.exampleprivatednszone.postgres.database.azure.com",
"version": "16",
"minorVersion": "8",
"administratorLogin": "administratorlogin",
"state": "Ready",
"availabilityZone": "1",
"dataEncryption": {
"type": "SystemManaged"
},
"authConfig": {
"activeDirectoryAuth": "Enabled",
"passwordAuth": "Enabled",
"tenantId": "tttttt-tttt-tttt-tttt-tttttttttttt"
},
"storage": {
"storageSizeGB": 1024,
"autoGrow": "Disabled",
"tier": "P30",
"iops": 5000
},
"backup": {
"backupRetentionDays": 20,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2024-08-01T18:35:22.123456Z"
},
"network": {
"publicNetworkAccess": "Disabled",
"delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet",
"privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "2"
},
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
}
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver",
"name": "exampleserver",
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Update an existing flexible server.
Przykładowe żądanie
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2024-08-01
{
"sku": {
"tier": "GeneralPurpose",
"name": "Standard_D8s_v3"
},
"properties": {
"administratorLoginPassword": "examplenewpassword",
"createMode": "Update",
"storage": {
"storageSizeGB": 1024,
"autoGrow": "Enabled",
"tier": "P30"
},
"backup": {
"backupRetentionDays": 20
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTiers;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup;
import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku;
import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage;
import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json
*/
/**
* Sample code: ServerUpdate.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void serverUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("TestGroup", "pgtestsvc4", com.azure.core.util.Context.NONE).getValue();
resource.update().withSku(new Sku().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE))
.withAdministratorLoginPassword("newpassword")
.withStorage(new Storage().withStorageSizeGB(1024).withAutoGrow(StorageAutoGrow.ENABLED)
.withTier(AzureManagedDiskPerformanceTiers.P30))
.withBackup(new Backup().withBackupRetentionDays(20)).withCreateMode(CreateModeForUpdate.UPDATE).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python server_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="TestGroup",
server_name="pgtestsvc4",
parameters={
"properties": {
"administratorLoginPassword": "newpassword",
"backup": {"backupRetentionDays": 20},
"createMode": "Update",
"storage": {"autoGrow": "Enabled", "storageSizeGB": 1024, "tier": "P30"},
},
"sku": {"name": "Standard_D8s_v3", "tier": "GeneralPurpose"},
},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
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/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json
func ExampleServersClient_BeginUpdate_serverUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "TestGroup", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{
Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{
AdministratorLoginPassword: to.Ptr("newpassword"),
Backup: &armpostgresqlflexibleservers.Backup{
BackupRetentionDays: to.Ptr[int32](20),
},
CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate),
Storage: &armpostgresqlflexibleservers.Storage{
AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled),
StorageSizeGB: to.Ptr[int32](1024),
Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30),
},
},
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)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Server = armpostgresqlflexibleservers.Server{
// Name: to.Ptr("pgtestsvc4"),
// Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "ElasticServer": to.Ptr("1"),
// },
// Properties: &armpostgresqlflexibleservers.ServerProperties{
// AdministratorLogin: to.Ptr("cloudsa"),
// AuthConfig: &armpostgresqlflexibleservers.AuthConfig{
// ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled),
// PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled),
// },
// AvailabilityZone: to.Ptr("1"),
// Backup: &armpostgresqlflexibleservers.Backup{
// BackupRetentionDays: to.Ptr[int32](20),
// EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()),
// GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled),
// },
// DataEncryption: &armpostgresqlflexibleservers.DataEncryption{
// Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged),
// },
// FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"),
// HighAvailability: &armpostgresqlflexibleservers.HighAvailability{
// Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant),
// StandbyAvailabilityZone: to.Ptr("2"),
// State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy),
// },
// MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{
// CustomWindow: to.Ptr("Disabled"),
// DayOfWeek: to.Ptr[int32](0),
// StartHour: to.Ptr[int32](0),
// StartMinute: to.Ptr[int32](0),
// },
// MinorVersion: to.Ptr("6"),
// Network: &armpostgresqlflexibleservers.Network{
// DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
// PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"),
// PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled),
// },
// State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady),
// Storage: &armpostgresqlflexibleservers.Storage{
// AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled),
// Iops: to.Ptr[int32](5000),
// StorageSizeGB: to.Ptr[int32](1024),
// Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30),
// },
// Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve),
// },
// SKU: &armpostgresqlflexibleservers.SKU{
// Name: to.Ptr("Standard_D8s_v3"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json
*/
async function serverUpdate() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "TestGroup";
const serverName = "pgtestsvc4";
const parameters = {
administratorLoginPassword: "newpassword",
backup: { backupRetentionDays: 20 },
createMode: "Update",
sku: { name: "Standard_D8s_v3", tier: "GeneralPurpose" },
storage: { autoGrow: "Enabled", storageSizeGB: 1024, tier: "P30" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.PostgreSql.FlexibleServers;
// Generated from example definition: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json
// this example is just showing the usage of "Servers_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PostgreSqlFlexibleServerResource created on azure
// for more information of creating PostgreSqlFlexibleServerResource, please refer to the document of PostgreSqlFlexibleServerResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "TestGroup";
string serverName = "pgtestsvc4";
ResourceIdentifier postgreSqlFlexibleServerResourceId = PostgreSqlFlexibleServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
PostgreSqlFlexibleServerResource postgreSqlFlexibleServer = client.GetPostgreSqlFlexibleServerResource(postgreSqlFlexibleServerResourceId);
// invoke the operation
PostgreSqlFlexibleServerPatch patch = new PostgreSqlFlexibleServerPatch()
{
Sku = new PostgreSqlFlexibleServerSku("Standard_D8s_v3", PostgreSqlFlexibleServerSkuTier.GeneralPurpose),
AdministratorLoginPassword = "newpassword",
Storage = new PostgreSqlFlexibleServerStorage()
{
StorageSizeInGB = 1024,
AutoGrow = StorageAutoGrow.Enabled,
Tier = PostgreSqlManagedDiskPerformanceTier.P30,
},
Backup = new PostgreSqlFlexibleServerBackupProperties()
{
BackupRetentionDays = 20,
},
CreateMode = PostgreSqlFlexibleServerCreateModeForUpdate.Update,
};
ArmOperation<PostgreSqlFlexibleServerResource> lro = await postgreSqlFlexibleServer.UpdateAsync(WaitUntil.Completed, patch);
PostgreSqlFlexibleServerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
PostgreSqlFlexibleServerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"sku": {
"name": "Standard_D8s_v3",
"tier": "GeneralPurpose"
},
"properties": {
"fullyQualifiedDomainName": "exampleserver.exampleprivatednszone.postgres.database.azure.com",
"version": "16",
"minorVersion": "8",
"administratorLogin": "administratorlogin",
"state": "Ready",
"availabilityZone": "1",
"dataEncryption": {
"type": "SystemManaged"
},
"authConfig": {
"activeDirectoryAuth": "Disabled",
"passwordAuth": "Enabled"
},
"storage": {
"storageSizeGB": 1024,
"autoGrow": "Enabled",
"tier": "P30",
"iops": 5000
},
"backup": {
"backupRetentionDays": 20,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2024-08-01T18:30:22.123456Z"
},
"network": {
"publicNetworkAccess": "Disabled",
"delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/virtualNetworks/examplevirtualnetwork/subnets/examplesubnet",
"privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.Network/privateDnsZones/exampleprivatednszone.postgres.database.azure.com"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "2"
},
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
}
},
"location": "westus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver",
"name": "exampleserver",
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/azureAsyncOperation/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/southeastasia/operationResults/e276a03a-1770-4549-86f5-0edffae8997c?api-version=2024-08-01
Definicje
Nazwa |
Opis |
activeDirectoryAuthEnum
|
Wskazuje, czy serwer obsługuje uwierzytelnianie Microsoft Entra.
|
ArmServerKeyType
|
Typ szyfrowania danych używany przez serwer elastyczny.
|
AuthConfig
|
Właściwości konfiguracji uwierzytelniania serwera elastycznego.
|
AzureManagedDiskPerformanceTiers
|
Warstwa magazynowania serwera elastycznego.
|
Backup
|
Właściwości kopii zapasowej serwera elastycznego.
|
createdByType
|
Typ tożsamości, która utworzyła zasób.
|
CreateMode
|
Tryb tworzenia nowego serwera elastycznego.
|
CreateModeForUpdate
|
Tryb aktualizacji istniejącego serwera elastycznego.
|
DataEncryption
|
Właściwości szyfrowania danych serwera elastycznego.
|
ErrorAdditionalInfo
|
Dodatkowe informacje o błędzie zarządzania zasobami.
|
ErrorDetail
|
Szczegóły błędu.
|
ErrorResponse
|
Odpowiedź na błąd
|
GeoRedundantBackupEnum
|
Wskazuje, czy serwer jest skonfigurowany do tworzenia geograficznie nadmiarowych kopii zapasowych.
|
HighAvailability
|
Właściwości wysokiej dostępności serwera elastycznego.
|
HighAvailabilityMode
|
Tryb wysokiej dostępności dla serwera elastycznego.
|
IdentityType
|
Typy tożsamości skojarzonych z serwerem elastycznym.
|
keyStatusEnum
|
Stan klucza używanego przez serwer elastyczny skonfigurowany z szyfrowaniem danych na podstawie klucza zarządzanego przez klienta w celu szyfrowania magazynu podstawowego skojarzonego z serwerem.
|
MaintenanceWindow
|
Właściwości okna obsługi serwera elastycznego.
|
Network
|
Właściwości sieci serwera elastycznego. Wymagane tylko wtedy, gdy chcesz, aby serwer był zintegrowany z siecią wirtualną dostarczoną przez klienta.
|
passwordAuthEnum
|
Wskazuje, czy serwer obsługuje uwierzytelnianie oparte na hasłach.
|
PrivateEndpoint
|
Zasób prywatnego punktu końcowego.
|
PrivateEndpointConnection
|
Lista połączeń prywatnego punktu końcowego skojarzonych z określonym serwerem elastycznym.
|
PrivateEndpointConnectionProvisioningState
|
Stan aprowizacji zasobu połączenia prywatnego punktu końcowego.
|
PrivateEndpointServiceConnectionStatus
|
Wskazuje, czy połączenie zostało zatwierdzone/odrzucone/usunięte przez właściciela usługi.
|
PrivateLinkServiceConnectionState
|
Zbiór informacji o stanie połączenia między użytkownikiem usługi a dostawcą.
|
ReadReplicaPromoteMode
|
Typ operacji, która ma zostać zastosowana na replice do odczytu. Ta właściwość to tylko zapis. Autonomiczny oznacza, że replika do odczytu zostanie podniesiona do poziomu serwera autonomicznego i stanie się całkowicie niezależną jednostką od zestawu replikacji. Przełączenie oznacza, że replika do odczytu będzie pełnić role z serwerem podstawowym.
|
Replica
|
Odczytywanie właściwości repliki serwera elastycznego. Wymagane tylko w przypadku, gdy chcesz podwyższyć poziom serwera.
|
ReplicationPromoteOption
|
Opcja synchronizacji danych, która ma być używana podczas przetwarzania operacji określonej we właściwości promoteMode Ta właściwość jest tylko do zapisu. Planowane oznacza, że operacja będzie czekać na pełną synchronizację danych w replice odczytu z serwerem źródłowym przed zainicjowaniem operacji. Wymuszone oznacza, że operacja nie będzie czekać na zsynchronizowanie danych w replice do odczytu z serwerem źródłowym przed zainicjowaniem operacji.
|
ReplicationRole
|
Rola serwera w zestawie replikacji.
|
ReplicationState
|
Wskazuje stan replikacji repliki do odczytu. Ta właściwość jest zwracana tylko wtedy, gdy docelowy serwer elastyczny jest repliką do odczytu. Możliwe wartości to Active, Broken, Catchup, Provisioning, Reconfigure i Updating
|
Server
|
Serwer elastyczny.
|
ServerForUpdate
|
Parametry wymagane do zaktualizowania serwera elastycznego.
|
ServerHAState
|
Możliwe stany serwera rezerwowego utworzonego, gdy wysoka dostępność jest ustawiona na SameZone lub ZoneRedundant.
|
ServerPublicNetworkAccessState
|
Wskazuje, czy dostęp do sieci publicznej jest włączony, czy nie.
|
ServerState
|
Możliwe stany serwera elastycznego.
|
ServerVersion
|
Główna wersja silnika bazy danych PostgreSQL.
|
Sku
|
Warstwa obliczeniowa i rozmiar serwera elastycznego.
|
SkuTier
|
Warstwa zasobów obliczeniowych przypisana do serwera elastycznego.
|
Storage
|
Właściwości magazynu serwera elastycznego.
|
StorageAutoGrow
|
Flaga, aby włączyć lub wyłączyć automatyczne zwiększanie rozmiaru magazynu serwera elastycznego, gdy dostępne miejsce jest bliskie zeru, a warunki zezwalają na automatyczne zwiększanie rozmiaru magazynu.
|
StorageType
|
Typ magazynu przypisanego do serwera elastycznego. Dozwolone wartości to Premium_LRS lub PremiumV2_LRS. Jeśli nie zostanie określony, wartość domyślna to Premium_LRS.
|
systemData
|
Metadane usługi Azure Resource Manager zawierające informacje „createdBy” i „modifiedBy”.
|
UserAssignedIdentity
|
Tożsamości zarządzane przypisane przez użytkownika do serwera elastycznego.
|
UserIdentity
|
Tożsamość zarządzana przypisana przez użytkownika skojarzona z serwerem elastycznym.
|
activeDirectoryAuthEnum
Wyliczanie
Wskazuje, czy serwer obsługuje uwierzytelnianie Microsoft Entra.
Wartość |
Opis |
Disabled
|
|
Enabled
|
|
ArmServerKeyType
Wyliczanie
Typ szyfrowania danych używany przez serwer elastyczny.
Wartość |
Opis |
AzureKeyVault
|
|
SystemManaged
|
|
AuthConfig
Objekt
Właściwości konfiguracji uwierzytelniania serwera elastycznego.
Nazwa |
Typ |
Domyślna wartość |
Opis |
activeDirectoryAuth
|
activeDirectoryAuthEnum
|
|
Wskazuje, czy serwer obsługuje uwierzytelnianie Microsoft Entra.
|
passwordAuth
|
passwordAuthEnum
|
Enabled
|
Wskazuje, czy serwer obsługuje uwierzytelnianie oparte na hasłach.
|
tenantId
|
string
|
|
Identyfikator dzierżawy delegowanego zasobu.
|
Wyliczanie
Warstwa magazynowania serwera elastycznego.
Wartość |
Opis |
P1
|
|
P10
|
|
P15
|
|
P2
|
|
P20
|
|
P3
|
|
P30
|
|
P4
|
|
P40
|
|
P50
|
|
P6
|
|
P60
|
|
P70
|
|
P80
|
|
Backup
Objekt
Właściwości kopii zapasowej serwera elastycznego.
Nazwa |
Typ |
Domyślna wartość |
Opis |
backupRetentionDays
|
integer
(int32)
|
7
|
Dni przechowywania kopii zapasowych dla serwera elastycznego.
|
earliestRestoreDate
|
string
(date-time)
|
|
Najwcześniejszy czas punktu przywracania (format ISO8601) dla serwera elastycznego.
|
geoRedundantBackup
|
GeoRedundantBackupEnum
|
Disabled
|
Wskazuje, czy serwer jest skonfigurowany do tworzenia geograficznie nadmiarowych kopii zapasowych.
|
createdByType
Wyliczanie
Typ tożsamości, która utworzyła zasób.
Wartość |
Opis |
Application
|
|
Key
|
|
ManagedIdentity
|
|
User
|
|
CreateMode
Wyliczanie
Tryb tworzenia nowego serwera elastycznego.
Wartość |
Opis |
Create
|
|
Default
|
|
GeoRestore
|
|
PointInTimeRestore
|
|
Replica
|
|
ReviveDropped
|
|
Update
|
|
CreateModeForUpdate
Wyliczanie
Tryb aktualizacji istniejącego serwera elastycznego.
Wartość |
Opis |
Default
|
|
Update
|
|
DataEncryption
Objekt
Właściwości szyfrowania danych serwera elastycznego.
Nazwa |
Typ |
Opis |
geoBackupEncryptionKeyStatus
|
keyStatusEnum
|
Stan klucza używanego przez serwer elastyczny skonfigurowany z szyfrowaniem danych na podstawie klucza zarządzanego przez klienta do szyfrowania magazynu geograficznie nadmiarowego skojarzonego z serwerem, gdy jest on skonfigurowany do obsługi geograficznie nadmiarowych kopii zapasowych.
|
geoBackupKeyURI
|
string
|
Identyfikator tożsamości zarządzanej przypisanej przez użytkownika używanej do uzyskiwania dostępu do klucza w usłudze Azure Key Vault na potrzeby szyfrowania danych magazynu geograficznie nadmiarowego skojarzonego z serwerem elastycznym skonfigurowanym do obsługi geograficznie nadmiarowych kopii zapasowych.
|
geoBackupUserAssignedIdentityId
|
string
|
Identyfikator tożsamości zarządzanej przypisanej przez użytkownika używanej do uzyskiwania dostępu do klucza w usłudze Azure Key Vault na potrzeby szyfrowania danych magazynu geograficznie nadmiarowego skojarzonego z serwerem elastycznym skonfigurowanym do obsługi geograficznie nadmiarowych kopii zapasowych.
|
primaryEncryptionKeyStatus
|
keyStatusEnum
|
Stan klucza używanego przez serwer elastyczny skonfigurowany z szyfrowaniem danych na podstawie klucza zarządzanego przez klienta w celu szyfrowania magazynu podstawowego skojarzonego z serwerem.
|
primaryKeyURI
|
string
|
Identyfikator URI klucza w usłudze Azure Key Vault używany do szyfrowania danych magazynu podstawowego skojarzonego z serwerem elastycznym.
|
primaryUserAssignedIdentityId
|
string
|
Identyfikator tożsamości zarządzanej przypisanej przez użytkownika używanej do uzyskiwania dostępu do klucza w usłudze Azure Key Vault na potrzeby szyfrowania danych magazynu podstawowego skojarzonego z serwerem elastycznym.
|
type
|
ArmServerKeyType
|
Typ szyfrowania danych używany przez serwer elastyczny.
|
ErrorAdditionalInfo
Objekt
Dodatkowe informacje o błędzie zarządzania zasobami.
Nazwa |
Typ |
Opis |
info
|
object
|
Dodatkowe informacje.
|
type
|
string
|
Dodatkowy typ informacji.
|
ErrorDetail
Objekt
Szczegóły błędu.
Nazwa |
Typ |
Opis |
additionalInfo
|
ErrorAdditionalInfo[]
|
Dodatkowe informacje o błędzie.
|
code
|
string
|
Kod błędu.
|
details
|
ErrorDetail[]
|
Szczegóły błędu.
|
message
|
string
|
Komunikat o błędzie.
|
target
|
string
|
Element docelowy błędu.
|
ErrorResponse
Objekt
Odpowiedź na błąd
GeoRedundantBackupEnum
Wyliczanie
Wskazuje, czy serwer jest skonfigurowany do tworzenia geograficznie nadmiarowych kopii zapasowych.
Wartość |
Opis |
Disabled
|
|
Enabled
|
|
HighAvailability
Objekt
Właściwości wysokiej dostępności serwera elastycznego.
Nazwa |
Typ |
Domyślna wartość |
Opis |
mode
|
HighAvailabilityMode
|
Disabled
|
Tryb wysokiej dostępności dla serwera elastycznego.
|
standbyAvailabilityZone
|
string
|
|
Strefa dostępności skojarzona z serwerem rezerwowym utworzona, gdy wysoka dostępność jest ustawiona na SameZone lub ZoneRedundant.
|
state
|
ServerHAState
|
|
Możliwe stany serwera rezerwowego utworzonego, gdy wysoka dostępność jest ustawiona na SameZone lub ZoneRedundant.
|
HighAvailabilityMode
Wyliczanie
Tryb wysokiej dostępności dla serwera elastycznego.
Wartość |
Opis |
Disabled
|
|
SameZone
|
|
ZoneRedundant
|
|
IdentityType
Wyliczanie
Typy tożsamości skojarzonych z serwerem elastycznym.
Wartość |
Opis |
None
|
|
SystemAssigned
|
|
SystemAssigned,UserAssigned
|
|
UserAssigned
|
|
keyStatusEnum
Wyliczanie
Stan klucza używanego przez serwer elastyczny skonfigurowany z szyfrowaniem danych na podstawie klucza zarządzanego przez klienta w celu szyfrowania magazynu podstawowego skojarzonego z serwerem.
Wartość |
Opis |
Invalid
|
|
Valid
|
|
MaintenanceWindow
Objekt
Właściwości okna obsługi serwera elastycznego.
Nazwa |
Typ |
Domyślna wartość |
Opis |
customWindow
|
string
|
Disabled
|
Wskazuje, czy okno niestandardowe jest włączone, czy wyłączone.
|
dayOfWeek
|
integer
(int32)
|
0
|
Dzień tygodnia, który ma być używany dla okna konserwacji.
|
startHour
|
integer
(int32)
|
0
|
Godzina początkowa, która ma być używana dla okna obsługi.
|
startMinute
|
integer
(int32)
|
0
|
Minuta początkowa używana dla okna obsługi.
|
Network
Objekt
Właściwości sieci serwera elastycznego. Wymagane tylko wtedy, gdy chcesz, aby serwer był zintegrowany z siecią wirtualną dostarczoną przez klienta.
Nazwa |
Typ |
Opis |
delegatedSubnetResourceId
|
string
|
Identyfikator zasobu delegowanej podsieci. Wymagane podczas tworzenia nowego serwera, w przypadku, gdy chcesz, aby serwer został zintegrowany z własną siecią wirtualną. W przypadku operacji aktualizacji należy podać tę właściwość tylko wtedy, gdy chcesz zmienić wartość przypisaną do prywatnej strefy DNS.
|
privateDnsZoneArmResourceId
|
string
|
Identyfikator prywatnej strefy DNS. Wymagane podczas tworzenia nowego serwera, w przypadku, gdy chcesz, aby serwer został zintegrowany z własną siecią wirtualną. W przypadku operacji aktualizacji należy podać tę właściwość tylko wtedy, gdy chcesz zmienić wartość przypisaną do prywatnej strefy DNS.
|
publicNetworkAccess
|
ServerPublicNetworkAccessState
|
Wskazuje, czy dostęp do sieci publicznej jest włączony, czy nie.
|
passwordAuthEnum
Wyliczanie
Wskazuje, czy serwer obsługuje uwierzytelnianie oparte na hasłach.
Wartość |
Opis |
Disabled
|
|
Enabled
|
|
PrivateEndpoint
Objekt
Zasób prywatnego punktu końcowego.
Nazwa |
Typ |
Opis |
id
|
string
|
Identyfikator usługi ARM dla prywatnego punktu końcowego.
|
PrivateEndpointConnection
Objekt
Lista połączeń prywatnego punktu końcowego skojarzonych z określonym serwerem elastycznym.
Nazwa |
Typ |
Opis |
id
|
string
(arm-id)
|
W pełni kwalifikowany identyfikator zasobu dla zasobu. Np. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
name
|
string
|
Nazwa zasobu
|
properties.groupIds
|
string[]
|
Identyfikatory grupy dla zasobu prywatnego punktu końcowego.
|
properties.privateEndpoint
|
PrivateEndpoint
|
Zasób prywatnego punktu końcowego.
|
properties.privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Zbiór informacji o stanie połączenia między użytkownikiem usługi a dostawcą.
|
properties.provisioningState
|
PrivateEndpointConnectionProvisioningState
|
Stan aprowizacji zasobu połączenia prywatnego punktu końcowego.
|
systemData
|
systemData
|
Metadane usługi Azure Resource Manager zawierające informacje „createdBy” i „modifiedBy”.
|
type
|
string
|
Typ zasobu. Np. "Microsoft.Compute/virtualMachines" lub "Microsoft.Storage/storageAccounts"
|
PrivateEndpointConnectionProvisioningState
Wyliczanie
Stan aprowizacji zasobu połączenia prywatnego punktu końcowego.
Wartość |
Opis |
Creating
|
|
Deleting
|
|
Failed
|
|
Succeeded
|
|
PrivateEndpointServiceConnectionStatus
Wyliczanie
Wskazuje, czy połączenie zostało zatwierdzone/odrzucone/usunięte przez właściciela usługi.
Wartość |
Opis |
Approved
|
|
Pending
|
|
Rejected
|
|
PrivateLinkServiceConnectionState
Objekt
Zbiór informacji o stanie połączenia między użytkownikiem usługi a dostawcą.
Nazwa |
Typ |
Opis |
actionsRequired
|
string
|
Komunikat wskazujący, czy zmiany u dostawcy usług wymagają aktualizacji odbiorcy.
|
description
|
string
|
Przyczyna zatwierdzenia/odrzucenia połączenia.
|
status
|
PrivateEndpointServiceConnectionStatus
|
Wskazuje, czy połączenie zostało zatwierdzone/odrzucone/usunięte przez właściciela usługi.
|
Wyliczanie
Typ operacji, która ma zostać zastosowana na replice do odczytu. Ta właściwość to tylko zapis. Autonomiczny oznacza, że replika do odczytu zostanie podniesiona do poziomu serwera autonomicznego i stanie się całkowicie niezależną jednostką od zestawu replikacji. Przełączenie oznacza, że replika do odczytu będzie pełnić role z serwerem podstawowym.
Wartość |
Opis |
standalone
|
|
switchover
|
|
Replica
Objekt
Odczytywanie właściwości repliki serwera elastycznego. Wymagane tylko w przypadku, gdy chcesz podwyższyć poziom serwera.
Nazwa |
Typ |
Opis |
capacity
|
integer
(int32)
|
Maksymalna liczba replik do odczytu dozwolona dla serwera elastycznego.
|
promoteMode
|
ReadReplicaPromoteMode
|
Typ operacji, która ma zostać zastosowana na replice do odczytu. Ta właściwość to tylko zapis. Autonomiczny oznacza, że replika do odczytu zostanie podniesiona do poziomu serwera autonomicznego i stanie się całkowicie niezależną jednostką od zestawu replikacji. Przełączenie oznacza, że replika do odczytu będzie pełnić role z serwerem podstawowym.
|
promoteOption
|
ReplicationPromoteOption
|
Opcja synchronizacji danych, która ma być używana podczas przetwarzania operacji określonej we właściwości promoteMode Ta właściwość jest tylko do zapisu. Planowane oznacza, że operacja będzie czekać na pełną synchronizację danych w replice odczytu z serwerem źródłowym przed zainicjowaniem operacji. Wymuszone oznacza, że operacja nie będzie czekać na zsynchronizowanie danych w replice do odczytu z serwerem źródłowym przed zainicjowaniem operacji.
|
replicationState
|
ReplicationState
|
Wskazuje stan replikacji repliki do odczytu. Ta właściwość jest zwracana tylko wtedy, gdy docelowy serwer elastyczny jest repliką do odczytu. Możliwe wartości to Active, Broken, Catchup, Provisioning, Reconfigure i Updating
|
role
|
ReplicationRole
|
Rola serwera w zestawie replikacji.
|
Wyliczanie
Opcja synchronizacji danych, która ma być używana podczas przetwarzania operacji określonej we właściwości promoteMode Ta właściwość jest tylko do zapisu. Planowane oznacza, że operacja będzie czekać na pełną synchronizację danych w replice odczytu z serwerem źródłowym przed zainicjowaniem operacji. Wymuszone oznacza, że operacja nie będzie czekać na zsynchronizowanie danych w replice do odczytu z serwerem źródłowym przed zainicjowaniem operacji.
Wartość |
Opis |
forced
|
|
planned
|
|
ReplicationRole
Wyliczanie
Rola serwera w zestawie replikacji.
Wartość |
Opis |
AsyncReplica
|
|
GeoAsyncReplica
|
|
None
|
|
Primary
|
|
ReplicationState
Wyliczanie
Wskazuje stan replikacji repliki do odczytu. Ta właściwość jest zwracana tylko wtedy, gdy docelowy serwer elastyczny jest repliką do odczytu. Możliwe wartości to Active, Broken, Catchup, Provisioning, Reconfigure i Updating
Wartość |
Opis |
Active
|
|
Broken
|
|
Catchup
|
|
Provisioning
|
|
Reconfiguring
|
|
Updating
|
|
Server
Objekt
Serwer elastyczny.
Nazwa |
Typ |
Opis |
id
|
string
(arm-id)
|
W pełni kwalifikowany identyfikator zasobu dla zasobu. Np. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
identity
|
UserAssignedIdentity
|
Tożsamości zarządzane przypisane przez użytkownika do serwera elastycznego.
|
location
|
string
|
Lokalizacja geograficzna, w której znajduje się zasób
|
name
|
string
|
Nazwa zasobu
|
properties.administratorLogin
|
string
|
Nazwa loginu wyznaczonego jako pierwszy administrator oparty na hasłach przypisany do Twojej instancji PostgreSQL. Musi być określona przy pierwszym włączeniu uwierzytelniania opartego na hasłach na serwerze. Raz ustawiona na daną wartość nie może być zmieniona do końca życia serwera. Jeśli wyłączysz uwierzytelnianie oparte na hasłach na serwerze, na którym jest włączone, ta rola oparta na hasłach nie zostanie usunięta.
|
properties.administratorLoginPassword
|
string
(password)
|
Hasło przypisane do loginu administratora. Dopóki uwierzytelnianie hasłem jest włączone, hasło to można zmienić w dowolnym momencie.
|
properties.authConfig
|
AuthConfig
|
Właściwości konfiguracji uwierzytelniania serwera elastycznego.
|
properties.availabilityZone
|
string
|
Strefa dostępności serwera elastycznego.
|
properties.backup
|
Backup
|
Właściwości kopii zapasowej serwera elastycznego.
|
properties.createMode
|
CreateMode
|
Tryb tworzenia nowego serwera elastycznego.
|
properties.dataEncryption
|
DataEncryption
|
Właściwości szyfrowania danych serwera elastycznego.
|
properties.fullyQualifiedDomainName
|
string
|
W pełni kwalifikowana nazwa domeny serwera elastycznego.
|
properties.highAvailability
|
HighAvailability
|
Właściwości wysokiej dostępności serwera elastycznego.
|
properties.maintenanceWindow
|
MaintenanceWindow
|
Właściwości okna obsługi serwera elastycznego.
|
properties.minorVersion
|
string
|
Pomocnicza wersja silnika bazy danych PostgreSQL.
|
properties.network
|
Network
|
Właściwości sieci serwera elastycznego. Wymagane tylko wtedy, gdy chcesz, aby serwer był zintegrowany z siecią wirtualną dostarczoną przez klienta.
|
properties.pointInTimeUTC
|
string
(date-time)
|
Czas tworzenia (w formacie ISO8601) kopii zapasowej, którą chcesz przywrócić na nowym serwerze elastycznym. Jest to wymagane, gdy wartość "createMode" to "PointInTimeRestore", "GeoRestore" lub "ReviveDropped".
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
Lista połączeń prywatnego punktu końcowego skojarzonych z określonym serwerem elastycznym.
|
properties.replica
|
Replica
|
Odczytywanie właściwości repliki serwera elastycznego. Wymagane tylko w przypadku, gdy chcesz podwyższyć poziom serwera.
|
properties.replicaCapacity
|
integer
(int32)
|
Maksymalna liczba replik do odczytu dozwolona dla serwera elastycznego.
|
properties.replicationRole
|
ReplicationRole
|
Rola serwera w zestawie replikacji.
|
properties.sourceServerResourceId
|
string
|
Identyfikator serwera elastycznego, który ma być używany jako źródło nowego serwera elastycznego. Wymagane, gdy wartość "createMode" to "PointInTimeRestore", "GeoRestore", "Replica" lub "ReviveDropped". Ta właściwość jest zwracana tylko wtedy, gdy docelowy serwer elastyczny jest repliką do odczytu.
|
properties.state
|
ServerState
|
Możliwe stany serwera elastycznego.
|
properties.storage
|
Storage
|
Właściwości magazynu serwera elastycznego.
|
properties.version
|
ServerVersion
|
Główna wersja silnika bazy danych PostgreSQL.
|
sku
|
Sku
|
Warstwa obliczeniowa i rozmiar serwera elastycznego.
|
systemData
|
systemData
|
Metadane usługi Azure Resource Manager zawierające informacje „createdBy” i „modifiedBy”.
|
tags
|
object
|
Tagi zasobów.
|
type
|
string
|
Typ zasobu. Np. "Microsoft.Compute/virtualMachines" lub "Microsoft.Storage/storageAccounts"
|
ServerForUpdate
Objekt
Parametry wymagane do zaktualizowania serwera elastycznego.
Nazwa |
Typ |
Opis |
identity
|
UserAssignedIdentity
|
Opisuje tożsamość aplikacji.
|
properties.administratorLogin
|
string
|
Nazwa loginu wyznaczonego jako pierwszy administrator oparty na hasłach przypisany do Twojej instancji PostgreSQL. Musi być określona przy pierwszym włączeniu uwierzytelniania opartego na hasłach na serwerze. Raz ustawiona na daną wartość nie może być zmieniona do końca życia serwera. Jeśli wyłączysz uwierzytelnianie oparte na hasłach na serwerze, na którym jest włączone, ta rola oparta na hasłach nie zostanie usunięta.
|
properties.administratorLoginPassword
|
string
(password)
|
Hasło przypisane do loginu administratora. Dopóki uwierzytelnianie hasłem jest włączone, hasło to można zmienić w dowolnym momencie.
|
properties.authConfig
|
AuthConfig
|
Właściwości konfiguracji uwierzytelniania serwera elastycznego.
|
properties.backup
|
Backup
|
Właściwości kopii zapasowej serwera elastycznego.
|
properties.createMode
|
CreateModeForUpdate
|
Tryb aktualizacji istniejącego serwera elastycznego.
|
properties.dataEncryption
|
DataEncryption
|
Właściwości szyfrowania danych serwera elastycznego.
|
properties.highAvailability
|
HighAvailability
|
Właściwości wysokiej dostępności serwera elastycznego.
|
properties.maintenanceWindow
|
MaintenanceWindow
|
Właściwości okna obsługi serwera elastycznego.
|
properties.network
|
Network
|
Właściwości sieci serwera elastycznego. Wymagane tylko wtedy, gdy chcesz, aby serwer był zintegrowany z siecią wirtualną dostarczoną przez klienta.
|
properties.replica
|
Replica
|
Odczytywanie właściwości repliki serwera elastycznego. Wymagane tylko w przypadku, gdy chcesz podwyższyć poziom serwera.
|
properties.replicationRole
|
ReplicationRole
|
Rola serwera w zestawie replikacji.
|
properties.storage
|
Storage
|
Właściwości magazynu serwera elastycznego.
|
properties.version
|
ServerVersion
|
Główna wersja silnika bazy danych PostgreSQL.
|
sku
|
Sku
|
Warstwa obliczeniowa i rozmiar serwera elastycznego.
|
tags
|
object
|
Metadane specyficzne dla aplikacji w postaci par klucz-wartość.
|
ServerHAState
Wyliczanie
Możliwe stany serwera rezerwowego utworzonego, gdy wysoka dostępność jest ustawiona na SameZone lub ZoneRedundant.
Wartość |
Opis |
CreatingStandby
|
|
FailingOver
|
|
Healthy
|
|
NotEnabled
|
|
RemovingStandby
|
|
ReplicatingData
|
|
ServerPublicNetworkAccessState
Wyliczanie
Wskazuje, czy dostęp do sieci publicznej jest włączony, czy nie.
Wartość |
Opis |
Disabled
|
|
Enabled
|
|
ServerState
Wyliczanie
Możliwe stany serwera elastycznego.
Wartość |
Opis |
Disabled
|
|
Dropping
|
|
Ready
|
|
Starting
|
|
Stopped
|
|
Stopping
|
|
Updating
|
|
ServerVersion
Wyliczanie
Główna wersja silnika bazy danych PostgreSQL.
Wartość |
Opis |
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
Sku
Objekt
Warstwa obliczeniowa i rozmiar serwera elastycznego.
Nazwa |
Typ |
Opis |
name
|
string
|
Nazwa, według której jest znany dany rozmiar obliczeniowy przypisany do serwera elastycznego.
|
tier
|
SkuTier
|
Warstwa zasobów obliczeniowych przypisana do serwera elastycznego.
|
SkuTier
Wyliczanie
Warstwa zasobów obliczeniowych przypisana do serwera elastycznego.
Wartość |
Opis |
Burstable
|
|
GeneralPurpose
|
|
MemoryOptimized
|
|
Storage
Objekt
Właściwości magazynu serwera elastycznego.
Nazwa |
Typ |
Opis |
autoGrow
|
StorageAutoGrow
|
Flaga, aby włączyć lub wyłączyć automatyczne zwiększanie rozmiaru magazynu serwera elastycznego, gdy dostępne miejsce jest bliskie zeru, a warunki zezwalają na automatyczne zwiększanie rozmiaru magazynu.
|
iops
|
integer
(int32)
|
Maksymalna liczba operacji we/wy na sekundę obsługiwana przez magazyn. Wymagane, gdy typ magazynu to PremiumV2_LRS.
|
storageSizeGB
|
integer
(int32)
|
Rozmiar magazynu przypisanego do serwera elastycznego.
|
throughput
|
integer
(int32)
|
Maksymalna przepływność obsługiwana dla magazynu. Wymagane, gdy typ magazynu to PremiumV2_LRS.
|
tier
|
AzureManagedDiskPerformanceTiers
|
Warstwa magazynowania serwera elastycznego.
|
type
|
StorageType
|
Typ magazynu przypisanego do serwera elastycznego. Dozwolone wartości to Premium_LRS lub PremiumV2_LRS. Jeśli nie zostanie określony, wartość domyślna to Premium_LRS.
|
StorageAutoGrow
Wyliczanie
Flaga, aby włączyć lub wyłączyć automatyczne zwiększanie rozmiaru magazynu serwera elastycznego, gdy dostępne miejsce jest bliskie zeru, a warunki zezwalają na automatyczne zwiększanie rozmiaru magazynu.
Wartość |
Opis |
Disabled
|
|
Enabled
|
|
StorageType
Wyliczanie
Typ magazynu przypisanego do serwera elastycznego. Dozwolone wartości to Premium_LRS lub PremiumV2_LRS. Jeśli nie zostanie określony, wartość domyślna to Premium_LRS.
Wartość |
Opis |
PremiumV2_LRS
|
|
Premium_LRS
|
|
systemData
Objekt
Metadane usługi Azure Resource Manager zawierające informacje „createdBy” i „modifiedBy”.
Nazwa |
Typ |
Opis |
createdAt
|
string
(date-time)
|
Sygnatura czasowa tworzenia zasobu (UTC).
|
createdBy
|
string
|
Tożsamość, która utworzyła zasób.
|
createdByType
|
createdByType
|
Typ tożsamości, która utworzyła zasób.
|
lastModifiedAt
|
string
(date-time)
|
Znacznik czasu ostatniej modyfikacji zasobu (UTC)
|
lastModifiedBy
|
string
|
Tożsamość, która ostatnio zmodyfikowała zasób.
|
lastModifiedByType
|
createdByType
|
Typ tożsamości, która ostatnio zmodyfikowała zasób.
|
UserAssignedIdentity
Objekt
Tożsamości zarządzane przypisane przez użytkownika do serwera elastycznego.
Nazwa |
Typ |
Opis |
principalId
|
string
|
Identyfikator obiektu jednostki usługi skojarzonej z tożsamością zarządzaną przypisaną przez użytkownika.
|
tenantId
|
string
|
Identyfikator dzierżawy serwera elastycznego.
|
type
|
IdentityType
|
Typy tożsamości skojarzonych z serwerem elastycznym.
|
userAssignedIdentities
|
<string,
UserIdentity>
|
Mapa tożsamości zarządzanych przypisanych przez użytkownika.
|
UserIdentity
Objekt
Tożsamość zarządzana przypisana przez użytkownika skojarzona z serwerem elastycznym.
Nazwa |
Typ |
Opis |
clientId
|
string
|
Identyfikator klienta jednostki usługi skojarzonej z tożsamością zarządzaną przypisaną przez użytkownika.
|
principalId
|
string
|
Identyfikator obiektu jednostki usługi skojarzonej z tożsamością zarządzaną przypisaną przez użytkownika.
|