Yeni bir sunucu oluşturur veya var olan bir sunucuyu güncelleştirir. Güncelleştirme eylemi var olan sunucunun üzerine yazar.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}?api-version=2023-12-30
URI Parametreleri
Name |
İçinde |
Gerekli |
Tür |
Description |
resourceGroupName
|
path |
True
|
string
|
Kaynak grubunun adı. Ad büyük/küçük harfe duyarlı değildir.
|
serverName
|
path |
True
|
string
|
Sunucunun adı.
Normal ifade deseni: ^[a-z0-9][-a-z0-9]*(?<!-)$
|
subscriptionId
|
path |
True
|
string
uuid
|
Hedef aboneliğin kimliği. Değer bir UUID olmalıdır.
|
api-version
|
query |
True
|
string
|
Bu işlem için kullanılacak API sürümü.
|
İstek Gövdesi
Name |
Gerekli |
Tür |
Description |
location
|
True
|
string
|
Kaynağın bulunduğu coğrafi konum
|
identity.type
|
|
ManagedServiceIdentityType
|
Yönetilen hizmet kimliğinin türü.
|
identity.userAssignedIdentities
|
|
object
|
Kullanıcı tarafından atanan kimliğin meta verileri.
|
properties.administratorLogin
|
|
string
|
Yöneticinin sunucunun oturum açma adı. Yalnızca sunucu oluşturulurken belirtilebilir (ve oluşturma için gereklidir).
|
properties.administratorLoginPassword
|
|
string
|
Yönetici oturum açma parolası (sunucu oluşturma için gereklidir).
|
properties.availabilityZone
|
|
string
|
sunucunun kullanılabilirlik Alanı bilgileri.
|
properties.backup
|
|
Backup
|
Sunucunun ilgili özelliklerini yedekleyin.
|
properties.createMode
|
|
CreateMode
|
Yeni bir MySQL sunucusu oluşturma modu.
|
properties.dataEncryption
|
|
DataEncryption
|
CMK için Veri Şifrelemesi.
|
properties.highAvailability
|
|
HighAvailability
|
Bir sunucunun yüksek kullanılabilirlik ile ilgili özellikleri.
|
properties.importSourceProperties
|
|
ImportSourceProperties
|
Depolama alanından içeri aktarma için kaynak özellikleri.
|
properties.maintenanceWindow
|
|
MaintenanceWindow
|
Sunucunun bakım penceresi.
|
properties.network
|
|
Network
|
Bir sunucunun ağ ile ilgili özellikleri.
|
properties.replicationRole
|
|
ReplicationRole
|
Çoğaltma rolü.
|
properties.restorePointInTime
|
|
string
|
Geri yükleme noktası oluşturma zamanı (ISO8601 biçimi), geri yükleme zamanı belirtilir.
|
properties.sourceServerResourceId
|
|
string
|
Kaynak MySQL sunucu kimliği.
|
properties.storage
|
|
Storage
|
Sunucunun depolamayla ilgili özellikleri.
|
properties.version
|
|
ServerVersion
|
Sunucu sürümü.
|
sku
|
|
MySQLServerSku
|
Sunucunun SKU'su (fiyatlandırma katmanı).
|
tags
|
|
object
|
Kaynak etiketleri.
|
Yanıtlar
Name |
Tür |
Description |
200 OK
|
Server
|
Tamam
|
201 Created
|
Server
|
Oluşturulan
|
202 Accepted
|
|
Kabul edildi
Üst Bilgiler
Location: string
|
Other Status Codes
|
ErrorResponse
|
İşlemin neden başarısız olduğunu açıklayan hata yanıtı.
|
Güvenlik
azure_auth
Azure Active Directory OAuth2 Flow
Tür:
oauth2
Akış:
implicit
Yetkilendirme URL’si:
https://login.microsoftonline.com/common/oauth2/authorize
Kapsamlar
Name |
Description |
user_impersonation
|
kullanıcı hesabınızın kimliğine bürünme
|
Örnekler
Create a new server
Örnek isteği
PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver?api-version=2023-12-30
{
"sku": {
"name": "Standard_D2ds_v4",
"tier": "GeneralPurpose"
},
"properties": {
"administratorLogin": "cloudsa",
"administratorLoginPassword": "your_password",
"availabilityZone": "1",
"version": "5.7",
"createMode": "Default",
"storage": {
"storageSizeGB": 100,
"iops": 600,
"autoGrow": "Disabled"
},
"backup": {
"backupRetentionDays": 7,
"backupIntervalHours": 24,
"geoRedundantBackup": "Disabled"
},
"highAvailability": {
"mode": "ZoneRedundant",
"standbyAvailabilityZone": "3"
}
},
"location": "southeastasia",
"tags": {
"num": "1"
}
}
import com.azure.resourcemanager.mysqlflexibleserver.models.Backup;
import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode;
import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum;
import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability;
import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityMode;
import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku;
import com.azure.resourcemanager.mysqlflexibleserver.models.ServerSkuTier;
import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion;
import com.azure.resourcemanager.mysqlflexibleserver.models.Storage;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreate
* .json
*/
/**
* Sample code: Create a new server.
*
* @param manager Entry point to MySqlManager.
*/
public static void createANewServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) {
manager.servers().define("mysqltestserver").withRegion("southeastasia").withExistingResourceGroup("testrg")
.withTags(mapOf("num", "1"))
.withSku(new MySqlServerSku().withName("Standard_D2ds_v4").withTier(ServerSkuTier.GENERAL_PURPOSE))
.withAdministratorLogin("cloudsa").withAdministratorLoginPassword("your_password")
.withVersion(ServerVersion.FIVE_SEVEN).withAvailabilityZone("1").withCreateMode(CreateMode.DEFAULT)
.withStorage(new Storage().withStorageSizeGB(100).withIops(600).withAutoGrow(EnableStatusEnum.DISABLED))
.withBackup(new Backup().withBackupRetentionDays(7).withBackupIntervalHours(24)
.withGeoRedundantBackup(EnableStatusEnum.DISABLED))
.withHighAvailability(
new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3"))
.create();
}
/*
* x-ms-original-file:
* specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/
* ServerCreateWithPointInTimeRestore.json
*/
/**
* Sample code: Create a server as a point in time restore.
*
* @param manager Entry point to MySqlManager.
*/
public static void
createAServerAsAPointInTimeRestore(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) {
manager.servers().define("targetserver").withRegion("SoutheastAsia")
.withExistingResourceGroup("TargetResourceGroup").withTags(mapOf("num", "1"))
.withSku(new MySqlServerSku().withName("Standard_D14_v2").withTier(ServerSkuTier.GENERAL_PURPOSE))
.withCreateMode(CreateMode.POINT_IN_TIME_RESTORE)
.withSourceServerResourceId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver")
.withRestorePointInTime(OffsetDateTime.parse("2021-06-24T00:00:37.467Z")).create();
}
// 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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.rdbms.mysql_flexibleservers import MySQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-rdbms
# USAGE
python server_create.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 = MySQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_create(
resource_group_name="testrg",
server_name="mysqltestserver",
parameters={
"location": "southeastasia",
"properties": {
"administratorLogin": "cloudsa",
"administratorLoginPassword": "your_password",
"availabilityZone": "1",
"backup": {"backupIntervalHours": 24, "backupRetentionDays": 7, "geoRedundantBackup": "Disabled"},
"createMode": "Default",
"highAvailability": {"mode": "ZoneRedundant", "standbyAvailabilityZone": "3"},
"storage": {"autoGrow": "Disabled", "iops": 600, "storageSizeGB": 100},
"version": "5.7",
},
"sku": {"name": "Standard_D2ds_v4", "tier": "GeneralPurpose"},
"tags": {"num": "1"},
},
).result()
print(response)
# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreate.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 armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreate.json
func ExampleServersClient_BeginCreate_createANewServer() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmysqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.Server{
Location: to.Ptr("southeastasia"),
Tags: map[string]*string{
"num": to.Ptr("1"),
},
Properties: &armmysqlflexibleservers.ServerProperties{
AdministratorLogin: to.Ptr("cloudsa"),
AdministratorLoginPassword: to.Ptr("your_password"),
AvailabilityZone: to.Ptr("1"),
Backup: &armmysqlflexibleservers.Backup{
BackupIntervalHours: to.Ptr[int32](24),
BackupRetentionDays: to.Ptr[int32](7),
GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled),
},
CreateMode: to.Ptr(armmysqlflexibleservers.CreateModeDefault),
HighAvailability: &armmysqlflexibleservers.HighAvailability{
Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant),
StandbyAvailabilityZone: to.Ptr("3"),
},
Storage: &armmysqlflexibleservers.Storage{
AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled),
Iops: to.Ptr[int32](600),
StorageSizeGB: to.Ptr[int32](100),
},
Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7),
},
SKU: &armmysqlflexibleservers.MySQLServerSKU{
Name: to.Ptr("Standard_D2ds_v4"),
Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose),
},
}, 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 = armmysqlflexibleservers.Server{
// Name: to.Ptr("mysqltestserver"),
// Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"),
// Location: to.Ptr("Southeast Asia"),
// Tags: map[string]*string{
// "num": to.Ptr("1"),
// },
// Properties: &armmysqlflexibleservers.ServerProperties{
// AdministratorLogin: to.Ptr("cloudsa"),
// AvailabilityZone: to.Ptr("1"),
// Backup: &armmysqlflexibleservers.Backup{
// BackupRetentionDays: to.Ptr[int32](7),
// EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()),
// GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled),
// },
// FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"),
// HighAvailability: &armmysqlflexibleservers.HighAvailability{
// Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant),
// StandbyAvailabilityZone: to.Ptr("3"),
// State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy),
// },
// MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{
// CustomWindow: to.Ptr("Disabled"),
// DayOfWeek: to.Ptr[int32](0),
// StartHour: to.Ptr[int32](0),
// StartMinute: to.Ptr[int32](0),
// },
// Network: &armmysqlflexibleservers.Network{
// PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled),
// },
// ReplicaCapacity: to.Ptr[int32](10),
// ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone),
// State: to.Ptr(armmysqlflexibleservers.ServerStateReady),
// Storage: &armmysqlflexibleservers.Storage{
// AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled),
// Iops: to.Ptr[int32](600),
// StorageSizeGB: to.Ptr[int32](100),
// StorageSKU: to.Ptr("Premium_LRS"),
// },
// Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7),
// },
// SKU: &armmysqlflexibleservers.MySQLServerSKU{
// Name: to.Ptr("Standard_D2ds_v4"),
// Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MySQLManagementFlexibleServerClient } = require("@azure/arm-mysql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a new server or updates an existing server. The update action will overwrite the existing server.
*
* @summary Creates a new server or updates an existing server. The update action will overwrite the existing server.
* x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreate.json
*/
async function createANewServer() {
const subscriptionId =
process.env["MYSQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["MYSQL_RESOURCE_GROUP"] || "testrg";
const serverName = "mysqltestserver";
const parameters = {
administratorLogin: "cloudsa",
administratorLoginPassword: "your_password",
availabilityZone: "1",
backup: {
backupIntervalHours: 24,
backupRetentionDays: 7,
geoRedundantBackup: "Disabled",
},
createMode: "Default",
highAvailability: { mode: "ZoneRedundant", standbyAvailabilityZone: "3" },
location: "southeastasia",
sku: { name: "Standard_D2ds_v4", tier: "GeneralPurpose" },
storage: { autoGrow: "Disabled", iops: 600, storageSizeGB: 100 },
tags: { num: "1" },
version: "5.7",
};
const credential = new DefaultAzureCredential();
const client = new MySQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginCreateAndWait(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.MySql.FlexibleServers.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.MySql.FlexibleServers;
// Generated from example definition: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreate.json
// this example is just showing the usage of "Servers_Create" 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://video2.skills-academy.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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testrg";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this MySqlFlexibleServerResource
MySqlFlexibleServerCollection collection = resourceGroupResource.GetMySqlFlexibleServers();
// invoke the operation
string serverName = "mysqltestserver";
MySqlFlexibleServerData data = new MySqlFlexibleServerData(new AzureLocation("southeastasia"))
{
Sku = new MySqlFlexibleServerSku("Standard_D2ds_v4", MySqlFlexibleServerSkuTier.GeneralPurpose),
AdministratorLogin = "cloudsa",
AdministratorLoginPassword = "your_password",
Version = MySqlFlexibleServerVersion.Ver5_7,
AvailabilityZone = "1",
CreateMode = MySqlFlexibleServerCreateMode.Default,
Storage = new MySqlFlexibleServerStorage()
{
StorageSizeInGB = 100,
Iops = 600,
AutoGrow = MySqlFlexibleServerEnableStatusEnum.Disabled,
},
Backup = new MySqlFlexibleServerBackupProperties()
{
BackupRetentionDays = 7,
BackupIntervalHours = 24,
GeoRedundantBackup = MySqlFlexibleServerEnableStatusEnum.Disabled,
},
HighAvailability = new MySqlFlexibleServerHighAvailability()
{
Mode = MySqlFlexibleServerHighAvailabilityMode.ZoneRedundant,
StandbyAvailabilityZone = "3",
},
Tags =
{
["num"] = "1",
},
};
ArmOperation<MySqlFlexibleServerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serverName, data);
MySqlFlexibleServerResource 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
MySqlFlexibleServerData 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
Örnek yanıt
{
"sku": {
"name": "Standard_D2ds_v4",
"tier": "GeneralPurpose"
},
"properties": {
"administratorLogin": "cloudsa",
"storage": {
"storageSizeGB": 100,
"iops": 600,
"autoGrow": "Enabled",
"storageSku": "Premium_LRS"
},
"version": "5.7",
"state": "Ready",
"fullyQualifiedDomainName": "mysqltestserver.database.mysql.azure.com",
"availabilityZone": "1",
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replicationRole": "None",
"replicaCapacity": 10,
"network": {
"publicNetworkAccess": "Enabled"
},
"backup": {
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2021-06-17T06:11:38.4150019+00:00"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "3"
}
},
"location": "Southeast Asia",
"tags": {
"num": "1"
},
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver",
"name": "mysqltestserver",
"type": "Microsoft.DBforMySQL/flexibleServers"
}
{
"sku": {
"name": "Standard_D2ds_v4",
"tier": "GeneralPurpose"
},
"properties": {
"administratorLogin": "cloudsa",
"storage": {
"storageSizeGB": 100,
"iops": 600,
"autoGrow": "Enabled",
"storageSku": "Premium_LRS"
},
"version": "5.7",
"state": "Ready",
"fullyQualifiedDomainName": "mysqltestserver.database.mysql.azure.com",
"availabilityZone": "1",
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replicationRole": "None",
"replicaCapacity": 10,
"network": {
"publicNetworkAccess": "Enabled"
},
"backup": {
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2021-06-17T06:11:38.4150019+00:00"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "3"
}
},
"location": "Southeast Asia",
"tags": {
"num": "1"
},
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver",
"name": "mysqltestserver",
"type": "Microsoft.DBforMySQL/flexibleServers"
}
Create a replica server
Örnek isteği
PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/replica-server?api-version=2023-12-30
{
"location": "SoutheastAsia",
"properties": {
"createMode": "Replica",
"sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server"
}
}
import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode;
import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku;
import com.azure.resourcemanager.mysqlflexibleserver.models.ServerSkuTier;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/
* ServerCreateReplica.json
*/
/**
* Sample code: Create a replica server.
*
* @param manager Entry point to MySqlManager.
*/
public static void createAReplicaServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) {
manager.servers().define("replica-server").withRegion("SoutheastAsia").withExistingResourceGroup("testgr")
.withCreateMode(CreateMode.REPLICA)
.withSourceServerResourceId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server")
.create();
}
/*
* x-ms-original-file:
* specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/
* ServerCreateWithPointInTimeRestore.json
*/
/**
* Sample code: Create a server as a point in time restore.
*
* @param manager Entry point to MySqlManager.
*/
public static void
createAServerAsAPointInTimeRestore(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) {
manager.servers().define("targetserver").withRegion("SoutheastAsia")
.withExistingResourceGroup("TargetResourceGroup").withTags(mapOf("num", "1"))
.withSku(new MySqlServerSku().withName("Standard_D14_v2").withTier(ServerSkuTier.GENERAL_PURPOSE))
.withCreateMode(CreateMode.POINT_IN_TIME_RESTORE)
.withSourceServerResourceId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver")
.withRestorePointInTime(OffsetDateTime.parse("2021-06-24T00:00:37.467Z")).create();
}
// 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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.rdbms.mysql_flexibleservers import MySQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-rdbms
# USAGE
python server_create_replica.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 = MySQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_create(
resource_group_name="testgr",
server_name="replica-server",
parameters={
"location": "SoutheastAsia",
"properties": {
"createMode": "Replica",
"sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server",
},
},
).result()
print(response)
# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateReplica.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 armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateReplica.json
func ExampleServersClient_BeginCreate_createAReplicaServer() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmysqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testgr", "replica-server", armmysqlflexibleservers.Server{
Location: to.Ptr("SoutheastAsia"),
Properties: &armmysqlflexibleservers.ServerProperties{
CreateMode: to.Ptr(armmysqlflexibleservers.CreateModeReplica),
SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server"),
},
}, 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 = armmysqlflexibleservers.Server{
// Name: to.Ptr("replica-server"),
// Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/replica-server"),
// Location: to.Ptr("Southeast Asia"),
// Tags: map[string]*string{
// "ElasticServer": to.Ptr("1"),
// },
// Properties: &armmysqlflexibleservers.ServerProperties{
// AdministratorLogin: to.Ptr("cloudsa"),
// AvailabilityZone: to.Ptr("3"),
// Backup: &armmysqlflexibleservers.Backup{
// BackupRetentionDays: to.Ptr[int32](7),
// EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T08:19:18.572Z"); return t}()),
// GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled),
// },
// FullyQualifiedDomainName: to.Ptr("replica-server.database.mysql.azure.com"),
// HighAvailability: &armmysqlflexibleservers.HighAvailability{
// Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled),
// State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled),
// },
// MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{
// CustomWindow: to.Ptr("Disabled"),
// DayOfWeek: to.Ptr[int32](0),
// StartHour: to.Ptr[int32](0),
// StartMinute: to.Ptr[int32](0),
// },
// Network: &armmysqlflexibleservers.Network{
// PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled),
// },
// ReplicaCapacity: to.Ptr[int32](0),
// ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleReplica),
// SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server"),
// State: to.Ptr(armmysqlflexibleservers.ServerStateReady),
// Storage: &armmysqlflexibleservers.Storage{
// AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled),
// Iops: to.Ptr[int32](360),
// StorageSizeGB: to.Ptr[int32](20),
// StorageSKU: to.Ptr("Premium_LRS"),
// },
// Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7),
// },
// SKU: &armmysqlflexibleservers.MySQLServerSKU{
// Name: to.Ptr("Standard_D2ds_v4"),
// Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MySQLManagementFlexibleServerClient } = require("@azure/arm-mysql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a new server or updates an existing server. The update action will overwrite the existing server.
*
* @summary Creates a new server or updates an existing server. The update action will overwrite the existing server.
* x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateReplica.json
*/
async function createAReplicaServer() {
const subscriptionId =
process.env["MYSQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["MYSQL_RESOURCE_GROUP"] || "testgr";
const serverName = "replica-server";
const parameters = {
createMode: "Replica",
location: "SoutheastAsia",
sourceServerResourceId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server",
};
const credential = new DefaultAzureCredential();
const client = new MySQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginCreateAndWait(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.MySql.FlexibleServers.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.MySql.FlexibleServers;
// Generated from example definition: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateReplica.json
// this example is just showing the usage of "Servers_Create" 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://video2.skills-academy.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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testgr";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this MySqlFlexibleServerResource
MySqlFlexibleServerCollection collection = resourceGroupResource.GetMySqlFlexibleServers();
// invoke the operation
string serverName = "replica-server";
MySqlFlexibleServerData data = new MySqlFlexibleServerData(new AzureLocation("SoutheastAsia"))
{
CreateMode = MySqlFlexibleServerCreateMode.Replica,
SourceServerResourceId = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server"),
};
ArmOperation<MySqlFlexibleServerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serverName, data);
MySqlFlexibleServerResource 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
MySqlFlexibleServerData 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
Örnek yanıt
{
"sku": {
"name": "Standard_D2ds_v4",
"tier": "GeneralPurpose"
},
"properties": {
"administratorLogin": "cloudsa",
"storage": {
"storageSizeGB": 20,
"iops": 360,
"autoGrow": "Enabled",
"storageSku": "Premium_LRS"
},
"version": "5.7",
"state": "Ready",
"fullyQualifiedDomainName": "replica-server.database.mysql.azure.com",
"sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server",
"availabilityZone": "3",
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replicationRole": "Replica",
"replicaCapacity": 0,
"network": {
"publicNetworkAccess": "Enabled"
},
"backup": {
"backupRetentionDays": 7,
"backupIntervalHours": 24,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2021-06-24T08:19:18.5729164+00:00"
},
"highAvailability": {
"mode": "Disabled",
"state": "NotEnabled"
}
},
"location": "Southeast Asia",
"tags": {
"ElasticServer": "1"
},
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/replica-server",
"name": "replica-server",
"type": "Microsoft.DBforMySQL/flexibleServers"
}
{
"sku": {
"name": "Standard_D2ds_v4",
"tier": "GeneralPurpose"
},
"properties": {
"administratorLogin": "cloudsa",
"storage": {
"storageSizeGB": 20,
"iops": 360,
"autoGrow": "Enabled",
"storageSku": "Premium_LRS"
},
"version": "5.7",
"state": "Ready",
"fullyQualifiedDomainName": "replica-server.database.mysql.azure.com",
"sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server",
"availabilityZone": "3",
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replicationRole": "Replica",
"replicaCapacity": 0,
"network": {
"publicNetworkAccess": "Enabled"
},
"backup": {
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2021-06-24T08:19:18.5729164+00:00"
},
"highAvailability": {
"mode": "Disabled",
"state": "NotEnabled"
}
},
"location": "Southeast Asia",
"tags": {
"ElasticServer": "1"
},
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/replica-server",
"name": "replica-server",
"type": "Microsoft.DBforMySQL/flexibleServers"
}
Create a server as a point in time restore
Örnek isteği
PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/targetserver?api-version=2023-12-30
{
"location": "SoutheastAsia",
"properties": {
"restorePointInTime": "2021-06-24T00:00:37.467Z",
"createMode": "PointInTimeRestore",
"sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver"
},
"sku": {
"name": "Standard_D14_v2",
"tier": "GeneralPurpose"
},
"tags": {
"num": "1"
}
}
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.rdbms.mysql_flexibleservers import MySQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-rdbms
# USAGE
python server_create_with_point_in_time_restore.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 = MySQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_create(
resource_group_name="TargetResourceGroup",
server_name="targetserver",
parameters={
"location": "SoutheastAsia",
"properties": {
"createMode": "PointInTimeRestore",
"restorePointInTime": "2021-06-24T00:00:37.467Z",
"sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver",
},
"sku": {"name": "Standard_D14_v2", "tier": "GeneralPurpose"},
"tags": {"num": "1"},
},
).result()
print(response)
# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateWithPointInTimeRestore.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 armmysqlflexibleservers_test
import (
"context"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateWithPointInTimeRestore.json
func ExampleServersClient_BeginCreate_createAServerAsAPointInTimeRestore() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmysqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armmysqlflexibleservers.Server{
Location: to.Ptr("SoutheastAsia"),
Tags: map[string]*string{
"num": to.Ptr("1"),
},
Properties: &armmysqlflexibleservers.ServerProperties{
CreateMode: to.Ptr(armmysqlflexibleservers.CreateModePointInTimeRestore),
RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T00:00:37.467Z"); return t }()),
SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver"),
},
SKU: &armmysqlflexibleservers.MySQLServerSKU{
Name: to.Ptr("Standard_D14_v2"),
Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose),
},
}, 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 = armmysqlflexibleservers.Server{
// Name: to.Ptr("targetserver"),
// Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/targetserver"),
// Location: to.Ptr("Southeast Asia"),
// Tags: map[string]*string{
// "num": to.Ptr("1"),
// },
// Properties: &armmysqlflexibleservers.ServerProperties{
// AdministratorLogin: to.Ptr("adminuser"),
// AvailabilityZone: to.Ptr("1"),
// Backup: &armmysqlflexibleservers.Backup{
// BackupIntervalHours: to.Ptr[int32](24),
// BackupRetentionDays: to.Ptr[int32](7),
// EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T00:15:24.000Z"); return t}()),
// GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled),
// },
// FullyQualifiedDomainName: to.Ptr("targetserver.database.mysql.azure.com"),
// HighAvailability: &armmysqlflexibleservers.HighAvailability{
// Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled),
// State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled),
// },
// MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{
// CustomWindow: to.Ptr("Disabled"),
// DayOfWeek: to.Ptr[int32](0),
// StartHour: to.Ptr[int32](0),
// StartMinute: to.Ptr[int32](0),
// },
// Network: &armmysqlflexibleservers.Network{
// PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled),
// },
// ReplicaCapacity: to.Ptr[int32](10),
// ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone),
// State: to.Ptr(armmysqlflexibleservers.ServerStateReady),
// Storage: &armmysqlflexibleservers.Storage{
// AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled),
// Iops: to.Ptr[int32](360),
// StorageSizeGB: to.Ptr[int32](20),
// StorageSKU: to.Ptr("Premium_LRS"),
// },
// Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7),
// },
// SKU: &armmysqlflexibleservers.MySQLServerSKU{
// Name: to.Ptr("Standard_D2ds_v4"),
// Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MySQLManagementFlexibleServerClient } = require("@azure/arm-mysql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a new server or updates an existing server. The update action will overwrite the existing server.
*
* @summary Creates a new server or updates an existing server. The update action will overwrite the existing server.
* x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateWithPointInTimeRestore.json
*/
async function createAServerAsAPointInTimeRestore() {
const subscriptionId =
process.env["MYSQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["MYSQL_RESOURCE_GROUP"] || "TargetResourceGroup";
const serverName = "targetserver";
const parameters = {
createMode: "PointInTimeRestore",
location: "SoutheastAsia",
restorePointInTime: new Date("2021-06-24T00:00:37.467Z"),
sku: { name: "Standard_D14_v2", tier: "GeneralPurpose" },
sourceServerResourceId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver",
tags: { num: "1" },
};
const credential = new DefaultAzureCredential();
const client = new MySQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginCreateAndWait(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.MySql.FlexibleServers.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.MySql.FlexibleServers;
// Generated from example definition: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateWithPointInTimeRestore.json
// this example is just showing the usage of "Servers_Create" 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://video2.skills-academy.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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "TargetResourceGroup";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this MySqlFlexibleServerResource
MySqlFlexibleServerCollection collection = resourceGroupResource.GetMySqlFlexibleServers();
// invoke the operation
string serverName = "targetserver";
MySqlFlexibleServerData data = new MySqlFlexibleServerData(new AzureLocation("SoutheastAsia"))
{
Sku = new MySqlFlexibleServerSku("Standard_D14_v2", MySqlFlexibleServerSkuTier.GeneralPurpose),
CreateMode = MySqlFlexibleServerCreateMode.PointInTimeRestore,
SourceServerResourceId = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver"),
RestorePointInTime = DateTimeOffset.Parse("2021-06-24T00:00:37.467Z"),
Tags =
{
["num"] = "1",
},
};
ArmOperation<MySqlFlexibleServerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serverName, data);
MySqlFlexibleServerResource 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
MySqlFlexibleServerData 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
Örnek yanıt
{
"sku": {
"name": "Standard_D2ds_v4",
"tier": "GeneralPurpose"
},
"properties": {
"administratorLogin": "adminuser",
"storage": {
"storageSizeGB": 20,
"iops": 360,
"autoGrow": "Enabled",
"storageSku": "Premium_LRS"
},
"version": "5.7",
"state": "Ready",
"fullyQualifiedDomainName": "targetserver.database.mysql.azure.com",
"availabilityZone": "1",
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replicationRole": "None",
"replicaCapacity": 10,
"network": {
"publicNetworkAccess": "Enabled"
},
"backup": {
"backupRetentionDays": 7,
"backupIntervalHours": 24,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2021-06-24T00:15:24.00+00:00"
},
"highAvailability": {
"mode": "Disabled",
"state": "NotEnabled"
}
},
"location": "Southeast Asia",
"tags": {
"num": "1"
},
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/targetserver",
"name": "targetserver",
"type": "Microsoft.DBforMySQL/flexibleServers"
}
{
"sku": {
"name": "Standard_D2ds_v4",
"tier": "GeneralPurpose"
},
"properties": {
"administratorLogin": "adminuser",
"storage": {
"storageSizeGB": 20,
"iops": 360,
"autoGrow": "Enabled",
"storageSku": "Premium_LRS"
},
"version": "5.7",
"state": "Ready",
"fullyQualifiedDomainName": "targetserver.database.mysql.azure.com",
"availabilityZone": "1",
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replicationRole": "None",
"replicaCapacity": 10,
"network": {
"publicNetworkAccess": "Enabled"
},
"backup": {
"backupRetentionDays": 7,
"backupIntervalHours": 24,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2021-06-24T00:15:24.00+00:00"
},
"highAvailability": {
"mode": "Disabled",
"state": "NotEnabled"
}
},
"location": "Southeast Asia",
"tags": {
"num": "1"
},
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/targetserver",
"name": "targetserver",
"type": "Microsoft.DBforMySQL/flexibleServers"
}
Create a server with byok
Örnek isteği
PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver?api-version=2023-12-30
{
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {}
}
},
"sku": {
"name": "Standard_D2ds_v4",
"tier": "GeneralPurpose"
},
"properties": {
"administratorLogin": "cloudsa",
"administratorLoginPassword": "your_password",
"availabilityZone": "1",
"version": "5.7",
"createMode": "Default",
"storage": {
"storageSizeGB": 100,
"iops": 600,
"autoGrow": "Disabled"
},
"backup": {
"backupRetentionDays": 7,
"backupIntervalHours": 24,
"geoRedundantBackup": "Disabled"
},
"highAvailability": {
"mode": "ZoneRedundant",
"standbyAvailabilityZone": "3"
},
"dataEncryption": {
"type": "AzureKeyVault",
"primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity",
"primaryKeyURI": "https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a",
"geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity",
"geoBackupKeyURI": "https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"
}
},
"location": "southeastasia",
"tags": {
"num": "1"
}
}
import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.mysqlflexibleserver.models.Backup;
import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode;
import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption;
import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryptionType;
import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum;
import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability;
import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityMode;
import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity;
import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku;
import com.azure.resourcemanager.mysqlflexibleserver.models.ServerSkuTier;
import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion;
import com.azure.resourcemanager.mysqlflexibleserver.models.Storage;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/
* ServerCreateWithBYOK.json
*/
/**
* Sample code: Create a server with byok.
*
* @param manager Entry point to MySqlManager.
*/
public static void createAServerWithByok(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager)
throws IOException {
manager.servers().define("mysqltestserver").withRegion("southeastasia").withExistingResourceGroup("testrg")
.withTags(mapOf("num", "1"))
.withIdentity(new MySqlServerIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(mapOf(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity",
SerializerFactory.createDefaultManagementSerializerAdapter().deserialize("{}", Object.class,
SerializerEncoding.JSON))))
.withSku(new MySqlServerSku().withName("Standard_D2ds_v4").withTier(ServerSkuTier.GENERAL_PURPOSE))
.withAdministratorLogin("cloudsa").withAdministratorLoginPassword("your_password")
.withVersion(ServerVersion.FIVE_SEVEN).withAvailabilityZone("1").withCreateMode(CreateMode.DEFAULT)
.withDataEncryption(new DataEncryption().withPrimaryUserAssignedIdentityId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity")
.withPrimaryKeyUri("fakeTokenPlaceholder")
.withGeoBackupUserAssignedIdentityId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity")
.withGeoBackupKeyUri("fakeTokenPlaceholder").withType(DataEncryptionType.AZURE_KEY_VAULT))
.withStorage(new Storage().withStorageSizeGB(100).withIops(600).withAutoGrow(EnableStatusEnum.DISABLED))
.withBackup(new Backup().withBackupRetentionDays(7).withBackupIntervalHours(24)
.withGeoRedundantBackup(EnableStatusEnum.DISABLED))
.withHighAvailability(
new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3"))
.create();
}
/*
* x-ms-original-file:
* specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/
* ServerCreateWithPointInTimeRestore.json
*/
/**
* Sample code: Create a server as a point in time restore.
*
* @param manager Entry point to MySqlManager.
*/
public static void
createAServerAsAPointInTimeRestore(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) {
manager.servers().define("targetserver").withRegion("SoutheastAsia")
.withExistingResourceGroup("TargetResourceGroup").withTags(mapOf("num", "1"))
.withSku(new MySqlServerSku().withName("Standard_D14_v2").withTier(ServerSkuTier.GENERAL_PURPOSE))
.withCreateMode(CreateMode.POINT_IN_TIME_RESTORE)
.withSourceServerResourceId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver")
.withRestorePointInTime(OffsetDateTime.parse("2021-06-24T00:00:37.467Z")).create();
}
// 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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.rdbms.mysql_flexibleservers import MySQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-rdbms
# USAGE
python server_create_with_byok.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 = MySQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_create(
resource_group_name="testrg",
server_name="mysqltestserver",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {}
},
},
"location": "southeastasia",
"properties": {
"administratorLogin": "cloudsa",
"administratorLoginPassword": "your_password",
"availabilityZone": "1",
"backup": {"backupIntervalHours": 24, "backupRetentionDays": 7, "geoRedundantBackup": "Disabled"},
"createMode": "Default",
"dataEncryption": {
"geoBackupKeyURI": "https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a",
"geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity",
"primaryKeyURI": "https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a",
"primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity",
"type": "AzureKeyVault",
},
"highAvailability": {"mode": "ZoneRedundant", "standbyAvailabilityZone": "3"},
"storage": {"autoGrow": "Disabled", "iops": 600, "storageSizeGB": 100},
"version": "5.7",
},
"sku": {"name": "Standard_D2ds_v4", "tier": "GeneralPurpose"},
"tags": {"num": "1"},
},
).result()
print(response)
# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateWithBYOK.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 armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8691fbfca8fcdc5a241a0b501c32fd4a76bb0cd/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateWithBYOK.json
func ExampleServersClient_BeginCreate_createAServerWithByok() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmysqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.Server{
Location: to.Ptr("southeastasia"),
Tags: map[string]*string{
"num": to.Ptr("1"),
},
Identity: &armmysqlflexibleservers.MySQLServerIdentity{
Type: to.Ptr(armmysqlflexibleservers.ManagedServiceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]any{
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": map[string]any{},
},
},
Properties: &armmysqlflexibleservers.ServerProperties{
AdministratorLogin: to.Ptr("cloudsa"),
AdministratorLoginPassword: to.Ptr("your_password"),
AvailabilityZone: to.Ptr("1"),
Backup: &armmysqlflexibleservers.Backup{
BackupIntervalHours: to.Ptr[int32](24),
BackupRetentionDays: to.Ptr[int32](7),
GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled),
},
CreateMode: to.Ptr(armmysqlflexibleservers.CreateModeDefault),
DataEncryption: &armmysqlflexibleservers.DataEncryption{
Type: to.Ptr(armmysqlflexibleservers.DataEncryptionTypeAzureKeyVault),
GeoBackupKeyURI: to.Ptr("https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"),
GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity"),
PrimaryKeyURI: to.Ptr("https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"),
PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity"),
},
HighAvailability: &armmysqlflexibleservers.HighAvailability{
Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant),
StandbyAvailabilityZone: to.Ptr("3"),
},
Storage: &armmysqlflexibleservers.Storage{
AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled),
Iops: to.Ptr[int32](600),
StorageSizeGB: to.Ptr[int32](100),
},
Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7),
},
SKU: &armmysqlflexibleservers.MySQLServerSKU{
Name: to.Ptr("Standard_D2ds_v4"),
Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose),
},
}, 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 = armmysqlflexibleservers.Server{
// Name: to.Ptr("mysqltestserver"),
// Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"),
// Location: to.Ptr("Southeast Asia"),
// Tags: map[string]*string{
// "num": to.Ptr("1"),
// },
// Properties: &armmysqlflexibleservers.ServerProperties{
// AdministratorLogin: to.Ptr("cloudsa"),
// AvailabilityZone: to.Ptr("1"),
// Backup: &armmysqlflexibleservers.Backup{
// BackupRetentionDays: to.Ptr[int32](7),
// EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()),
// GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled),
// },
// FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"),
// HighAvailability: &armmysqlflexibleservers.HighAvailability{
// Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant),
// StandbyAvailabilityZone: to.Ptr("3"),
// State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy),
// },
// MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{
// CustomWindow: to.Ptr("Disabled"),
// DayOfWeek: to.Ptr[int32](0),
// StartHour: to.Ptr[int32](0),
// StartMinute: to.Ptr[int32](0),
// },
// Network: &armmysqlflexibleservers.Network{
// PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled),
// },
// ReplicaCapacity: to.Ptr[int32](10),
// ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone),
// State: to.Ptr(armmysqlflexibleservers.ServerStateReady),
// Storage: &armmysqlflexibleservers.Storage{
// AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled),
// Iops: to.Ptr[int32](600),
// StorageSizeGB: to.Ptr[int32](100),
// StorageSKU: to.Ptr("Premium_LRS"),
// },
// Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7),
// },
// SKU: &armmysqlflexibleservers.MySQLServerSKU{
// Name: to.Ptr("Standard_D2ds_v4"),
// Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MySQLManagementFlexibleServerClient } = require("@azure/arm-mysql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a new server or updates an existing server. The update action will overwrite the existing server.
*
* @summary Creates a new server or updates an existing server. The update action will overwrite the existing server.
* x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateWithBYOK.json
*/
async function createAServerWithByok() {
const subscriptionId =
process.env["MYSQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["MYSQL_RESOURCE_GROUP"] || "testrg";
const serverName = "mysqltestserver";
const parameters = {
administratorLogin: "cloudsa",
administratorLoginPassword: "your_password",
availabilityZone: "1",
backup: {
backupIntervalHours: 24,
backupRetentionDays: 7,
geoRedundantBackup: "Disabled",
},
createMode: "Default",
dataEncryption: {
type: "AzureKeyVault",
geoBackupKeyURI: "https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a",
geoBackupUserAssignedIdentityId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity",
primaryKeyURI: "https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a",
primaryUserAssignedIdentityId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity",
},
highAvailability: { mode: "ZoneRedundant", standbyAvailabilityZone: "3" },
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/ffffffffFfffFfffFfffFfffffffffff/resourceGroups/testrg/providers/MicrosoftManagedIdentity/userAssignedIdentities/testIdentity":
{},
},
},
location: "southeastasia",
sku: { name: "Standard_D2ds_v4", tier: "GeneralPurpose" },
storage: { autoGrow: "Disabled", iops: 600, storageSizeGB: 100 },
tags: { num: "1" },
version: "5.7",
};
const credential = new DefaultAzureCredential();
const client = new MySQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginCreateAndWait(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.MySql.FlexibleServers.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.MySql.FlexibleServers;
// Generated from example definition: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreateWithBYOK.json
// this example is just showing the usage of "Servers_Create" 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://video2.skills-academy.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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "testrg";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this MySqlFlexibleServerResource
MySqlFlexibleServerCollection collection = resourceGroupResource.GetMySqlFlexibleServers();
// invoke the operation
string serverName = "mysqltestserver";
MySqlFlexibleServerData data = new MySqlFlexibleServerData(new AzureLocation("southeastasia"))
{
Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
[new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity")] = new UserAssignedIdentity(),
},
},
Sku = new MySqlFlexibleServerSku("Standard_D2ds_v4", MySqlFlexibleServerSkuTier.GeneralPurpose),
AdministratorLogin = "cloudsa",
AdministratorLoginPassword = "your_password",
Version = MySqlFlexibleServerVersion.Ver5_7,
AvailabilityZone = "1",
CreateMode = MySqlFlexibleServerCreateMode.Default,
DataEncryption = new MySqlFlexibleServerDataEncryption()
{
PrimaryUserAssignedIdentityId = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity"),
PrimaryKeyUri = new Uri("https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"),
GeoBackupUserAssignedIdentityId = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity"),
GeoBackupKeyUri = new Uri("https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"),
EncryptionType = MySqlFlexibleServerDataEncryptionType.AzureKeyVault,
},
Storage = new MySqlFlexibleServerStorage()
{
StorageSizeInGB = 100,
Iops = 600,
AutoGrow = MySqlFlexibleServerEnableStatusEnum.Disabled,
},
Backup = new MySqlFlexibleServerBackupProperties()
{
BackupRetentionDays = 7,
BackupIntervalHours = 24,
GeoRedundantBackup = MySqlFlexibleServerEnableStatusEnum.Disabled,
},
HighAvailability = new MySqlFlexibleServerHighAvailability()
{
Mode = MySqlFlexibleServerHighAvailabilityMode.ZoneRedundant,
StandbyAvailabilityZone = "3",
},
Tags =
{
["num"] = "1",
},
};
ArmOperation<MySqlFlexibleServerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serverName, data);
MySqlFlexibleServerResource 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
MySqlFlexibleServerData 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
Örnek yanıt
{
"sku": {
"name": "Standard_D2ds_v4",
"tier": "GeneralPurpose"
},
"properties": {
"administratorLogin": "cloudsa",
"storage": {
"storageSizeGB": 100,
"iops": 600,
"autoGrow": "Enabled",
"storageSku": "Premium_LRS"
},
"version": "5.7",
"state": "Ready",
"fullyQualifiedDomainName": "mysqltestserver.database.mysql.azure.com",
"availabilityZone": "1",
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replicationRole": "None",
"replicaCapacity": 10,
"network": {
"publicNetworkAccess": "Enabled"
},
"backup": {
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2021-06-17T06:11:38.4150019+00:00"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "3"
}
},
"location": "Southeast Asia",
"tags": {
"num": "1"
},
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver",
"name": "mysqltestserver",
"type": "Microsoft.DBforMySQL/flexibleServers"
}
{
"sku": {
"name": "Standard_D2ds_v4",
"tier": "GeneralPurpose"
},
"properties": {
"administratorLogin": "cloudsa",
"storage": {
"storageSizeGB": 100,
"iops": 600,
"autoGrow": "Enabled",
"storageSku": "Premium_LRS"
},
"version": "5.7",
"state": "Ready",
"fullyQualifiedDomainName": "mysqltestserver.database.mysql.azure.com",
"availabilityZone": "1",
"maintenanceWindow": {
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"replicationRole": "None",
"replicaCapacity": 10,
"network": {
"publicNetworkAccess": "Enabled"
},
"backup": {
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled",
"earliestRestoreDate": "2021-06-17T06:11:38.4150019+00:00"
},
"highAvailability": {
"mode": "ZoneRedundant",
"state": "Healthy",
"standbyAvailabilityZone": "3"
}
},
"location": "Southeast Asia",
"tags": {
"num": "1"
},
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver",
"name": "mysqltestserver",
"type": "Microsoft.DBforMySQL/flexibleServers"
}
Tanımlar
Backup
Sunucunun Depolama Profili özellikleri
Name |
Tür |
Default value |
Description |
backupIntervalHours
|
integer
|
|
Sunucu için yedekleme aralığı saatleri.
|
backupRetentionDays
|
integer
|
|
Sunucu için yedekleme bekletme günleri.
|
earliestRestoreDate
|
string
|
|
En erken geri yükleme noktası oluşturma zamanı (ISO8601 biçimi)
|
geoRedundantBackup
|
EnableStatusEnum
|
Disabled
|
Coğrafi olarak yedekli yedeklemenin etkinleştirilip etkinleştirilmediği.
|
createdByType
Kaynağı oluşturan kimliğin türü.
Name |
Tür |
Description |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
CreateMode
Yeni bir MySQL sunucusu oluşturma modu.
Name |
Tür |
Description |
Default
|
string
|
|
GeoRestore
|
string
|
|
PointInTimeRestore
|
string
|
|
Replica
|
string
|
|
DataEncryption
cmk için tarih şifrelemesi.
Name |
Tür |
Description |
geoBackupKeyURI
|
string
|
Anahtar kasası bölgeler arasında geçemiyorsa coğrafi yedekleme anahtarı uri'sini kullanın, coğrafi yedekleme ile aynı bölgede cmk gerekir
|
geoBackupUserAssignedIdentityId
|
string
|
Coğrafi yedekleme kullanıcı kimliği kaynak kimliği olarak kimlik bölgeler arasında geçemez, coğrafi yedekleme ile aynı bölgede kimliğe ihtiyaç duyar
|
primaryKeyURI
|
string
|
Birincil anahtar uri'si
|
primaryUserAssignedIdentityId
|
string
|
Birincil kullanıcı kimliği kaynak kimliği
|
type
|
DataEncryptionType
|
Anahtar türü, etkinleştirme cmk için AzureKeyVault, devre dışı bırakma cmk için SystemManaged.
|
DataEncryptionType
Anahtar türü, etkinleştirme cmk için AzureKeyVault, devre dışı bırakma cmk için SystemManaged.
Name |
Tür |
Description |
AzureKeyVault
|
string
|
|
SystemManaged
|
string
|
|
EnableStatusEnum
Değerin 'Etkin' mi yoksa 'Devre Dışı' mı olduğunu belirtmek için sabit listesi
Name |
Tür |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
ErrorAdditionalInfo
Kaynak yönetimi hatası ek bilgileri.
Name |
Tür |
Description |
info
|
object
|
Ek bilgiler.
|
type
|
string
|
Ek bilgi türü.
|
ErrorDetail
Hata ayrıntısı.
Name |
Tür |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
Hata ek bilgileri.
|
code
|
string
|
Hata kodu.
|
details
|
ErrorDetail[]
|
Hata ayrıntıları.
|
message
|
string
|
Hata iletisi.
|
target
|
string
|
Hata hedefi.
|
ErrorResponse
Hata yanıtı
HighAvailability
Sunucunun yüksek kullanılabilirlik özellikleri
Name |
Tür |
Description |
mode
|
HighAvailabilityMode
|
Bir sunucu için yüksek kullanılabilirlik modu.
|
standbyAvailabilityZone
|
string
|
Hazır bekleyen sunucunun kullanılabilirlik alanı.
|
state
|
HighAvailabilityState
|
Sunucunun yüksek kullanılabilirlik durumu.
|
HighAvailabilityMode
Bir sunucu için yüksek kullanılabilirlik modu.
Name |
Tür |
Description |
Disabled
|
string
|
|
SameZone
|
string
|
|
ZoneRedundant
|
string
|
|
HighAvailabilityState
Sunucunun yüksek kullanılabilirlik durumu.
Name |
Tür |
Description |
CreatingStandby
|
string
|
|
FailingOver
|
string
|
|
Healthy
|
string
|
|
NotEnabled
|
string
|
|
RemovingStandby
|
string
|
|
ImportSourceProperties
Kaynakla ilgili özellikleri içeri aktar.
Name |
Tür |
Description |
dataDirPath
|
string
|
Depolamadaki veri dizininin göreli yolu.
|
sasToken
|
string
|
Kaynak depolamaya erişmek için Sas belirteci. Sas belirteci için okuma ve listeleme izinleri gereklidir.
|
storageType
|
ImportSourceStorageType
|
İçeri aktarma kaynağının depolama türü.
|
storageUrl
|
string
|
İçeri aktarma kaynak depolamasının Uri'si.
|
ImportSourceStorageType
İçeri aktarma kaynağının depolama türü.
Name |
Tür |
Description |
AzureBlob
|
string
|
|
MaintenanceWindow
Sunucunun bakım penceresi.
Name |
Tür |
Description |
customWindow
|
string
|
özel pencerenin etkinleştirilip etkinleştirilmediğini veya devre dışı bırakılıp bırakılmadığını gösterir
|
dayOfWeek
|
integer
|
bakım penceresi için haftanın günü
|
startHour
|
integer
|
bakım penceresi için başlangıç saati
|
startMinute
|
integer
|
bakım penceresi için başlangıç dakikası
|
ManagedServiceIdentityType
Yönetilen hizmet kimliğinin türü.
Name |
Tür |
Description |
UserAssigned
|
string
|
|
MySQLServerSku
Sunucunun faturalama bilgileriyle ilgili özellikleri.
Name |
Tür |
Description |
name
|
string
|
Sku'nun adı, örneğin Standard_D32s_v3.
|
tier
|
ServerSkuTier
|
Belirli bir SKU'nun katmanı, örneğin GeneralPurpose.
|
Network
Sunucunun ağ ile ilgili özellikleri
Name |
Tür |
Description |
delegatedSubnetResourceId
|
string
|
Bir sunucu için sanal ağı ayarlamak için kullanılan temsilci alt ağ kaynak kimliği.
|
privateDnsZoneResourceId
|
string
|
bölge kaynak kimliğini Özel DNS.
|
publicNetworkAccess
|
EnableStatusEnum
|
Bu sunucu için genel ağ erişimine izin verilip verilmeyeceği. Sunucu sanal ağ tümleştirmesi olduğunda değer 'Devre Dışı' olarak ayarlanır.
|
PrivateEndpoint
Özel uç nokta kaynağı.
Name |
Tür |
Description |
id
|
string
|
Özel uç noktanın ARM tanımlayıcısı.
|
PrivateEndpointConnection
Özel uç nokta bağlantı kaynağı.
Name |
Tür |
Description |
id
|
string
|
Kaynağın tam kaynak kimliği. Örneğin, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
name
|
string
|
Kaynağın adı
|
properties.groupIds
|
string[]
|
Özel uç nokta kaynağının grup kimlikleri.
|
properties.privateEndpoint
|
PrivateEndpoint
|
Özel uç nokta kaynağı.
|
properties.privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Hizmet tüketicisi ile sağlayıcı arasındaki bağlantının durumu hakkında bilgi koleksiyonu.
|
properties.provisioningState
|
PrivateEndpointConnectionProvisioningState
|
Özel uç nokta bağlantı kaynağının sağlama durumu.
|
systemData
|
systemData
|
Azure Resource Manager createdBy ve modifiedBy bilgilerini içeren meta veriler.
|
type
|
string
|
Kaynağın türü. Örneğin, "Microsoft.Compute/virtualMachines" veya "Microsoft.Storage/storageAccounts"
|
PrivateEndpointConnectionProvisioningState
Geçerli sağlama durumu.
Name |
Tür |
Description |
Creating
|
string
|
|
Deleting
|
string
|
|
Failed
|
string
|
|
Succeeded
|
string
|
|
PrivateEndpointServiceConnectionStatus
Özel uç nokta bağlantı durumu.
Name |
Tür |
Description |
Approved
|
string
|
|
Pending
|
string
|
|
Rejected
|
string
|
|
PrivateLinkServiceConnectionState
Hizmet tüketicisi ile sağlayıcı arasındaki bağlantının durumu hakkında bilgi koleksiyonu.
Name |
Tür |
Description |
actionsRequired
|
string
|
Hizmet sağlayıcısındaki değişikliklerin tüketicide herhangi bir güncelleştirme gerektirip gerektirmediğini belirten bir ileti.
|
description
|
string
|
Bağlantının onay/reddedilme nedeni.
|
status
|
PrivateEndpointServiceConnectionStatus
|
Bağlantının hizmet sahibi tarafından Onaylanıp Reddedildiğini/Kaldırıldığını gösterir.
|
ReplicationRole
Çoğaltma rolü.
Name |
Tür |
Description |
None
|
string
|
|
Replica
|
string
|
|
Source
|
string
|
|
Server
Bir sunucuyu temsil eder.
Name |
Tür |
Description |
id
|
string
|
Kaynağın tam kaynak kimliği. Örneğin, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
identity.principalId
|
string
|
KeyVault'tan ObjectId
|
identity.tenantId
|
string
|
KeyVault'tan TenantId
|
identity.type
|
ManagedServiceIdentityType
|
Yönetilen hizmet kimliğinin türü.
|
identity.userAssignedIdentities
|
object
|
Kullanıcı tarafından atanan kimliğin meta verileri.
|
location
|
string
|
Kaynağın bulunduğu coğrafi konum
|
name
|
string
|
Kaynağın adı
|
properties.administratorLogin
|
string
|
Yöneticinin sunucunun oturum açma adı. Yalnızca sunucu oluşturulurken belirtilebilir (ve oluşturma için gereklidir).
|
properties.administratorLoginPassword
|
string
|
Yönetici oturum açma parolasını (sunucu oluşturmak için gereklidir).
|
properties.availabilityZone
|
string
|
sunucunun kullanılabilirlik Alanı bilgileri.
|
properties.backup
|
Backup
|
Sunucunun ilgili özelliklerini yedekleme.
|
properties.createMode
|
CreateMode
|
Yeni bir MySQL sunucusu oluşturma modu.
|
properties.dataEncryption
|
DataEncryption
|
CMK için Veri Şifrelemesi.
|
properties.fullyQualifiedDomainName
|
string
|
Sunucunun tam etki alanı adı.
|
properties.highAvailability
|
HighAvailability
|
Bir sunucunun yüksek kullanılabilirlik özellikleri.
|
properties.importSourceProperties
|
ImportSourceProperties
|
Depolamadan içeri aktarma için kaynak özellikler.
|
properties.maintenanceWindow
|
MaintenanceWindow
|
Sunucunun bakım penceresi.
|
properties.network
|
Network
|
Bir sunucunun ağ ile ilgili özellikleri.
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
Bir sunucunun PrivateEndpointConnections ile ilgili özellikleri.
|
properties.replicaCapacity
|
integer
|
Birincil sunucunun sahip olabileceği en fazla çoğaltma sayısı.
|
properties.replicationRole
|
ReplicationRole
|
Çoğaltma rolü.
|
properties.restorePointInTime
|
string
|
Geri yükleme noktası oluşturma zamanı (ISO8601 biçimi), geri yükleneceği zamanı belirtir.
|
properties.sourceServerResourceId
|
string
|
Kaynak MySQL sunucu kimliği.
|
properties.state
|
ServerState
|
Sunucunun durumu.
|
properties.storage
|
Storage
|
Sunucunun depolamayla ilgili özellikleri.
|
properties.version
|
ServerVersion
|
Sunucu sürümü.
|
sku
|
MySQLServerSku
|
Sunucunun SKU'su (fiyatlandırma katmanı).
|
systemData
|
systemData
|
Azure Resource Manager createdBy ve modifiedBy bilgilerini içeren meta veriler.
|
tags
|
object
|
Kaynak etiketleri.
|
type
|
string
|
Kaynağın türü. Örneğin, "Microsoft.Compute/virtualMachines" veya "Microsoft.Storage/storageAccounts"
|
ServerSkuTier
Belirli bir SKU'nun katmanı, örneğin GeneralPurpose.
Name |
Tür |
Description |
Burstable
|
string
|
|
GeneralPurpose
|
string
|
|
MemoryOptimized
|
string
|
|
ServerState
Sunucunun durumu.
Name |
Tür |
Description |
Disabled
|
string
|
|
Dropping
|
string
|
|
Ready
|
string
|
|
Starting
|
string
|
|
Stopped
|
string
|
|
Stopping
|
string
|
|
Updating
|
string
|
|
ServerVersion
Sunucunun sürümü.
Name |
Tür |
Description |
5.7
|
string
|
|
8.0.21
|
string
|
|
Storage
Sunucunun Depolama Profili özellikleri
Name |
Tür |
Default value |
Description |
autoGrow
|
EnableStatusEnum
|
Disabled
|
Depolama Otomatik Büyütme'yi etkinleştirin veya etkinleştirmeyin.
|
autoIoScaling
|
EnableStatusEnum
|
Enabled
|
GÇ Otomatik Ölçeklendirme'yi etkinleştirin veya etkinleştirmeyin.
|
iops
|
integer
|
|
Bir sunucu için depolama IOPS' sini seçin.
|
logOnDisk
|
EnableStatusEnum
|
Disabled
|
Oturum Açma Disk'i etkinleştirin veya etkinleştirmeyin.
|
storageSizeGB
|
integer
|
|
Bir sunucu için izin verilen en büyük depolama boyutu.
|
storageSku
|
string
|
|
Sunucu depolama alanının sku adı.
|
systemData
Kaynağın oluşturulması ve son değiştirilmesiyle ilgili meta veriler.
Name |
Tür |
Description |
createdAt
|
string
|
Kaynak oluşturma (UTC) zaman damgası.
|
createdBy
|
string
|
Kaynağı oluşturan kimlik.
|
createdByType
|
createdByType
|
Kaynağı oluşturan kimliğin türü.
|
lastModifiedAt
|
string
|
Kaynağın son değişikliğinin zaman damgası (UTC)
|
lastModifiedBy
|
string
|
Kaynağı en son değiştiren kimlik.
|
lastModifiedByType
|
createdByType
|
Kaynağı en son değiştiren kimliğin türü.
|