Dsc Configuration - Create Or Update
创建由配置名称标识的配置。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}?api-version=2024-10-23
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
automation
|
path | True |
string |
自动化帐户的名称。 |
|
configuration
|
path | True |
string |
用于配置的创建或更新参数。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 pattern: ^[-\w\._]+$ |
Azure 资源组的名称。 |
|
subscription
|
path | True |
string |
获取唯一标识Microsoft Azure 订阅的订阅凭据。 此订阅 ID 是每个服务调用的 URI 的一部分。 |
|
api-version
|
query | True |
string |
客户端 API 版本。 |
请求正文
Media Types: "application/json", "text/plain; charset=utf-8"
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| properties.source | True |
获取或设置源。 |
|
| location |
string |
获取或设置资源的位置。 |
|
| name |
string |
获取或设置资源的名称。 |
|
| properties.description |
string |
获取或设置配置的说明。 |
|
| properties.logProgress |
boolean |
获取或设置进度日志选项。 |
|
| properties.logVerbose |
boolean |
获取或设置详细日志选项。 |
|
| properties.parameters |
<string,
Dsc |
获取或设置配置参数。 |
|
| tags |
object |
获取或设置附加到资源的标记。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
好的 Media Types: "application/json", "text/plain; charset=utf-8" |
|
| 201 Created |
已创建 Media Types: "application/json", "text/plain; charset=utf-8" |
|
| Other Status Codes |
描述操作失败原因的自动化错误响应。 Media Types: "application/json", "text/plain; charset=utf-8" |
安全性
azure_auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
Create or Update Configuration
示例请求
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount18/configurations/SetupServer?api-version=2024-10-23
{
"properties": {
"source": {
"hash": {
"algorithm": "sha256",
"value": "A9E5DB56BA21513F61E0B3868816FDC6D4DF5131F5617D7FF0D769674BD5072F"
},
"type": "embeddedContent",
"value": "Configuration SetupServer {\r\n Node localhost {\r\n WindowsFeature IIS {\r\n Name = \"Web-Server\";\r\n Ensure = \"Present\"\r\n }\r\n }\r\n}"
},
"description": "sample configuration"
},
"name": "SetupServer",
"location": "East US 2"
}
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/configurations/SetupServer",
"name": "SetupServer",
"type": "Microsoft.Automation/AutomationAccounts/Configurations",
"location": "East US 2",
"tags": {},
"etag": null,
"properties": {
"provisioningState": "Succeeded",
"jobCount": 0,
"parameters": {},
"description": "sample configuration",
"state": null,
"creationTime": "0001-01-01T00:00:00+00:00",
"lastModifiedTime": "0001-01-01T00:00:00+00:00",
"logVerbose": false
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/configurations/SetupServer",
"name": "SetupServer",
"type": "Microsoft.Automation/AutomationAccounts/Configurations",
"location": "East US 2",
"tags": {},
"etag": "\"636263396635600000\"",
"properties": {
"provisioningState": "Succeeded",
"jobCount": 0,
"parameters": {},
"description": "sample configuration",
"state": "Published",
"creationTime": "2017-03-28T23:14:23.56+00:00",
"lastModifiedTime": "2017-03-28T23:14:23.56+00:00",
"logVerbose": false
}
}
定义
| 名称 | 说明 |
|---|---|
|
Content |
Runbook 属性类型的定义。 |
|
Content |
内容源的定义。 |
|
Content |
获取或设置内容源类型。 |
|
created |
创建资源的标识的类型。 |
|
Dsc |
配置类型的定义。 |
|
Dsc |
提供给创建或更新配置作的参数。 |
|
Dsc |
配置参数类型的定义。 |
|
Dsc |
获取或设置配置的预配状态。 |
|
Dsc |
获取或设置配置的状态。 |
|
Error |
操作失败的错误响应 |
|
system |
与创建和上次修改资源相关的元数据。 |
ContentHash
Runbook 属性类型的定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| algorithm |
string |
获取或设置用于对内容进行哈希处理的内容哈希算法。 |
| value |
string |
获取或设置内容的预期哈希值。 |
ContentSource
内容源的定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| hash |
获取或设置哈希。 |
|
| type |
获取或设置内容源类型。 |
|
| value |
string |
获取或设置内容的值。 这基于内容源类型。 |
| version |
string |
获取或设置内容的版本。 |
ContentSourceType
获取或设置内容源类型。
| 值 | 说明 |
|---|---|
| embeddedContent | |
| uri |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
DscConfiguration
配置类型的定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| etag |
string |
获取或设置资源的 etag。 |
| id |
string (arm-id) |
资源的完全限定的资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| location |
string |
资源所在的地理位置 |
| name |
string |
资源的名称 |
| properties.creationTime |
string (date-time) |
获取或设置创建时间。 |
| properties.description |
string |
获取或设置说明。 |
| properties.jobCount |
integer (int32) |
获取或设置配置的作业计数。 |
| properties.lastModifiedTime |
string (date-time) |
获取或设置上次修改时间。 |
| properties.logVerbose |
boolean |
获取或设置详细日志选项。 |
| properties.nodeConfigurationCount |
integer |
获取已编译的节点配置数。 |
| properties.parameters |
<string,
Dsc |
获取或设置配置参数。 |
| properties.provisioningState |
获取或设置配置的预配状态。 |
|
| properties.source |
获取或设置源。 |
|
| properties.state |
获取或设置配置的状态。 |
|
| systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
| tags |
object |
资源标记。 |
| type |
string |
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
DscConfigurationCreateOrUpdateParameters
提供给创建或更新配置作的参数。
| 名称 | 类型 | 说明 |
|---|---|---|
| location |
string |
获取或设置资源的位置。 |
| name |
string |
获取或设置资源的名称。 |
| properties.description |
string |
获取或设置配置的说明。 |
| properties.logProgress |
boolean |
获取或设置进度日志选项。 |
| properties.logVerbose |
boolean |
获取或设置详细日志选项。 |
| properties.parameters |
<string,
Dsc |
获取或设置配置参数。 |
| properties.source |
获取或设置源。 |
|
| tags |
object |
获取或设置附加到资源的标记。 |
DscConfigurationParameter
配置参数类型的定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| defaultValue |
string |
获取或设置参数的默认值。 |
| isMandatory |
boolean |
获取或设置一个布尔值,该值指示参数是否是必需的。 |
| position |
integer (int32) |
获取或设置参数的位置。 |
| type |
string |
获取或设置参数的类型。 |
DscConfigurationProvisioningState
获取或设置配置的预配状态。
| 值 | 说明 |
|---|---|
| Succeeded |
DscConfigurationState
获取或设置配置的状态。
| 值 | 说明 |
|---|---|
| New | |
| Edit | |
| Published |
ErrorResponse
操作失败的错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码 |
| message |
string |
指示操作失败的原因的错误消息。 |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |