Databases - Create Or Update
建立新的資料庫或更新現有資料庫。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}?api-version=2024-12-30
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
database
|
path | True |
string |
資料庫的名稱。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
資源群組的名稱。 名稱不區分大小寫。 |
|
server
|
path | True |
string minLength: 1maxLength: 63 pattern: ^[a-z0-9][-a-z0-9]*(? |
伺服器的名稱。 |
|
subscription
|
path | True |
string (uuid) |
目標訂用帳戶的標識碼。 此值必須是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
用於此作業的 API 版本。 |
要求本文
| 名稱 | 類型 | Description |
|---|---|---|
| properties.charset |
string |
資料庫的字元集。 |
| properties.collation |
string |
資料庫的定序。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
資源 'Database' 更新作業成功 |
|
| 201 Created |
資源 'Database' 建立作業成功 標題
|
|
| 202 Accepted |
已接受資源作業。 標題
|
|
| Other Status Codes |
未預期的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
| 名稱 | Description |
|---|---|
| user_impersonation | 模擬您的用戶帳戶 |
範例
Create a database
範例要求
範例回覆
{
"name": "db1",
"type": "Microsoft.DBforMySQL/flexibleServers/databases",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db1",
"properties": {
"charset": "utf8",
"collation": "utf8_general_ci"
}
}
{
"name": "db1",
"type": "Microsoft.DBforMySQL/flexibleServers/databases",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db1",
"properties": {
"charset": "utf8",
"collation": "utf8_general_ci"
}
}
定義
| 名稱 | Description |
|---|---|
|
created |
建立資源的身分識別類型。 |
| Database |
表示資料庫。 |
|
Error |
資源管理錯誤其他資訊。 |
|
Error |
錯誤詳細數據。 |
|
Error |
錯誤回應 |
|
system |
與建立和上次修改資源相關的元數據。 |
createdByType
建立資源的身分識別類型。
| 值 | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
Database
表示資料庫。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string (arm-id) |
資源的完整資源標識碼。 例如 “/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| name |
string |
資源的名稱 |
| properties.charset |
string |
資料庫的字元集。 |
| properties.collation |
string |
資料庫的定序。 |
| systemData |
包含 createdBy 和 modifiedBy 資訊的 Azure Resource Manager 中繼資料。 |
|
| type |
string |
資源的類型。 例如「Microsoft.Compute/virtualMachines」或「Microsoft.Storage/storageAccounts」 |
ErrorAdditionalInfo
資源管理錯誤其他資訊。
| 名稱 | 類型 | Description |
|---|---|---|
| info |
object |
其他資訊。 |
| type |
string |
其他信息類型。 |
ErrorDetail
錯誤詳細數據。
| 名稱 | 類型 | Description |
|---|---|---|
| additionalInfo |
錯誤其他資訊。 |
|
| code |
string |
錯誤碼。 |
| details |
錯誤詳細數據。 |
|
| message |
string |
錯誤訊息。 |
| target |
string |
錯誤目標。 |
ErrorResponse
錯誤回應
| 名稱 | 類型 | Description |
|---|---|---|
| error |
error 物件。 |
systemData
與建立和上次修改資源相關的元數據。
| 名稱 | 類型 | Description |
|---|---|---|
| createdAt |
string (date-time) |
資源建立的時間戳(UTC)。 |
| createdBy |
string |
建立資源的身分識別。 |
| createdByType |
建立資源的身分識別類型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的資源時間戳 (UTC) |
| lastModifiedBy |
string |
上次修改資源的身分識別。 |
| lastModifiedByType |
上次修改資源的身分識別類型。 |