Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR web/resource-manager] [Do Not Merge] Add API for adding external storage account configurations to a web app #2238

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.appservice.v2018_02_01;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Azure Files or Blob Storage access information value for dictionary storage.
*/
public class AzureStorageInfoValue {
/**
* Type of storage. Possible values include: 'AzureFiles', 'AzureBlob'.
*/
@JsonProperty(value = "type")
private AzureStorageType type;

/**
* Name of the storage account.
*/
@JsonProperty(value = "accountName")
private String accountName;

/**
* Name of the file share (container name, for Blob storage).
*/
@JsonProperty(value = "shareName")
private String shareName;

/**
* Access key for the storage account.
*/
@JsonProperty(value = "accessKey")
private String accessKey;

/**
* Path to mount the storage within the site's runtime environment.
*/
@JsonProperty(value = "mountPath")
private String mountPath;

/**
* State of the storage account. Possible values include: 'Ok',
* 'InvalidCredentials', 'InvalidShare'.
*/
@JsonProperty(value = "state")
private AzureStorageState state;

/**
* Get type of storage. Possible values include: 'AzureFiles', 'AzureBlob'.
*
* @return the type value
*/
public AzureStorageType type() {
return this.type;
}

/**
* Set type of storage. Possible values include: 'AzureFiles', 'AzureBlob'.
*
* @param type the type value to set
* @return the AzureStorageInfoValue object itself.
*/
public AzureStorageInfoValue withType(AzureStorageType type) {
this.type = type;
return this;
}

/**
* Get name of the storage account.
*
* @return the accountName value
*/
public String accountName() {
return this.accountName;
}

/**
* Set name of the storage account.
*
* @param accountName the accountName value to set
* @return the AzureStorageInfoValue object itself.
*/
public AzureStorageInfoValue withAccountName(String accountName) {
this.accountName = accountName;
return this;
}

/**
* Get name of the file share (container name, for Blob storage).
*
* @return the shareName value
*/
public String shareName() {
return this.shareName;
}

/**
* Set name of the file share (container name, for Blob storage).
*
* @param shareName the shareName value to set
* @return the AzureStorageInfoValue object itself.
*/
public AzureStorageInfoValue withShareName(String shareName) {
this.shareName = shareName;
return this;
}

/**
* Get access key for the storage account.
*
* @return the accessKey value
*/
public String accessKey() {
return this.accessKey;
}

/**
* Set access key for the storage account.
*
* @param accessKey the accessKey value to set
* @return the AzureStorageInfoValue object itself.
*/
public AzureStorageInfoValue withAccessKey(String accessKey) {
this.accessKey = accessKey;
return this;
}

/**
* Get path to mount the storage within the site's runtime environment.
*
* @return the mountPath value
*/
public String mountPath() {
return this.mountPath;
}

/**
* Set path to mount the storage within the site's runtime environment.
*
* @param mountPath the mountPath value to set
* @return the AzureStorageInfoValue object itself.
*/
public AzureStorageInfoValue withMountPath(String mountPath) {
this.mountPath = mountPath;
return this;
}

/**
* Get state of the storage account. Possible values include: 'Ok', 'InvalidCredentials', 'InvalidShare'.
*
* @return the state value
*/
public AzureStorageState state() {
return this.state;
}

/**
* Set state of the storage account. Possible values include: 'Ok', 'InvalidCredentials', 'InvalidShare'.
*
* @param state the state value to set
* @return the AzureStorageInfoValue object itself.
*/
public AzureStorageInfoValue withState(AzureStorageState state) {
this.state = state;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.appservice.v2018_02_01;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.appservice.v2018_02_01.implementation.CertificateRegistrationManager;
import com.microsoft.azure.management.appservice.v2018_02_01.implementation.AzureStoragePropertyDictionaryResourceInner;
import java.util.Map;

/**
* Type representing AzureStoragePropertyDictionaryResource.
*/
public interface AzureStoragePropertyDictionaryResource extends HasInner<AzureStoragePropertyDictionaryResourceInner>, HasManager<CertificateRegistrationManager> {
/**
* @return the id value.
*/
String id();

/**
* @return the kind value.
*/
String kind();

/**
* @return the name value.
*/
String name();

/**
* @return the properties value.
*/
Map<String, AzureStorageInfoValue> properties();

/**
* @return the type value.
*/
String type();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.appservice.v2018_02_01;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for AzureStorageState.
*/
public enum AzureStorageState {
/** Enum value Ok. */
OK("Ok"),

/** Enum value InvalidCredentials. */
INVALID_CREDENTIALS("InvalidCredentials"),

/** Enum value InvalidShare. */
INVALID_SHARE("InvalidShare");

/** The actual serialized value for a AzureStorageState instance. */
private String value;

AzureStorageState(String value) {
this.value = value;
}

/**
* Parses a serialized value to a AzureStorageState instance.
*
* @param value the serialized value to parse.
* @return the parsed AzureStorageState object, or null if unable to parse.
*/
@JsonCreator
public static AzureStorageState fromString(String value) {
AzureStorageState[] items = AzureStorageState.values();
for (AzureStorageState item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
}

@JsonValue
@Override
public String toString() {
return this.value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.appservice.v2018_02_01;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for AzureStorageType.
*/
public enum AzureStorageType {
/** Enum value AzureFiles. */
AZURE_FILES("AzureFiles"),

/** Enum value AzureBlob. */
AZURE_BLOB("AzureBlob");

/** The actual serialized value for a AzureStorageType instance. */
private String value;

AzureStorageType(String value) {
this.value = value;
}

/**
* Parses a serialized value to a AzureStorageType instance.
*
* @param value the serialized value to parse.
* @return the parsed AzureStorageType object, or null if unable to parse.
*/
@JsonCreator
public static AzureStorageType fromString(String value) {
AzureStorageType[] items = AzureStorageType.values();
for (AzureStorageType item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
}

@JsonValue
@Override
public String toString() {
return this.value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.util.List;
import org.joda.time.DateTime;
import java.util.Map;
import com.microsoft.azure.management.appservice.v2018_02_01.implementation.PushSettingsInner;
import com.fasterxml.jackson.annotation.JsonProperty;

Expand Down Expand Up @@ -123,6 +124,12 @@ public class SiteConfig {
@JsonProperty(value = "appSettings")
private List<NameValuePair> appSettings;

/**
* User-provided Azure storage accounts.
*/
@JsonProperty(value = "azureStorageAccounts")
private Map<String, AzureStorageInfoValue> azureStorageAccounts;

/**
* Connection strings.
*/
Expand Down Expand Up @@ -674,6 +681,26 @@ public SiteConfig withAppSettings(List<NameValuePair> appSettings) {
return this;
}

/**
* Get user-provided Azure storage accounts.
*
* @return the azureStorageAccounts value
*/
public Map<String, AzureStorageInfoValue> azureStorageAccounts() {
return this.azureStorageAccounts;
}

/**
* Set user-provided Azure storage accounts.
*
* @param azureStorageAccounts the azureStorageAccounts value to set
* @return the SiteConfig object itself.
*/
public SiteConfig withAzureStorageAccounts(Map<String, AzureStorageInfoValue> azureStorageAccounts) {
this.azureStorageAccounts = azureStorageAccounts;
return this;
}

/**
* Get connection strings.
*
Expand Down
Loading