Kết quả
No results found.
Hàm này sẽ lấy giá trị bí mật bằng một khóa. Nếu khóa không tồn tại, SDK sẽ trả về default_value
// Get a secret value by secret key.
// If they Key does not exist, SDK will return the defaultValue
var secretValue = service.GetSecret(
name: "REDIS_CONNECTION",
defaultValue: "Default Value"
)
Console.WriteLine(secretValue);
// Get a secret value by secret key and specific environment name.
// If the Key does not exist, SDK will return the defaultValue
secretValue = service.GetSecret(
name: "REDIS_CONNECTION",
environmentName: "staging",
defaultValue: "Default Value"
)
Console.WriteLine(secretValue);
// Get a secret value by secret key.
// If they Key does not exist, SDK will throw exception
var options = new SecretRetrieveOptions();
var requestOptions = new RequestOptions();
var secretValue = service.Get(
name: "REDIS_CONNECTION",
retrieveOptions: options,
requestOptions:requestOptions
)
Console.WriteLine(secretValue);
// Get a secret value by secret key and specific environment name.
// If the Key does not exist, SDK will throw exception
var options = new SecretRetrieveOptions();
var requestOptions = new RequestOptions();
var secretValue = service.Get(
name: "REDIS_CONNECTION",
environmentName: "staging",
retrieveOptions: options,
requestOptions:requestOptions
)
Console.WriteLine(secretValue);