Aktualizuje agenta zadań.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}?api-version=2023-08-01
Parametry identyfikatora URI
| Nazwa |
W |
Wymagane |
Typ |
Opis |
|
jobAgentName
|
path |
True
|
string
|
Nazwa agenta zadania, który ma zostać zaktualizowany.
|
|
resourceGroupName
|
path |
True
|
string
|
Nazwa grupy zasobów zawierającej zasób. Tę wartość można uzyskać z interfejsu API usługi Azure Resource Manager lub portalu.
|
|
serverName
|
path |
True
|
string
|
Nazwa serwera.
|
|
subscriptionId
|
path |
True
|
string
|
Identyfikator subskrypcji identyfikujący subskrypcję platformy Azure.
|
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API do użycia dla żądania.
|
Treść żądania
| Nazwa |
Typ |
Opis |
|
identity
|
JobAgentIdentity
|
Tożsamość zarządzana przypisana do agenta zadań
|
|
sku
|
Sku
|
Nazwa i warstwa jednostki SKU.
|
|
tags
|
object
|
Tagi zasobów.
|
Odpowiedzi
| Nazwa |
Typ |
Opis |
|
200 OK
|
JobAgent
|
Pomyślnie zaktualizowano agenta zadania.
|
|
202 Accepted
|
|
Akceptowane
Nagłówki
Location: string
|
|
Other Status Codes
|
ErrorResponse
|
Odpowiedzi na błędy: ***
400 ManagedInstanceStoppingOrStopped — operacja powodująca konflikt przesłana, gdy wystąpienie jest w stanie zatrzymania/zatrzymania
400 ManagedInstanceStarting — operacja powodująca konflikt przesłana, gdy wystąpienie jest w stanie początkowym
400 InvalidResourceRequestBody — właściwości zasobu lub zasobu w treści żądania są puste lub nieprawidłowe.
400 MissingIdentityType — określ typ tożsamości.
400 MultipleIdentitiesOnJobAgent — określ tylko jedną tożsamość zarządzaną przez użytkownika na agenta zadania.
400 InvalidIdentityTenantId — identyfikator dzierżawy nie może być określony w żądaniu tworzenia lub aktualizacji.
400 InvalidIdentityType — określ tylko typy tożsamości "Brak" lub "UserAssigned".
400 SkuMismatchingNameCapacity — podana pojemność jednostki SKU nie jest zgodna z podaną nazwą jednostki SKU.
400 ElasticJobAgentEditionUnsupported — dany cel slo nie jest obsługiwany dla agenta zadań. Ponów próbę przy użyciu obsługiwanego celu slo.
400 ElasticJobAgentObjectiveAssignmentInProgress — przypisanie CELU dla agenta zadań elastycznych "{0}" jest obecnie w toku. Ponów próbę wykonania operacji później.
400 ElasticJobAgentEditionUnsupported — dany cel slo nie jest obsługiwany dla agenta zadań. Ponów próbę przy użyciu obsługiwanego celu slo.
400 ElasticJobsNotSupportedOnAutoPauseEnabledDatabase — automatyczna wstrzymywanie bezserwerowej bazy danych nie jest obsługiwana jako baza danych zadań elastycznych, ponieważ agent zadań uniemożliwiłby wstrzymanie tej bazy danych. Możesz wyłączyć automatyczne wstrzymywanie w tej bezserwerowej bazie danych lub usunąć agenta zadania korzystającego z tej bazy danych. Aby uzyskać więcej informacji, zobacz tutaj: https://docs.microsoft.com/azure/azure-sql/database/serverless-tier-overview#auto-pausing
404 ServerNotInSubscriptionResourceGroup — określony serwer nie istnieje w określonej grupie zasobów i subskrypcji.
404 SubscriptionDoesNotHaveServer — nie znaleziono żądanego serwera
404 JobAgentNotFound — określony agent zadania nie istnieje na określonym serwerze logicznym.
404 PropertyChangeUnsupported — nie można zmodyfikować właściwości.
404 OperationIdNotFound — operacja o identyfikatorze nie istnieje.
409 ServerDisabled — serwer jest wyłączony.
409 ElasticJobAgentOperationUnavailable — operacja "{0}" jest zablokowana dla agenta zadań elastycznych "{1}", ponieważ {2}
409 CannotCancelOperation — operacja zarządzania jest w stanie, którego nie można anulować.
409 OperationCancelled — operacja została anulowana przez użytkownika.
409 Operacja przerwana — nie można ukończyć operacji na zasobie, ponieważ została przerwana przez inną operację na tym samym zasobie.
429 SubscriptionTooManyCreateUpdateRequests — żądania wykraczające poza maksymalne żądania, które mogą być przetwarzane przez dostępne zasoby.
429 SubscriptionTooManyRequests — żądania wykraczające poza maksymalną liczbę żądań, które mogą być przetwarzane przez dostępne zasoby.
500 OperationTimedOut — upłynął limit czasu operacji i automatycznie wycofano. Ponów próbę wykonania operacji.
503 TooManyRequests — żądania wykraczające poza maksymalne żądania, które mogą być przetwarzane przez dostępne zasoby.
|
Przykłady
Update a job agent's identity.
Przykładowe żądanie
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
Przykładowa odpowiedź
{
"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.
Przykładowe żądanie
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
Przykładowa odpowiedź
{
"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
Przykładowe żądanie
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
Przykładowa odpowiedź
{
"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
Definicje
ErrorAdditionalInfo
Objekt
Dodatkowe informacje o błędzie zarządzania zasobami.
| Nazwa |
Typ |
Opis |
|
info
|
object
|
Dodatkowe informacje.
|
|
type
|
string
|
Dodatkowy typ informacji.
|
ErrorDetail
Objekt
Szczegóły błędu.
| Nazwa |
Typ |
Opis |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
Dodatkowe informacje o błędzie.
|
|
code
|
string
|
Kod błędu.
|
|
details
|
ErrorDetail[]
|
Szczegóły błędu.
|
|
message
|
string
|
Komunikat o błędzie.
|
|
target
|
string
|
Element docelowy błędu.
|
ErrorResponse
Objekt
Odpowiedź na błąd
JobAgent
Objekt
Agent zadań usługi Azure SQL.
| Nazwa |
Typ |
Opis |
|
id
|
string
|
Identyfikator zasobu.
|
|
identity
|
JobAgentIdentity
|
Tożsamość agenta zadania.
|
|
location
|
string
|
Lokalizacja zasobu.
|
|
name
|
string
|
Nazwa zasobu.
|
|
properties.databaseId
|
string
(arm-id)
|
Identyfikator zasobu bazy danych do przechowywania metadanych zadania.
|
|
properties.state
|
JobAgentState
|
Stan agenta zadania.
|
|
sku
|
Sku
|
Nazwa i warstwa jednostki SKU.
|
|
tags
|
object
|
Tagi zasobów.
|
|
type
|
string
|
Typ zasobu.
|
JobAgentIdentity
Objekt
Konfiguracja tożsamości usługi Azure Active Directory dla zasobu.
| Nazwa |
Typ |
Opis |
|
tenantId
|
string
(uuid)
|
Identyfikator dzierżawy tożsamości agenta zadania
|
|
type
|
JobAgentIdentityType
|
Typ tożsamości agenta zadania
|
|
userAssignedIdentities
|
<string,
JobAgentUserAssignedIdentity>
|
Identyfikatory zasobów tożsamości przypisanych przez użytkownika do użycia
|
JobAgentIdentityType
Wyliczanie
Typ tożsamości agenta zadania
| Wartość |
Opis |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
|
SystemAssignedUserAssigned
|
|
JobAgentState
Wyliczanie
Stan agenta zadania.
| Wartość |
Opis |
|
Creating
|
|
|
Ready
|
|
|
Updating
|
|
|
Deleting
|
|
|
Disabled
|
|
JobAgentUpdate
Objekt
Aktualizacja agenta zadań usługi Azure SQL.
| Nazwa |
Typ |
Opis |
|
identity
|
JobAgentIdentity
|
Tożsamość zarządzana przypisana do agenta zadań
|
|
sku
|
Sku
|
Nazwa i warstwa jednostki SKU.
|
|
tags
|
object
|
Tagi zasobów.
|
JobAgentUserAssignedIdentity
Objekt
Konfiguracja tożsamości usługi Azure Active Directory dla zasobu.
| Nazwa |
Typ |
Opis |
|
clientId
|
string
(uuid)
|
Identyfikator klienta usługi Azure Active Directory.
|
|
principalId
|
string
(uuid)
|
Identyfikator podmiotu zabezpieczeń usługi Azure Active Directory.
|
Sku
Objekt
Jednostka SKU zasobu usługi ARM.
| Nazwa |
Typ |
Opis |
|
capacity
|
integer
(int32)
|
Pojemność określonej jednostki SKU.
|
|
family
|
string
|
Jeśli usługa ma różne generacje sprzętu, dla tej samej jednostki SKU, można je przechwycić tutaj.
|
|
name
|
string
|
Nazwa jednostki SKU, zazwyczaj, litera + kod liczbowy, np. P3.
|
|
size
|
string
|
Rozmiar konkretnej jednostki SKU
|
|
tier
|
string
|
Warstwa lub wersja konkretnej jednostki SKU, np. Podstawowa, Premium.
|