Partilhar via


TableServiceClient class

Um TableServiceClient representa um Cliente para o serviço de Tabelas do Azure permitindo que você execute operações nas tabelas e nas entidades.

Construtores

TableServiceClient(string, NamedKeyCredential, TableServiceClientOptions)

Cria uma nova instância da classe TableServiceClient.

TableServiceClient(string, SASCredential, TableServiceClientOptions)

Cria uma nova instância da classe TableServiceClient.

TableServiceClient(string, TableServiceClientOptions)

Cria uma nova instância da classe TableServiceClient.

TableServiceClient(string, TokenCredential, TableServiceClientOptions)

Cria uma nova instância da classe TableServiceClient.

Propriedades

pipeline

Representa um pipeline para fazer uma solicitação HTTP para uma URL. Os pipelines podem ter várias políticas para gerenciar a manipulação de cada solicitação antes e depois de ela ser feita ao servidor.

url

URL da Conta de Tabela

Métodos

createTable(string, OperationOptions)

Cria uma nova tabela sob a conta fornecida.

deleteTable(string, OperationOptions)

A operação exclui permanentemente a tabela especificada.

fromConnectionString(string, TableServiceClientOptions)

Cria uma instância de TableServiceClient a partir da cadeia de conexão.

getProperties(OperationOptions)

Obtém as propriedades do serviço Tabela de uma conta, incluindo propriedades para as regras Analytics e CORS (Cross-Origin Resource Sharing).

getStatistics(OperationOptions)

Recupera estatísticas relacionadas à replicação para o serviço Tabela. Ele só está disponível no ponto de extremidade do local secundário quando a replicação com redundância geográfica de acesso de leitura está habilitada para a conta.

listTables(ListTableItemsOptions)

Tabelas de consultas sob a conta fornecida.

setProperties(TableServiceProperties, ServiceSetPropertiesOptionalParams)

Define propriedades para o ponto de extremidade do serviço Tabela de uma conta, incluindo propriedades para regras do Google Analytics e CORS (Cross-Origin Resource Sharing).

Detalhes do Construtor

TableServiceClient(string, NamedKeyCredential, TableServiceClientOptions)

Cria uma nova instância da classe TableServiceClient.

new TableServiceClient(url: string, credential: NamedKeyCredential, options?: TableServiceClientOptions)

Parâmetros

url

string

A URL da conta de serviço que é o destino da operação desejada., como "https://myaccount.table.core.windows.net".

credential
NamedKeyCredential

NomedKeyCredential | SASCredential usado para autenticar solicitações. Apenas suportado para nó

options
TableServiceClientOptions

Opções para configurar o pipeline HTTP.

Exemplo usando um nome/chave de conta:

import { AzureNamedKeyCredential, TableServiceClient } from "@azure/data-tables";

const account = "<account>";
const accountKey = "<accountkey>";

const credential = new AzureNamedKeyCredential(account, accountKey);
const serviceClient = new TableServiceClient(
  `https://${account}.table.core.windows.net`,
  credential,
);

TableServiceClient(string, SASCredential, TableServiceClientOptions)

Cria uma nova instância da classe TableServiceClient.

new TableServiceClient(url: string, credential: SASCredential, options?: TableServiceClientOptions)

Parâmetros

url

string

A URL da conta de serviço que é o destino da operação desejada., como "https://myaccount.table.core.windows.net".

credential
SASCredential

SASCredential usado para autenticar solicitações

options
TableServiceClientOptions

Opções para configurar o pipeline HTTP.

Exemplo usando um token SAS.

import { TableServiceClient, AzureSASCredential } from "@azure/data-tables";

const account = "<account name>";
const sas = "<service Shared Access Signature Token>";

const serviceClientWithSAS = new TableServiceClient(
  `https://${account}.table.core.windows.net`,
  new AzureSASCredential(sas),
);

TableServiceClient(string, TableServiceClientOptions)

Cria uma nova instância da classe TableServiceClient.

new TableServiceClient(url: string, options?: TableServiceClientOptions)

Parâmetros

url

string

A URL da conta de serviço que é o destino da operação desejada., como "https://myaccount.table.core.windows.net". Você pode acrescentar uma SAS, como "https://myaccount.table.core.windows.net?sasString".

options
TableServiceClientOptions

Opções para configurar o pipeline HTTP. Exemplo de acréscimo de um token SAS:

import { TableServiceClient } from "@azure/data-tables";

const account = "<account name>";
const sasToken = "<SAS token>";
const tableName = "<tableName>";

const serviceClientWithSASURL = new TableServiceClient(
  `https://${account}.table.core.windows.net?${sasToken}`,
);

TableServiceClient(string, TokenCredential, TableServiceClientOptions)

Cria uma nova instância da classe TableServiceClient.

new TableServiceClient(url: string, credential: TokenCredential, options?: TableServiceClientOptions)

Parâmetros

url

string

A URL da conta de serviço que é o destino da operação desejada., como "https://myaccount.table.core.windows.net".

credential
TokenCredential

Credencial do Azure Ative Directory usada para autenticar solicitações

options
TableServiceClientOptions

Opções para configurar o pipeline HTTP.

Exemplo usando uma credencial do Azure Ative Directory:

import { DefaultAzureCredential } from "@azure/identity";
import { TableServiceClient } from "@azure/data-tables";

const credential = new DefaultAzureCredential();
const account = "<account name>";

const clientWithAAD = new TableServiceClient(
  `https://${account}.table.core.windows.net`,
  credential,
);

Detalhes de Propriedade

pipeline

Representa um pipeline para fazer uma solicitação HTTP para uma URL. Os pipelines podem ter várias políticas para gerenciar a manipulação de cada solicitação antes e depois de ela ser feita ao servidor.

pipeline: Pipeline

Valor de Propriedade

url

URL da Conta de Tabela

url: string

Valor de Propriedade

string

Detalhes de Método

createTable(string, OperationOptions)

Cria uma nova tabela sob a conta fornecida.

function createTable(name: string, options?: OperationOptions): Promise<void>

Parâmetros

name

string

O nome da tabela.

options
OperationOptions

Os parâmetros de opções.

Devoluções

Promise<void>

deleteTable(string, OperationOptions)

A operação exclui permanentemente a tabela especificada.

function deleteTable(name: string, options?: OperationOptions): Promise<void>

Parâmetros

name

string

O nome da tabela.

options
OperationOptions

Os parâmetros de opções.

Devoluções

Promise<void>

fromConnectionString(string, TableServiceClientOptions)

Cria uma instância de TableServiceClient a partir da cadeia de conexão.

static function fromConnectionString(connectionString: string, options?: TableServiceClientOptions): TableServiceClient

Parâmetros

connectionString

string

Cadeia de conexão de conta ou uma cadeia de conexão SAS de uma conta de armazenamento do Azure. [ Observação - A cadeia de conexão da conta só pode ser usada em NODE.JS tempo de execução. ] Exemplo de cadeia de conexão de conta - DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net exemplo de cadeia de conexão SAS - BlobEndpoint=https://myaccount.table.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString

options
TableServiceClientOptions

Opções para configurar o pipeline HTTP.

Devoluções

Um novo TableServiceClient da cadeia de conexão fornecida.

getProperties(OperationOptions)

Obtém as propriedades do serviço Tabela de uma conta, incluindo propriedades para as regras Analytics e CORS (Cross-Origin Resource Sharing).

function getProperties(options?: OperationOptions): Promise<ServiceGetPropertiesResponse>

Parâmetros

options
OperationOptions

Os parâmetros de opções.

Devoluções

getStatistics(OperationOptions)

Recupera estatísticas relacionadas à replicação para o serviço Tabela. Ele só está disponível no ponto de extremidade do local secundário quando a replicação com redundância geográfica de acesso de leitura está habilitada para a conta.

function getStatistics(options?: OperationOptions): Promise<ServiceGetStatisticsResponse>

Parâmetros

options
OperationOptions

Os parâmetros de opções.

Devoluções

listTables(ListTableItemsOptions)

Tabelas de consultas sob a conta fornecida.

function listTables(options?: ListTableItemsOptions): PagedAsyncIterableIterator<TableItem, TableItemResultPage, PageSettings>

Parâmetros

options
ListTableItemsOptions

Os parâmetros de opções.

Devoluções

setProperties(TableServiceProperties, ServiceSetPropertiesOptionalParams)

Define propriedades para o ponto de extremidade do serviço Tabela de uma conta, incluindo propriedades para regras do Google Analytics e CORS (Cross-Origin Resource Sharing).

function setProperties(properties: TableServiceProperties, options?: ServiceSetPropertiesOptionalParams): Promise<ServiceSetPropertiesHeaders>

Parâmetros

properties
ServiceProperties

As propriedades do Serviço de Tabela.

options
SetPropertiesOptions

Os parâmetros de opções.

Devoluções