Search in sources :

Example 1 with HostNameBinding

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;
        }
    });
}
Also used : DeploymentSlot(com.microsoft.azure.management.appservice.DeploymentSlot) Indexable(com.microsoft.azure.management.resources.fluentcore.model.Indexable) Func1(rx.functions.Func1) HostNameBinding(com.microsoft.azure.management.appservice.HostNameBinding)

Example 2 with 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());
}
Also used : HostNameSslState(com.microsoft.azure.management.appservice.HostNameSslState) ConnectionString(com.microsoft.azure.management.appservice.ConnectionString) HostNameBinding(com.microsoft.azure.management.appservice.HostNameBinding) AppSetting(com.microsoft.azure.management.appservice.AppSetting)

Aggregations

HostNameBinding (com.microsoft.azure.management.appservice.HostNameBinding)2 AppSetting (com.microsoft.azure.management.appservice.AppSetting)1 ConnectionString (com.microsoft.azure.management.appservice.ConnectionString)1 DeploymentSlot (com.microsoft.azure.management.appservice.DeploymentSlot)1 HostNameSslState (com.microsoft.azure.management.appservice.HostNameSslState)1 Indexable (com.microsoft.azure.management.resources.fluentcore.model.Indexable)1 Func1 (rx.functions.Func1)1