TableServiceClient class
TableServiceClient představuje klienta pro službu Azure Tables service, která umožňuje provádět operace s tabulkami a entitami.
Konstruktory
Table |
Vytvoří novou instanci Třídy TableServiceClient. |
Table |
Vytvoří novou instanci Třídy TableServiceClient. |
Table |
Vytvoří novou instanci Třídy TableServiceClient. |
Table |
Vytvoří novou instanci Třídy TableServiceClient. |
Vlastnosti
pipeline | Představuje kanál pro vytvoření požadavku HTTP na adresu URL. Kanály můžou mít několik zásad pro správu manipulace s jednotlivými požadavky před a po jeho provedení na server. |
url | Adresa URL účtu tabulky |
Metody
create |
Vytvoří novou tabulku pod daným účtem. |
delete |
Operace trvale odstraní zadanou tabulku. |
from |
Vytvoří instanci TableServiceClient z připojovacího řetězce. |
get |
Získá vlastnosti služby Table Service účtu, včetně vlastností pravidel analýzy a CORS (sdílení prostředků mezi zdroji). |
get |
Načte statistiky související s replikací pro službu Table Service. Je k dispozici pouze v sekundárním koncovém bodu umístění, pokud je pro účet povolená geograficky redundantní replikace jen pro čtení. |
list |
Dotazuje tabulky pod daným účtem. |
set |
Nastaví vlastnosti pro koncový bod služby Table Service účtu, včetně vlastností pravidel analýzy a CORS (sdílení prostředků mezi zdroji). |
Podrobnosti konstruktoru
TableServiceClient(string, NamedKeyCredential, TableServiceClientOptions)
Vytvoří novou instanci Třídy TableServiceClient.
new TableServiceClient(url: string, credential: NamedKeyCredential, options?: TableServiceClientOptions)
Parametry
- url
-
string
Adresa URL účtu služby, který je cílem požadované operace., například "https://myaccount.table.core.windows.net".
- credential
- NamedKeyCredential
NamedKeyCredential | SASCredential sloužící k ověřování požadavků. Podporováno pouze pro uzel
- options
- TableServiceClientOptions
Možnosti konfigurace kanálu HTTP
Příklad použití názvu nebo klíče účtu:
const { AzureNamedKeyCredential, TableServiceClient } = require("@azure/data-tables")
const account = "<storage account name>"
const sharedKeyCredential = new AzureNamedKeyCredential(account, "<account key>");
const tableServiceClient = new TableServiceClient(
`https://${account}.table.core.windows.net`,
sharedKeyCredential
);
TableServiceClient(string, SASCredential, TableServiceClientOptions)
Vytvoří novou instanci Třídy TableServiceClient.
new TableServiceClient(url: string, credential: SASCredential, options?: TableServiceClientOptions)
Parametry
- url
-
string
Adresa URL účtu služby, který je cílem požadované operace., například "https://myaccount.table.core.windows.net".
- credential
- SASCredential
SASCredential sloužící k ověřování požadavků
- options
- TableServiceClientOptions
Možnosti konfigurace kanálu HTTP
Příklad použití tokenu SAS
const { AzureSASCredential, TableServiceClient } = require("@azure/data-tables")
const account = "<storage account name>"
const sasCredential = new AzureSASCredential(account, "<account key>");
const tableServiceClient = new TableServiceClient(
`https://${account}.table.core.windows.net`,
sasCredential
);
TableServiceClient(string, TableServiceClientOptions)
Vytvoří novou instanci Třídy TableServiceClient.
new TableServiceClient(url: string, options?: TableServiceClientOptions)
Parametry
- url
-
string
Adresa URL účtu služby, který je cílem požadované operace., například "https://myaccount.table.core.windows.net". Můžete připojit SAS, napříkladhttps://myaccount.table.core.windows.net?sasString".
- options
- TableServiceClientOptions
Možnosti konfigurace kanálu HTTP Příklad připojení tokenu SAS:
const account = "<storage account name>";
const sasToken = "<SAS token>";
const tableServiceClient = new TableServiceClient(
`https://${account}.table.core.windows.net?${sasToken}`,
);
TableServiceClient(string, TokenCredential, TableServiceClientOptions)
Vytvoří novou instanci Třídy TableServiceClient.
new TableServiceClient(url: string, credential: TokenCredential, options?: TableServiceClientOptions)
Parametry
- url
-
string
Adresa URL účtu služby, který je cílem požadované operace., například "https://myaccount.table.core.windows.net".
- credential
- TokenCredential
Přihlašovací údaje Azure Active Directory používané k ověřování požadavků
- options
- TableServiceClientOptions
Možnosti konfigurace kanálu HTTP
Příklad použití přihlašovacích údajů Azure Active Directory:
cons { DefaultAzureCredential } = require("@azure/identity");
const { TableServiceClient } = require("@azure/data-tables")
const account = "<storage account name>"
const credential = new DefaultAzureCredential();
const tableServiceClient = new TableServiceClient(
`https://${account}.table.core.windows.net`,
credential
);
Podrobnosti vlastnosti
pipeline
Představuje kanál pro vytvoření požadavku HTTP na adresu URL. Kanály můžou mít několik zásad pro správu manipulace s jednotlivými požadavky před a po jeho provedení na server.
pipeline: Pipeline
Hodnota vlastnosti
url
Adresa URL účtu tabulky
url: string
Hodnota vlastnosti
string
Podrobnosti metody
createTable(string, OperationOptions)
Vytvoří novou tabulku pod daným účtem.
function createTable(name: string, options?: OperationOptions): Promise<void>
Parametry
- name
-
string
Název tabulky.
- options
- OperationOptions
Parametry možností.
Návraty
Promise<void>
deleteTable(string, OperationOptions)
Operace trvale odstraní zadanou tabulku.
function deleteTable(name: string, options?: OperationOptions): Promise<void>
Parametry
- name
-
string
Název tabulky.
- options
- OperationOptions
Parametry možností.
Návraty
Promise<void>
fromConnectionString(string, TableServiceClientOptions)
Vytvoří instanci TableServiceClient z připojovacího řetězce.
static function fromConnectionString(connectionString: string, options?: TableServiceClientOptions): TableServiceClient
Parametry
- connectionString
-
string
Připojovací řetězec účtu nebo připojovací řetězec SAS účtu úložiště Azure.
[ Poznámka: Připojovací řetězec účtu lze použít pouze v NODE.JS modulu runtime. ] Příklad připojovacího řetězce účtu – Příklad připojovacího řetězce SAS DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net
– 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
Možnosti konfigurace kanálu HTTP
Návraty
Nový TableServiceClient z daného připojovacího řetězce.
getProperties(OperationOptions)
Získá vlastnosti služby Table Service účtu, včetně vlastností pravidel analýzy a CORS (sdílení prostředků mezi zdroji).
function getProperties(options?: OperationOptions): Promise<GetPropertiesResponse>
Parametry
- options
- OperationOptions
Parametry možností.
Návraty
Promise<GetPropertiesResponse>
getStatistics(OperationOptions)
Načte statistiky související s replikací pro službu Table Service. Je k dispozici pouze v sekundárním koncovém bodu umístění, pokud je pro účet povolená geograficky redundantní replikace jen pro čtení.
function getStatistics(options?: OperationOptions): Promise<GetStatisticsResponse>
Parametry
- options
- OperationOptions
Parametry možností.
Návraty
Promise<GetStatisticsResponse>
listTables(ListTableItemsOptions)
Dotazuje tabulky pod daným účtem.
function listTables(options?: ListTableItemsOptions): PagedAsyncIterableIterator<TableItem, TableItemResultPage, PageSettings>
Parametry
- options
- ListTableItemsOptions
Parametry možností.
Návraty
setProperties(ServiceProperties, SetPropertiesOptions)
Nastaví vlastnosti pro koncový bod služby Table Service účtu, včetně vlastností pravidel analýzy a CORS (sdílení prostředků mezi zdroji).
function setProperties(properties: ServiceProperties, options?: SetPropertiesOptions): Promise<ServiceSetPropertiesHeaders>
Parametry
- properties
- ServiceProperties
Vlastnosti služby Table Service.
- options
- SetPropertiesOptions
Parametry možností.
Návraty
Promise<ServiceSetPropertiesHeaders>