创建新服务器或更新现有服务器。 更新操作将覆盖现有服务器。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}?api-version=2023-12-30
URI 参数
名称 |
在 |
必需 |
类型 |
说明 |
resourceGroupName
|
path |
True
|
string
|
资源组的名称。 此名称不区分大小写。
|
serverName
|
path |
True
|
string
|
服务器的名称。
Regex pattern: ^[a-z0-9][-a-z0-9]*(?<!-)$
|
subscriptionId
|
path |
True
|
string
uuid
|
目标订阅的 ID。 该值必须是 UUID。
|
api-version
|
query |
True
|
string
|
要用于此操作的 API 版本。
|
请求正文
名称 |
必需 |
类型 |
说明 |
location
|
True
|
string
|
资源所在的地理位置
|
identity.type
|
|
ManagedServiceIdentityType
|
托管服务标识的类型。
|
identity.userAssignedIdentities
|
|
object
|
用户分配标识的元数据。
|
properties.administratorLogin
|
|
string
|
服务器的管理员登录名。 只能在 (创建服务器时指定,并且需要创建) 。
|
properties.administratorLoginPassword
|
|
string
|
创建服务器) 所需的管理员登录 (密码。
|
properties.availabilityZone
|
|
string
|
服务器的可用性区域信息。
|
properties.backup
|
|
Backup
|
服务器的备份相关属性。
|
properties.createMode
|
|
CreateMode
|
用于创建新的 MySQL 服务器的模式。
|
properties.dataEncryption
|
|
DataEncryption
|
CMK 的数据加密。
|
properties.highAvailability
|
|
HighAvailability
|
服务器的高可用性相关属性。
|
properties.importSourceProperties
|
|
ImportSourceProperties
|
用于从存储导入的源属性。
|
properties.maintenanceWindow
|
|
MaintenanceWindow
|
服务器的维护时段。
|
properties.network
|
|
Network
|
服务器的网络相关属性。
|
properties.replicationRole
|
|
ReplicationRole
|
复制角色。
|
properties.restorePointInTime
|
|
string
|
还原点创建时间 (ISO8601 格式) ,指定要从其还原的时间。
|
properties.sourceServerResourceId
|
|
string
|
源 MySQL 服务器 ID。
|
properties.storage
|
|
Storage
|
服务器的存储相关属性。
|
properties.version
|
|
ServerVersion
|
服务器版本。
|
sku
|
|
MySQLServerSku
|
服务器的 SKU (定价层) 。
|
tags
|
|
object
|
资源标记。
|
响应
名称 |
类型 |
说明 |
200 OK
|
Server
|
确定
|
201 Created
|
Server
|
创建
|
202 Accepted
|
|
已接受
Headers
Location: string
|
Other Status Codes
|
ErrorResponse
|
描述操作失败原因的错误响应。
|
安全性
azure_auth
Azure Active Directory OAuth2 流
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 |
说明 |
user_impersonation
|
模拟用户帐户
|
示例
Create a new server
Sample Request
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
Sample Response
{
"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
Sample Request
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
Sample Response
{
"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
Sample Request
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
Sample Response
{
"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
Sample Request
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
Sample Response
{
"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"
}
定义
Backup
服务器的存储配置文件属性
名称 |
类型 |
默认值 |
说明 |
backupIntervalHours
|
integer
|
|
服务器的备份间隔小时数。
|
backupRetentionDays
|
integer
|
|
服务器的备份保留天数。
|
earliestRestoreDate
|
string
|
|
最早的还原点创建时间 (ISO8601 格式)
|
geoRedundantBackup
|
EnableStatusEnum
|
Disabled
|
是否启用异地冗余备份。
|
createdByType
创建资源的标识类型。
名称 |
类型 |
说明 |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
CreateMode
用于创建新的 MySQL 服务器的模式。
名称 |
类型 |
说明 |
Default
|
string
|
|
GeoRestore
|
string
|
|
PointInTimeRestore
|
string
|
|
Replica
|
string
|
|
DataEncryption
cmk 的日期加密。
名称 |
类型 |
说明 |
geoBackupKeyURI
|
string
|
异地备份密钥 URI,因为密钥保管库不能跨区域,需要与异地备份位于同一区域中的 cmk
|
geoBackupUserAssignedIdentityId
|
string
|
异地备份用户标识资源 ID 作为标识不能跨区域,需要与异地备份位于同一区域中的标识
|
primaryKeyURI
|
string
|
主键 URI
|
primaryUserAssignedIdentityId
|
string
|
主要用户标识资源 ID
|
type
|
DataEncryptionType
|
密钥类型,用于启用 cmk 的 AzureKeyVault,用于禁用 cmk 的 SystemManaged。
|
DataEncryptionType
密钥类型,用于启用 cmk 的 AzureKeyVault,用于禁用 cmk 的 SystemManaged。
名称 |
类型 |
说明 |
AzureKeyVault
|
string
|
|
SystemManaged
|
string
|
|
EnableStatusEnum
用于指示值是“Enabled”还是“Disabled”的枚举
名称 |
类型 |
说明 |
Disabled
|
string
|
|
Enabled
|
string
|
|
ErrorAdditionalInfo
资源管理错误附加信息。
名称 |
类型 |
说明 |
info
|
object
|
其他信息。
|
type
|
string
|
其他信息类型。
|
ErrorDetail
错误详细信息。
ErrorResponse
错误响应
HighAvailability
服务器的高可用性属性
HighAvailabilityMode
服务器的高可用性模式。
名称 |
类型 |
说明 |
Disabled
|
string
|
|
SameZone
|
string
|
|
ZoneRedundant
|
string
|
|
HighAvailabilityState
服务器高可用性的状态。
名称 |
类型 |
说明 |
CreatingStandby
|
string
|
|
FailingOver
|
string
|
|
Healthy
|
string
|
|
NotEnabled
|
string
|
|
RemovingStandby
|
string
|
|
ImportSourceProperties
导入与源相关的属性。
名称 |
类型 |
说明 |
dataDirPath
|
string
|
存储中数据目录的相对路径。
|
sasToken
|
string
|
用于访问源存储的 Sas 令牌。 sas 令牌需要读取和列出权限。
|
storageType
|
ImportSourceStorageType
|
导入源的存储类型。
|
storageUrl
|
string
|
导入源存储的 URI。
|
ImportSourceStorageType
导入源的存储类型。
名称 |
类型 |
说明 |
AzureBlob
|
string
|
|
MaintenanceWindow
服务器的维护时段。
名称 |
类型 |
说明 |
customWindow
|
string
|
指示是启用或禁用自定义窗口
|
dayOfWeek
|
integer
|
维护时段的星期数
|
startHour
|
integer
|
维护时段的开始时间
|
startMinute
|
integer
|
维护时段的开始分钟数
|
ManagedServiceIdentityType
托管服务标识的类型。
名称 |
类型 |
说明 |
UserAssigned
|
string
|
|
MySQLServerSku
服务器的计费信息相关属性。
名称 |
类型 |
说明 |
name
|
string
|
sku 的名称,例如Standard_D32s_v3。
|
tier
|
ServerSkuTier
|
特定 SKU 的层,例如 GeneralPurpose。
|
Network
服务器的网络相关属性
名称 |
类型 |
说明 |
delegatedSubnetResourceId
|
string
|
用于为服务器设置 vnet 的委托子网资源 ID。
|
privateDnsZoneResourceId
|
string
|
专用 DNS区域资源 ID。
|
publicNetworkAccess
|
EnableStatusEnum
|
是否允许此服务器访问公用网络。 当服务器具有 VNet 集成时,值为“Disabled”。
|
PrivateEndpoint
专用终结点资源。
名称 |
类型 |
说明 |
id
|
string
|
专用终结点的 ARM 标识符。
|
PrivateEndpointConnection
专用终结点连接资源。
名称 |
类型 |
说明 |
id
|
string
|
资源的完全限定的资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”
|
name
|
string
|
资源的名称
|
properties.groupIds
|
string[]
|
专用终结点资源的组 ID。
|
properties.privateEndpoint
|
PrivateEndpoint
|
专用终结点资源。
|
properties.privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
有关服务使用者和提供程序之间的连接状态的信息集合。
|
properties.provisioningState
|
PrivateEndpointConnectionProvisioningState
|
专用终结点连接资源的预配状态。
|
systemData
|
systemData
|
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。
|
type
|
string
|
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”
|
PrivateEndpointConnectionProvisioningState
当前预配状态。
名称 |
类型 |
说明 |
Creating
|
string
|
|
Deleting
|
string
|
|
Failed
|
string
|
|
Succeeded
|
string
|
|
PrivateEndpointServiceConnectionStatus
专用终结点连接状态。
名称 |
类型 |
说明 |
Approved
|
string
|
|
Pending
|
string
|
|
Rejected
|
string
|
|
PrivateLinkServiceConnectionState
有关服务使用者和提供程序之间的连接状态的信息集合。
ReplicationRole
复制角色。
名称 |
类型 |
说明 |
None
|
string
|
|
Replica
|
string
|
|
Source
|
string
|
|
Server
表示服务器。
名称 |
类型 |
说明 |
id
|
string
|
资源的完全限定的资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”
|
identity.principalId
|
string
|
KeyVault 中的 ObjectId
|
identity.tenantId
|
string
|
KeyVault 中的 TenantId
|
identity.type
|
ManagedServiceIdentityType
|
托管服务标识的类型。
|
identity.userAssignedIdentities
|
object
|
用户分配标识的元数据。
|
location
|
string
|
资源所在的地理位置
|
name
|
string
|
资源的名称
|
properties.administratorLogin
|
string
|
服务器的管理员登录名。 只能在 (创建服务器时指定,并且需要创建) 。
|
properties.administratorLoginPassword
|
string
|
创建服务器) 所需的管理员登录 (密码。
|
properties.availabilityZone
|
string
|
服务器的可用性区域信息。
|
properties.backup
|
Backup
|
服务器的备份相关属性。
|
properties.createMode
|
CreateMode
|
用于创建新的 MySQL 服务器的模式。
|
properties.dataEncryption
|
DataEncryption
|
CMK 的数据加密。
|
properties.fullyQualifiedDomainName
|
string
|
服务器的完全限定域名。
|
properties.highAvailability
|
HighAvailability
|
服务器的高可用性相关属性。
|
properties.importSourceProperties
|
ImportSourceProperties
|
用于从存储导入的源属性。
|
properties.maintenanceWindow
|
MaintenanceWindow
|
服务器的维护时段。
|
properties.network
|
Network
|
服务器的网络相关属性。
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
服务器的 PrivateEndpointConnections 相关属性。
|
properties.replicaCapacity
|
integer
|
主服务器可以具有的最大副本数。
|
properties.replicationRole
|
ReplicationRole
|
复制角色。
|
properties.restorePointInTime
|
string
|
还原点创建时间 (ISO8601 格式) ,指定要从其还原的时间。
|
properties.sourceServerResourceId
|
string
|
源 MySQL 服务器 ID。
|
properties.state
|
ServerState
|
服务器的状态。
|
properties.storage
|
Storage
|
服务器的存储相关属性。
|
properties.version
|
ServerVersion
|
服务器版本。
|
sku
|
MySQLServerSku
|
服务器的 SKU (定价层) 。
|
systemData
|
systemData
|
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。
|
tags
|
object
|
资源标记。
|
type
|
string
|
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”
|
ServerSkuTier
特定 SKU 的层,例如 GeneralPurpose。
名称 |
类型 |
说明 |
Burstable
|
string
|
|
GeneralPurpose
|
string
|
|
MemoryOptimized
|
string
|
|
ServerState
服务器的状态。
名称 |
类型 |
说明 |
Disabled
|
string
|
|
Dropping
|
string
|
|
Ready
|
string
|
|
Starting
|
string
|
|
Stopped
|
string
|
|
Stopping
|
string
|
|
Updating
|
string
|
|
ServerVersion
服务器的版本。
名称 |
类型 |
说明 |
5.7
|
string
|
|
8.0.21
|
string
|
|
Storage
服务器的存储配置文件属性
名称 |
类型 |
默认值 |
说明 |
autoGrow
|
EnableStatusEnum
|
Disabled
|
启用存储自动增长与否。
|
autoIoScaling
|
EnableStatusEnum
|
Enabled
|
是否启用 IO 自动缩放。
|
iops
|
integer
|
|
服务器的存储 IOPS。
|
logOnDisk
|
EnableStatusEnum
|
Disabled
|
是否启用登录磁盘。
|
storageSizeGB
|
integer
|
|
服务器允许的最大存储大小。
|
storageSku
|
string
|
|
服务器存储的 SKU 名称。
|
systemData
与资源的创建和上次修改相关的元数据。
名称 |
类型 |
说明 |
createdAt
|
string
|
资源创建时间戳 (UTC) 。
|
createdBy
|
string
|
创建资源的标识。
|
createdByType
|
createdByType
|
创建资源的标识类型。
|
lastModifiedAt
|
string
|
资源上次修改的时间戳 (UTC)
|
lastModifiedBy
|
string
|
上次修改资源的标识。
|
lastModifiedByType
|
createdByType
|
上次修改资源的标识类型。
|