use of com.microsoft.azure.management.keyvault.AccessPolicy in project azure-sdk-for-java by Azure.
the class Utils method print.
/**
* Print a key vault.
* @param vault the key vault resource
*/
public static void print(Vault vault) {
StringBuilder info = new StringBuilder().append("Key Vault: ").append(vault.id()).append("Name: ").append(vault.name()).append("\n\tResource group: ").append(vault.resourceGroupName()).append("\n\tRegion: ").append(vault.region()).append("\n\tSku: ").append(vault.sku().name()).append(" - ").append(vault.sku().family()).append("\n\tVault URI: ").append(vault.vaultUri()).append("\n\tAccess policies: ");
for (AccessPolicy accessPolicy : vault.accessPolicies()) {
info.append("\n\t\tIdentity:").append(accessPolicy.objectId()).append("\n\t\tKey permissions: ").append(Joiner.on(", ").join(accessPolicy.permissions().keys())).append("\n\t\tSecret permissions: ").append(Joiner.on(", ").join(accessPolicy.permissions().secrets()));
}
System.out.println(info.toString());
}
use of com.microsoft.azure.management.keyvault.AccessPolicy in project azure-sdk-for-java by Azure.
the class VaultImpl method createResourceAsync.
@Override
public Observable<Vault> createResourceAsync() {
final VaultsInner client = this.manager().inner().vaults();
return populateAccessPolicies().flatMap(new Func1<Object, Observable<VaultInner>>() {
@Override
public Observable<VaultInner> call(Object o) {
VaultCreateOrUpdateParametersInner parameters = new VaultCreateOrUpdateParametersInner();
parameters.withLocation(regionName());
parameters.withProperties(inner().properties());
parameters.withTags(inner().getTags());
parameters.properties().withAccessPolicies(new ArrayList<AccessPolicyEntry>());
for (AccessPolicy accessPolicy : accessPolicies) {
parameters.properties().accessPolicies().add(accessPolicy.inner());
}
return client.createOrUpdateAsync(resourceGroupName(), name(), parameters);
}
}).map(innerToFluentMap(this));
}
Aggregations