AppConfigurationClient class
Azure App Configuration サービスのクライアント。
コンストラクター
| App |
AppConfigurationClient クラスの新しいインスタンスを初期化します。 |
| App |
TokenCredential を使用して、AppConfigurationClient クラスの新しいインスタンスを初期化します。 |
メソッド
| add |
Azure App Configuration サービスに設定を追加します。既に存在する場合は失敗します。 使用例:
|
| archive |
準備完了スナップショットをアーカイブする 使用例:
|
| begin |
Azure App Configuration サービスのスナップショットの作成を開始します。既に存在する場合は失敗します。 |
| begin |
Azure App Configuration サービスのスナップショットの作成を開始し、完了するまで待機します。既に存在する場合は失敗します。 |
| check |
Azure App Configuration Serviceの設定をHEADリクエストでチェックし、応答本文なしのヘッダーのみを返します。 これはETagを比較して設定が変わったかどうかを効率的に確認するのに役立ちます。 コード例:
|
| delete |
Azure App Configuration サービスから設定を削除する 使用例:
|
| get |
Azure App Configuration サービスから設定を取得します。 コード例:
|
| get |
Azure App Configuration サービスからスナップショットを取得する 使用例:
|
| list |
必要に応じて、キー名、ラベル、および受け入れ datetime でフィルター処理された、Azure App Configuration サービスの設定を一覧表示します。 コード例:
|
| list |
名前に基づいてスナップショットの Azure App Configuration サービスの設定を一覧表示します。必要に応じて、キー名、ラベル、および受け入れ datetime でフィルター処理されます。 コード例:
|
| list |
Azure App Configuration サービスからラベルの一覧を取得する コード例:
|
| list |
キーのセットのリビジョンを一覧表示します。必要に応じて、キー名、ラベル、および受け入れ datetime でフィルター処理します。 コード例:
|
| list |
Azure App Configuration サービスからのすべてのスナップショットを一覧表示する 使用例:
|
| recover |
アーカイブされたスナップショットを回復して準備完了状態に戻す 使用例:
|
| set |
Azure App Configuration サービスのキーの値を設定し、オプションの etag を使用できるようにします。 |
| set |
キーの読み取り専用状態を設定またはクリアします。 |
| update |
外部同期トークンを追加して、サービス要求が -date 値 up-to受け取れるようにします。 |
コンストラクターの詳細
AppConfigurationClient(string, AppConfigurationClientOptions)
AppConfigurationClient クラスの新しいインスタンスを初期化します。
new AppConfigurationClient(connectionString: string, options?: AppConfigurationClientOptions)
パラメーター
- connectionString
-
string
- options
- AppConfigurationClientOptions
AppConfigurationClient のオプション。
AppConfigurationClient(string, TokenCredential, AppConfigurationClientOptions)
TokenCredential を使用して、AppConfigurationClient クラスの新しいインスタンスを初期化します。
new AppConfigurationClient(endpoint: string, tokenCredential: TokenCredential, options?: AppConfigurationClientOptions)
パラメーター
- endpoint
-
string
App Configuration サービスのエンドポイント (例: https://sample.azconfig.io)。
- tokenCredential
- TokenCredential
サービスへの要求を認証するために使用する TokenCredential インターフェイスを実装するオブジェクト。
@azure/identity パッケージを使用して、ニーズに合った資格情報を作成します。
- options
- AppConfigurationClientOptions
AppConfigurationClient のオプション。
メソッドの詳細
addConfigurationSetting(AddConfigurationSettingParam<string> | AddConfigurationSettingParam<FeatureFlagValue> | AddConfigurationSettingParam<SecretReferenceValue> | AddConfigurationSettingParam<SnapshotReferenceValue>, AddConfigurationSettingOptions)
Azure App Configuration サービスに設定を追加します。既に存在する場合は失敗します。
使用例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const result = await client.addConfigurationSetting({
key: "MyKey",
label: "MyLabel",
value: "MyValue",
});
function addConfigurationSetting(configurationSetting: AddConfigurationSettingParam<string> | AddConfigurationSettingParam<FeatureFlagValue> | AddConfigurationSettingParam<SecretReferenceValue> | AddConfigurationSettingParam<SnapshotReferenceValue>, options?: AddConfigurationSettingOptions): Promise<AddConfigurationSettingResponse>
パラメーター
- configurationSetting
-
AddConfigurationSettingParam<string> | AddConfigurationSettingParam<FeatureFlagValue> | AddConfigurationSettingParam<SecretReferenceValue> | AddConfigurationSettingParam<SnapshotReferenceValue>
構成設定。
- options
- AddConfigurationSettingOptions
要求の省略可能なパラメーター。
戻り値
Promise<AddConfigurationSettingResponse>
archiveSnapshot(string, UpdateSnapshotOptions)
準備完了スナップショットをアーカイブする
使用例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const result = await client.archiveSnapshot({ name: "MySnapshot" });
function archiveSnapshot(name: string, options?: UpdateSnapshotOptions): Promise<UpdateSnapshotResponse>
パラメーター
- name
-
string
スナップショットの名前。
- options
- UpdateSnapshotOptions
要求の省略可能なパラメーター。
戻り値
Promise<UpdateSnapshotResponse>
beginCreateSnapshot(SnapshotInfo, CreateSnapshotOptions)
Azure App Configuration サービスのスナップショットの作成を開始します。既に存在する場合は失敗します。
function beginCreateSnapshot(snapshot: SnapshotInfo, options?: CreateSnapshotOptions): Promise<SimplePollerLike<OperationState<CreateSnapshotResponse>, CreateSnapshotResponse>>
パラメーター
- snapshot
- SnapshotInfo
- options
- CreateSnapshotOptions
戻り値
Promise<@azure/core-lro.SimplePollerLike<OperationState<CreateSnapshotResponse>, CreateSnapshotResponse>>
beginCreateSnapshotAndWait(SnapshotInfo, CreateSnapshotOptions)
Azure App Configuration サービスのスナップショットの作成を開始し、完了するまで待機します。既に存在する場合は失敗します。
function beginCreateSnapshotAndWait(snapshot: SnapshotInfo, options?: CreateSnapshotOptions): Promise<CreateSnapshotResponse>
パラメーター
- snapshot
- SnapshotInfo
- options
- CreateSnapshotOptions
戻り値
Promise<CreateSnapshotResponse>
checkConfigurationSettings(CheckConfigurationSettingsOptions)
Azure App Configuration Serviceの設定をHEADリクエストでチェックし、応答本文なしのヘッダーのみを返します。 これはETagを比較して設定が変わったかどうかを効率的に確認するのに役立ちます。
コード例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const pageIterator = client.checkConfigurationSettings({ keyFilter: "MyKey" }).byPage();
function checkConfigurationSettings(options?: CheckConfigurationSettingsOptions): PagedAsyncIterableIterator<ConfigurationSetting<string>, ListConfigurationSettingPage, PageSettings>
パラメーター
要求の省略可能なパラメーター。
戻り値
deleteConfigurationSetting(ConfigurationSettingId, DeleteConfigurationSettingOptions)
Azure App Configuration サービスから設定を削除する
使用例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const deletedSetting = await client.deleteConfigurationSetting({
key: "MyKey",
label: "MyLabel",
});
function deleteConfigurationSetting(id: ConfigurationSettingId, options?: DeleteConfigurationSettingOptions): Promise<DeleteConfigurationSettingResponse>
パラメーター
削除する構成設定の ID。
要求の省略可能なパラメーター (例: etag、ラベル)
戻り値
Promise<DeleteConfigurationSettingResponse>
getConfigurationSetting(ConfigurationSettingId, GetConfigurationSettingOptions)
Azure App Configuration サービスから設定を取得します。
コード例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const setting = await client.getConfigurationSetting({ key: "MyKey", label: "MyLabel" });
function getConfigurationSetting(id: ConfigurationSettingId, options?: GetConfigurationSettingOptions): Promise<GetConfigurationSettingResponse>
パラメーター
取得する構成設定の ID。
- options
- GetConfigurationSettingOptions
要求の省略可能なパラメーター。
戻り値
Promise<GetConfigurationSettingResponse>
getSnapshot(string, GetSnapshotOptions)
Azure App Configuration サービスからスナップショットを取得する
使用例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const retrievedSnapshot = await client.getSnapshot("testsnapshot");
console.log("Retrieved snapshot:", retrievedSnapshot);
function getSnapshot(name: string, options?: GetSnapshotOptions): Promise<GetSnapshotResponse>
パラメーター
- name
-
string
スナップショットの名前。
- options
- GetSnapshotOptions
要求の省略可能なパラメーター。
戻り値
Promise<GetSnapshotResponse>
listConfigurationSettings(ListConfigurationSettingsOptions)
必要に応じて、キー名、ラベル、および受け入れ datetime でフィルター処理された、Azure App Configuration サービスの設定を一覧表示します。
コード例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const allSettingsWithLabel = client.listConfigurationSettings({ labelFilter: "MyLabel" });
function listConfigurationSettings(options?: ListConfigurationSettingsOptions): PagedAsyncIterableIterator<ConfigurationSetting<string>, ListConfigurationSettingPage, PageSettings>
パラメーター
- options
- ListConfigurationSettingsOptions
要求の省略可能なパラメーター。
戻り値
listConfigurationSettingsForSnapshot(string, ListConfigurationSettingsForSnapshotOptions)
名前に基づいてスナップショットの Azure App Configuration サービスの設定を一覧表示します。必要に応じて、キー名、ラベル、および受け入れ datetime でフィルター処理されます。
コード例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const allSettingsWithLabel = client.listConfigurationSettingsForSnashots({
snapshotName: "MySnapshot",
});
function listConfigurationSettingsForSnapshot(snapshotName: string, options?: ListConfigurationSettingsForSnapshotOptions): PagedAsyncIterableIterator<ConfigurationSetting<string>, ListConfigurationSettingPage, PageSettings>
パラメーター
- snapshotName
-
string
要求の省略可能なパラメーター。
戻り値
listLabels(ListLabelsOptions)
Azure App Configuration サービスからラベルの一覧を取得する
コード例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const allSettingsWithLabel = client.listLabels({ nameFilter: "prod*" });
function listLabels(options?: ListLabelsOptions): PagedAsyncIterableIterator<SettingLabel, ListLabelsPage, PageSettings>
パラメーター
- options
- ListLabelsOptions
要求の省略可能なパラメーター。
戻り値
listRevisions(ListRevisionsOptions)
キーのセットのリビジョンを一覧表示します。必要に応じて、キー名、ラベル、および受け入れ datetime でフィルター処理します。
コード例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const revisionsIterator = client.listRevisions({ keys: ["MyKey"] });
function listRevisions(options?: ListRevisionsOptions): PagedAsyncIterableIterator<ConfigurationSetting<string>, ListRevisionsPage, PageSettings>
パラメーター
- options
- ListRevisionsOptions
要求の省略可能なパラメーター。
戻り値
listSnapshots(ListSnapshotsOptions)
Azure App Configuration サービスからのすべてのスナップショットを一覧表示する
使用例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const snapshots = await client.listSnapshots();
for await (const snapshot of snapshots) {
console.log(`Found snapshot: ${snapshot.name}`);
}
function listSnapshots(options?: ListSnapshotsOptions): PagedAsyncIterableIterator<ConfigurationSnapshot, ListSnapshotsPage, PageSettings>
パラメーター
- options
- ListSnapshotsOptions
要求の省略可能なパラメーター。
戻り値
recoverSnapshot(string, UpdateSnapshotOptions)
アーカイブされたスナップショットを回復して準備完了状態に戻す
使用例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
const result = await client.recoverSnapshot("MySnapshot");
function recoverSnapshot(name: string, options?: UpdateSnapshotOptions): Promise<UpdateSnapshotResponse>
パラメーター
- name
-
string
スナップショットの名前。
- options
- UpdateSnapshotOptions
要求の省略可能なパラメーター。
戻り値
Promise<UpdateSnapshotResponse>
setConfigurationSetting(SetConfigurationSettingParam<string> | SetConfigurationSettingParam<FeatureFlagValue> | SetConfigurationSettingParam<SecretReferenceValue> | SetConfigurationSettingParam<SnapshotReferenceValue>, SetConfigurationSettingOptions)
Azure App Configuration サービスのキーの値を設定し、オプションの etag を使用できるようにします。
function setConfigurationSetting(configurationSetting: SetConfigurationSettingParam<string> | SetConfigurationSettingParam<FeatureFlagValue> | SetConfigurationSettingParam<SecretReferenceValue> | SetConfigurationSettingParam<SnapshotReferenceValue>, options?: SetConfigurationSettingOptions): Promise<SetConfigurationSettingResponse>
パラメーター
- configurationSetting
-
SetConfigurationSettingParam<string> | SetConfigurationSettingParam<FeatureFlagValue> | SetConfigurationSettingParam<SecretReferenceValue> | SetConfigurationSettingParam<SnapshotReferenceValue>
構成値。
- options
- SetConfigurationSettingOptions
要求の省略可能なパラメーター。
コード例:
import { DefaultAzureCredential } from "@azure/identity";
import { AppConfigurationClient } from "@azure/app-configuration";
// The endpoint for your App Configuration resource
const endpoint = "https://example.azconfig.io";
const credential = new DefaultAzureCredential();
const client = new AppConfigurationClient(endpoint, credential);
await client.setConfigurationSetting({ key: "MyKey", value: "MyValue" });
戻り値
Promise<SetConfigurationSettingResponse>
setReadOnly(ConfigurationSettingId, boolean, SetReadOnlyOptions)
キーの読み取り専用状態を設定またはクリアします。
function setReadOnly(id: ConfigurationSettingId, readOnly: boolean, options?: SetReadOnlyOptions): Promise<SetReadOnlyResponse>
パラメーター
変更する構成設定の ID。
- readOnly
-
boolean
- options
- SetReadOnlyOptions
戻り値
Promise<SetReadOnlyResponse>
updateSyncToken(string)
外部同期トークンを追加して、サービス要求が -date 値 up-to受け取れるようにします。
function updateSyncToken(syncToken: string)
パラメーター
- syncToken
-
string
同期トークンの値。