Atualiza um agente de trabalho.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}?api-version=2023-08-01
Parâmetros de URI
| Nome |
Em |
Obrigatório |
Tipo |
Description |
|
jobAgentName
|
path |
True
|
string
|
O nome do agente de trabalho a ser atualizado.
|
|
resourceGroupName
|
path |
True
|
string
|
O nome do grupo de recursos que contém o recurso. Você pode obter esse valor na API do Azure Resource Manager ou no portal.
|
|
serverName
|
path |
True
|
string
|
O nome do servidor.
|
|
subscriptionId
|
path |
True
|
string
|
A ID da assinatura que identifica uma assinatura do Azure.
|
|
api-version
|
query |
True
|
string
|
A versão da API a ser usada para a solicitação.
|
Corpo da solicitação
| Nome |
Tipo |
Description |
|
identity
|
JobAgentIdentity
|
Identidade gerenciada atribuída ao agente de trabalho
|
|
sku
|
Sku
|
O nome e a camada do SKU.
|
|
tags
|
object
|
Marcas de recurso.
|
Respostas
| Nome |
Tipo |
Description |
|
200 OK
|
JobAgent
|
Atualizou com êxito o agente de trabalho.
|
|
202 Accepted
|
|
Aceitado
Cabeçalhos
Location: string
|
|
Other Status Codes
|
ErrorResponse
|
Respostas de erro: ***
400 ManagedInstanceStoppingOrStopped – Operação conflitante enviada enquanto a instância está no estado de parada/parada
400 ManagedInstanceStarting – Operação conflitante enviada enquanto a instância está no estado inicial
400 InvalidResourceRequestBody - As propriedades de recurso ou recurso no corpo da solicitação estão vazias ou inválidas.
400 MissingIdentityType – especifique o tipo de identidade.
400 MultipleIdentitiesOnJobAgent – especifique apenas uma identidade gerenciada pelo usuário por agente de trabalho.
400 InvalidIdentityTenantId – tenantId não pode ser especificado em uma solicitação de criação ou atualização.
400 InvalidIdentityType – especifique apenas os tipos de identidade "None" ou "UserAssigned".
400 SkuMismatchingNameCapacity – a capacidade de SKU fornecida não corresponde ao nome de SKU fornecido.
400 ElasticJobAgentEditionUnsupported – O SLO determinado não tem suporte para agente de trabalho. Tente novamente com o SLO com suporte.
400 ElasticJobAgentObjectiveAssignmentInProgress - A atribuição SLO para o agente de trabalho elástico '{0}' está em andamento no momento. Tente novamente a operação mais tarde.
400 ElasticJobAgentEditionUnsupported – O SLO determinado não tem suporte para agente de trabalho. Tente novamente com o SLO com suporte.
400 ElasticJobsNotSupportedOnAutoPauseEnabledDatabase – O banco de dados sem servidor habilitado para pausa automática não tem suporte como um banco de dados de Trabalhos Elásticos porque o agente de trabalho impediria que esse banco de dados pausasse. Você pode desabilitar a pausa automática neste banco de dados sem servidor ou excluir o agente de trabalho que está usando esse banco de dados. Veja aqui mais detalhes: https://docs.microsoft.com/azure/azure-sql/database/serverless-tier-overview#auto-pausing
404 ServerNotInSubscriptionResourceGroup – O servidor especificado não existe no grupo de recursos e na assinatura especificados.
404 SubscriptionDoesNotHaveServer – O servidor solicitado não foi encontrado
404 JobAgentNotFound – O agente de trabalho especificado não existe no servidor lógico especificado.
404 PropertyChangeUnsupported - A propriedade não pode ser modificada.
404 OperationIdNotFound – A operação com id não existe.
409 ServerDisabled – O servidor está desabilitado.
409 ElasticJobAgentOperationUnavailable – A operação '{0}' está bloqueada para o agente de trabalho elástico '{1}' porque {2}
409 CannotCancelOperation – A operação de gerenciamento está em um estado que não pode ser cancelado.
409 OperationCancelled – A operação foi cancelada pelo usuário.
409 OperationInterrupted – A operação no recurso não pôde ser concluída porque foi interrompida por outra operação no mesmo recurso.
429 SubscriptionTooManyCreateUpdateRequests – Solicitações além do máximo de solicitações que podem ser processadas por recursos disponíveis.
429 SubscriptionTooManyRequests – Solicitações além das solicitações máximas que podem ser processadas por recursos disponíveis.
500 OperationTimedOut – A operação atingiu o tempo limite e foi revertida automaticamente. Tente novamente a operação.
503 TooManyRequests – Solicitações além das solicitações máximas que podem ser processadas por recursos disponíveis.
|
Exemplos
Update a job agent's identity.
Solicitação de exemplo
PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1?api-version=2023-08-01
{
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {}
}
}
}
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/stable/2023-08-01/examples/UpdateJobAgentWithIdentity.json
// this example is just showing the usage of "JobAgents_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerJobAgentResource created on azure
// for more information of creating SqlServerJobAgentResource, please refer to the document of SqlServerJobAgentResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "group1";
string serverName = "server1";
string jobAgentName = "agent1";
ResourceIdentifier sqlServerJobAgentResourceId = SqlServerJobAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName);
SqlServerJobAgentResource sqlServerJobAgent = client.GetSqlServerJobAgentResource(sqlServerJobAgentResourceId);
// invoke the operation
SqlServerJobAgentPatch patch = new SqlServerJobAgentPatch
{
Identity = new JobAgentIdentity(JobAgentIdentityType.UserAssigned)
{
UserAssignedIdentities =
{
["/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"] = new UserAssignedIdentity()
},
},
};
ArmOperation<SqlServerJobAgentResource> lro = await sqlServerJobAgent.UpdateAsync(WaitUntil.Completed, patch);
SqlServerJobAgentResource 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
SqlServerJobAgentData 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
Resposta de exemplo
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
"name": "agent1",
"type": "Microsoft.Sql/servers/jobAgents",
"location": "southeastasia",
"properties": {
"databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {
"clientId": "e09c8507-0000-0000-97e2-18c5beec59dc",
"principalId": "0c29d9b7-0ae2-4014-96ea-faf8e0cf2bc7"
}
}
}
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/southeastasia/jobAgentOperationResults/00000000-1111-2222-3333-444444444444?api-version=2017-03-01-preview
Update a job agent's sku.
Solicitação de exemplo
PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1?api-version=2023-08-01
{
"sku": {
"name": "JA200"
}
}
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/stable/2023-08-01/examples/UpdateJobAgentWithSku.json
// this example is just showing the usage of "JobAgents_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerJobAgentResource created on azure
// for more information of creating SqlServerJobAgentResource, please refer to the document of SqlServerJobAgentResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "group1";
string serverName = "server1";
string jobAgentName = "agent1";
ResourceIdentifier sqlServerJobAgentResourceId = SqlServerJobAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName);
SqlServerJobAgentResource sqlServerJobAgent = client.GetSqlServerJobAgentResource(sqlServerJobAgentResourceId);
// invoke the operation
SqlServerJobAgentPatch patch = new SqlServerJobAgentPatch
{
Sku = new SqlSku("JA200"),
};
ArmOperation<SqlServerJobAgentResource> lro = await sqlServerJobAgent.UpdateAsync(WaitUntil.Completed, patch);
SqlServerJobAgentResource 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
SqlServerJobAgentData 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
Resposta de exemplo
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
"name": "agent1",
"type": "Microsoft.Sql/servers/jobAgents",
"location": "southeastasia",
"properties": {
"databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
},
"sku": {
"name": "JA200",
"capacity": 200
}
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/southeastasia/jobAgentOperationResults/00000000-1111-2222-3333-444444444444?api-version=2017-03-01-preview
Solicitação de exemplo
PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1?api-version=2023-08-01
{
"tags": {
"mytag1": "myvalue1"
}
}
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/stable/2023-08-01/examples/UpdateJobAgent.json
// this example is just showing the usage of "JobAgents_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerJobAgentResource created on azure
// for more information of creating SqlServerJobAgentResource, please refer to the document of SqlServerJobAgentResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "group1";
string serverName = "server1";
string jobAgentName = "agent1";
ResourceIdentifier sqlServerJobAgentResourceId = SqlServerJobAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName);
SqlServerJobAgentResource sqlServerJobAgent = client.GetSqlServerJobAgentResource(sqlServerJobAgentResourceId);
// invoke the operation
SqlServerJobAgentPatch patch = new SqlServerJobAgentPatch
{
Tags =
{
["mytag1"] = "myvalue1"
},
};
ArmOperation<SqlServerJobAgentResource> lro = await sqlServerJobAgent.UpdateAsync(WaitUntil.Completed, patch);
SqlServerJobAgentResource 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
SqlServerJobAgentData 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
Resposta de exemplo
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
"name": "agent1",
"type": "Microsoft.Sql/servers/jobAgents",
"location": "southeastasia",
"properties": {
"databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
},
"tags": {
"mytag1": "myvalue1"
}
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/southeastasia/jobAgentOperationResults/00000000-1111-2222-3333-444444444444?api-version=2017-03-01-preview
Definições
ErrorAdditionalInfo
Objeto
As informações adicionais do erro de gerenciamento de recursos.
| Nome |
Tipo |
Description |
|
info
|
object
|
As informações adicionais.
|
|
type
|
string
|
O tipo de informação adicional.
|
ErrorDetail
Objeto
O detalhe do erro.
| Nome |
Tipo |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
As informações adicionais do erro.
|
|
code
|
string
|
O código de erro.
|
|
details
|
ErrorDetail[]
|
Os detalhes do erro.
|
|
message
|
string
|
A mensagem de erro.
|
|
target
|
string
|
O destino do erro.
|
ErrorResponse
Objeto
Resposta de erro
| Nome |
Tipo |
Description |
|
error
|
ErrorDetail
|
O objeto de erro.
|
JobAgent
Objeto
Um agente de trabalho do SQL do Azure.
| Nome |
Tipo |
Description |
|
id
|
string
|
ID do recurso.
|
|
identity
|
JobAgentIdentity
|
A identidade do agente do trabalho.
|
|
location
|
string
|
Local do recurso.
|
|
name
|
string
|
Nome do recurso.
|
|
properties.databaseId
|
string
(arm-id)
|
ID do recurso do banco de dados no qual armazenar metadados de trabalho.
|
|
properties.state
|
JobAgentState
|
O estado do agente do trabalho.
|
|
sku
|
Sku
|
O nome e a camada do SKU.
|
|
tags
|
object
|
Marcas de recurso.
|
|
type
|
string
|
Tipo de recurso.
|
JobAgentIdentity
Objeto
Configuração de identidade do Azure Active Directory para um recurso.
| Nome |
Tipo |
Description |
|
tenantId
|
string
(uuid)
|
A ID do locatário de identidade do agente de trabalho
|
|
type
|
JobAgentIdentityType
|
O tipo de identidade do agente de trabalho
|
|
userAssignedIdentities
|
<string,
JobAgentUserAssignedIdentity>
|
As IDs de recurso das identidades atribuídas pelo usuário a serem usadas
|
JobAgentIdentityType
Enumeração
O tipo de identidade do agente de trabalho
| Valor |
Description |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
|
SystemAssignedUserAssigned
|
|
JobAgentState
Enumeração
O estado do agente do trabalho.
| Valor |
Description |
|
Creating
|
|
|
Ready
|
|
|
Updating
|
|
|
Deleting
|
|
|
Disabled
|
|
JobAgentUpdate
Objeto
Uma atualização para um agente de trabalho do SQL do Azure.
| Nome |
Tipo |
Description |
|
identity
|
JobAgentIdentity
|
Identidade gerenciada atribuída ao agente de trabalho
|
|
sku
|
Sku
|
O nome e a camada do SKU.
|
|
tags
|
object
|
Marcas de recurso.
|
JobAgentUserAssignedIdentity
Objeto
Configuração de identidade do Azure Active Directory para um recurso.
| Nome |
Tipo |
Description |
|
clientId
|
string
(uuid)
|
A ID do cliente do Azure Active Directory.
|
|
principalId
|
string
(uuid)
|
A ID da entidade de segurança do Azure Active Directory.
|
Sku
Objeto
Um SKU de recurso do ARM.
| Nome |
Tipo |
Description |
|
capacity
|
integer
(int32)
|
Capacidade da SKU específica.
|
|
family
|
string
|
Se o serviço tiver diferentes gerações de hardware, para a mesma SKU, isso poderá ser capturado aqui.
|
|
name
|
string
|
O nome da SKU, normalmente, uma letra + código de número, por exemplo, P3.
|
|
size
|
string
|
Tamanho da SKU específica
|
|
tier
|
string
|
A camada ou edição da SKU específica, por exemplo, Basic, Premium.
|