Dodawanie wartościAdd Value
Dodaje określoną wartość jako nową wersję określonego zasobu tajnego.Adds the specified value as a new version of the specified secret resource.
Tworzy nową wartość określonego zasobu tajnego.Creates a new value of the specified secret resource. Nazwa wartości jest zwykle identyfikatorem wersji.The name of the value is typically the version identifier. Po utworzeniu wartości nie można jej zmienić.Once created the value cannot be changed.
ŻądanieRequest
MetodaMethod | Identyfikator URI żądaniaRequest URI |
---|---|
PUTPUT | /Resources/Secrets/{secretResourceName}/values/{secretValueResourceName}?api-version=6.4-preview |
ParametryParameters
NazwaName | TypType | WymaganeRequired | LokalizacjaLocation |
---|---|---|---|
secretResourceName |
ciągstring | TakYes | ŚcieżkaPath |
secretValueResourceName |
ciągstring | TakYes | ŚcieżkaPath |
api-version |
ciągstring | TakYes | ZapytanieQuery |
secretValueResourceDescription |
SecretValueResourceDescriptionSecretValueResourceDescription | TakYes | TreśćBody |
secretResourceName
Typ: ciągType: string
Wymagane: TakRequired: Yes
Nazwa zasobu tajnego.The name of the secret resource.
secretValueResourceName
Typ: ciągType: string
Wymagane: TakRequired: Yes
Nazwa wartości zasobu tajnego, która zazwyczaj jest identyfikatorem wersji wartości.The name of the secret resource value which is typically the version identifier for the value.
api-version
Typ: ciągType: string
Wymagane: TakRequired: Yes
Wartość domyślna:6.4-preview
Default: 6.4-preview
Wersja interfejsu API.The version of the API. Ten parametr jest wymagany, a jego wartość musi być "6.4-preview".This parameter is required and its value must be '6.4-preview'.
secretValueResourceDescription
Typ: SecretValueResourceDescriptionType: SecretValueResourceDescription
Wymagane: TakRequired: Yes
Opis tworzenia wartości zasobu tajnego.Description for creating a value of a secret resource.
OdpowiedziResponses
Kod stanu HTTPHTTP Status Code | OpisDescription | Response SchemaResponse Schema |
---|---|---|
200 (OK)200 (OK) | OKOK |
SecretValueResourceDescriptionSecretValueResourceDescription |
201 (utworzono)201 (Created) | UtworzoneCreated |
SecretValueResourceDescriptionSecretValueResourceDescription |
202 (Zaakceptowane)202 (Accepted) | ZaakceptowanoAccepted |
|
Wszystkie inne kody stanuAll other status codes | BłądError |
FabricErrorFabricError |
PrzykładyExamples
CreateMeshSecretValueCreateMeshSecretValue
W tym przykładzie pokazano, jak dodać nową wartość zasobu tajnego. Wartość tajna jest dostarczana jako zwykły tekst.This example shows how to add a new value of a secret resource; the secret value is provided as plaintext.
ŻądanieRequest
PUT http://localhost:19080/Resources/Secrets/dbConnectionString/values/v1?api-version=6.4-preview
TreśćBody
{
"name": "v1",
"properties": {
"value": "mongodb://contoso123:0Fc3IolnL12312asdfawejunASDF@asdfYXX2t8a97kghVcUzcDv98hawelufhawefafnoQRGwNj2nMPL1Y9qsIr9Srdw==@contoso123.documents.azure.com:10255/mydatabase?ssl=true"
}
}
Odpowiedź: 200200 Response
TreśćBody
{
"name": "v1",
"properties": {
"value": null
}
}
Odpowiedź 201201 Response
TreśćBody
{
"name": "v1",
"properties": {
"value": null
}
}
Odpowiedź 202202 Response
TreśćBody
Treść odpowiedzi jest pusta.The response body is empty.