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 do URI
| Name |
Em |
Necessá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 da API do Azure Resource Manager ou do portal.
|
|
serverName
|
path |
True
|
string
|
O nome do servidor.
|
|
subscriptionId
|
path |
True
|
string
|
A ID de 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 do Pedido
| Name |
Tipo |
Description |
|
identity
|
JobAgentIdentity
|
Identidade gerenciada atribuída ao agente de trabalho
|
|
sku
|
Sku
|
O nome e a camada da SKU.
|
|
tags
|
object
|
Tags de recursos.
|
Respostas
| Name |
Tipo |
Description |
|
200 OK
|
JobAgent
|
Atualizado com êxito o agente de trabalho.
|
|
202 Accepted
|
|
Aceito
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 do recurso ou do recurso no corpo da solicitação estão vazias ou são 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 fornecido não é suportado para o agente de trabalho. Tente novamente com o SLO suportado.
400 ElasticJobAgentObjectiveAssignmentInProgress - A atribuição SLO para o agente de trabalho elástico '{0}' está atualmente em andamento. Tente novamente a operação mais tarde.
400 ElasticJobAgentEditionUnsupported - O SLO fornecido não é suportado para o agente de trabalho. Tente novamente com o SLO suportado.
400 ElasticJobsNotSupportedOnAutoPauseEnabledDatabase - O banco de dados sem servidor habilitado para pausa automática não é suportado como um banco de dados Elastic Jobs porque o agente de trabalho impediria que esse banco de dados fosse pausado. 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á desativado.
409 ElasticJobAgentOperationUnavailable - A operação '{0}' está bloqueada para o Elastic Job Agent '{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 pelos recursos disponíveis.
429 SubscriptionTooManyRequests - Solicitações além do máximo de solicitações que podem ser processadas pelos recursos disponíveis.
500 OperationTimedOut - A operação atingiu o tempo limite e foi revertida automaticamente. Por favor, tente novamente a operação.
503 TooManyRequests - Solicitações além do máximo de solicitações que podem ser processadas pelos recursos disponíveis.
|
Exemplos
Update a job agent's identity.
Pedido de amostra
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 da amostra
{
"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.
Pedido de amostra
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 da amostra
{
"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
Pedido de amostra
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 da amostra
{
"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
Object
O erro de gerenciamento de recursos informações adicionais.
| Name |
Tipo |
Description |
|
info
|
object
|
As informações adicionais.
|
|
type
|
string
|
O tipo de informação adicional.
|
ErrorDetail
Object
O detalhe do erro.
| Name |
Tipo |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
O erro informações adicionais.
|
|
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
Object
Resposta de erro
| Name |
Tipo |
Description |
|
error
|
ErrorDetail
|
O objeto de erro.
|
JobAgent
Object
Um agente de trabalho SQL do Azure.
| Name |
Tipo |
Description |
|
id
|
string
|
ID do recurso.
|
|
identity
|
JobAgentIdentity
|
A identidade do agente de emprego.
|
|
location
|
string
|
Localização 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 de emprego.
|
|
sku
|
Sku
|
O nome e a camada da SKU.
|
|
tags
|
object
|
Tags de recursos.
|
|
type
|
string
|
Tipo de recurso.
|
JobAgentIdentity
Object
Configuração de identidade do Azure Ative Directory para um recurso.
| Name |
Tipo |
Description |
|
tenantId
|
string
(uuid)
|
O 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 ao 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 de emprego.
| Valor |
Description |
|
Creating
|
|
|
Ready
|
|
|
Updating
|
|
|
Deleting
|
|
|
Disabled
|
|
JobAgentUpdate
Object
Uma atualização para um agente de trabalho SQL do Azure.
| Name |
Tipo |
Description |
|
identity
|
JobAgentIdentity
|
Identidade gerenciada atribuída ao agente de trabalho
|
|
sku
|
Sku
|
O nome e a camada da SKU.
|
|
tags
|
object
|
Tags de recursos.
|
JobAgentUserAssignedIdentity
Object
Configuração de identidade do Azure Ative Directory para um recurso.
| Name |
Tipo |
Description |
|
clientId
|
string
(uuid)
|
A ID do cliente do Azure Ative Directory.
|
|
principalId
|
string
(uuid)
|
A ID principal do Azure Ative Directory.
|
Sku
Object
Um SKU de recurso ARM.
| Name |
Tipo |
Description |
|
capacity
|
integer
(int32)
|
Capacidade do SKU específico.
|
|
family
|
string
|
Se o serviço tiver diferentes gerações de hardware, para o mesmo SKU, isso pode ser capturado aqui.
|
|
name
|
string
|
O nome do SKU, normalmente, uma letra + código numérico, por exemplo, P3.
|
|
size
|
string
|
Tamanho do SKU específico
|
|
tier
|
string
|
O nível ou edição do SKU específico, por exemplo, Basic, Premium.
|