Partilhar via


CosmosDBServiceCollection.CreateOrUpdateAsync Método

Definição

Cria um serviço.

  • Caminho da Solicitação/assinaturas/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}
  • Operação IdService_Create
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.CosmosDB.CosmosDBServiceResource>> CreateOrUpdateAsync (Azure.WaitUntil waitUntil, string serviceName, Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceCreateOrUpdateContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.CosmosDB.CosmosDBServiceResource>>
override this.CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceCreateOrUpdateContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.CosmosDB.CosmosDBServiceResource>>
Public Overridable Function CreateOrUpdateAsync (waitUntil As WaitUntil, serviceName As String, content As CosmosDBServiceCreateOrUpdateContent, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of CosmosDBServiceResource))

Parâmetros

waitUntil
WaitUntil

Completed se o método deve aguardar para retornar até que a operação de execução prolongada seja concluída no serviço; Started se ele deve retornar depois de iniciar a operação. Para obter mais informações sobre operações de execução prolongada, consulte Exemplos de operação de Long-Running do Azure.Core.

serviceName
String

Nome do serviço do Cosmos DB.

content
CosmosDBServiceCreateOrUpdateContent

Os parâmetros de recurso de serviço.

cancellationToken
CancellationToken

O token de cancelamento a ser usado.

Retornos

Exceções

serviceName é uma cadeia de caracteres vazia e esperava-se que não estivesse vazia.

serviceName ou content é nulo.

Aplica-se a