use of com.microsoft.azure.management.appservice.HostNameBinding in project azure-sdk-for-java by Azure.
the class HostNameBindingImpl method createAsync.
@Override
public Observable<Indexable> createAsync() {
final HostNameBinding self = this;
Func1<HostNameBindingInner, HostNameBinding> mapper = new Func1<HostNameBindingInner, HostNameBinding>() {
@Override
public HostNameBinding call(HostNameBindingInner hostNameBindingInner) {
setInner(hostNameBindingInner);
return self;
}
};
Observable<HostNameBinding> hostNameBindingObservable;
if (parent instanceof DeploymentSlot) {
hostNameBindingObservable = this.parent().manager().inner().webApps().createOrUpdateHostNameBindingSlotAsync(parent().resourceGroupName(), ((DeploymentSlot) parent).parent().name(), name, parent().name(), inner()).map(mapper);
} else {
hostNameBindingObservable = this.parent().manager().inner().webApps().createOrUpdateHostNameBindingAsync(parent().resourceGroupName(), parent().name(), name, inner()).map(mapper);
}
return hostNameBindingObservable.map(new Func1<HostNameBinding, Indexable>() {
@Override
public Indexable call(HostNameBinding hostNameBinding) {
return hostNameBinding;
}
});
}
use of com.microsoft.azure.management.appservice.HostNameBinding in project azure-sdk-for-java by Azure.
the class Utils method print.
/**
* Print a web app.
* @param resource a web app
*/
public static void print(WebAppBase resource) {
StringBuilder builder = new StringBuilder().append("Web app: ").append(resource.id()).append("Name: ").append(resource.name()).append("\n\tState: ").append(resource.state()).append("\n\tResource group: ").append(resource.resourceGroupName()).append("\n\tRegion: ").append(resource.region()).append("\n\tDefault hostname: ").append(resource.defaultHostName()).append("\n\tApp service plan: ").append(resource.appServicePlanId()).append("\n\tHost name bindings: ");
for (HostNameBinding binding : resource.getHostNameBindings().values()) {
builder = builder.append("\n\t\t" + binding.toString());
}
builder = builder.append("\n\tSSL bindings: ");
for (HostNameSslState binding : resource.hostNameSslStates().values()) {
builder = builder.append("\n\t\t" + binding.name() + ": " + binding.sslState());
if (binding.sslState() != null && binding.sslState() != SslState.DISABLED) {
builder = builder.append(" - " + binding.thumbprint());
}
}
builder = builder.append("\n\tApp settings: ");
for (AppSetting setting : resource.appSettings().values()) {
builder = builder.append("\n\t\t" + setting.key() + ": " + setting.value() + (setting.sticky() ? " - slot setting" : ""));
}
builder = builder.append("\n\tConnection strings: ");
for (ConnectionString conn : resource.connectionStrings().values()) {
builder = builder.append("\n\t\t" + conn.name() + ": " + conn.value() + " - " + conn.type() + (conn.sticky() ? " - slot setting" : ""));
}
System.out.println(builder.toString());
}
Aggregations