Skip to content
Merged
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
2 changes: 2 additions & 0 deletions azure-mgmt-web/azure/mgmt/web/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
AutoHealActionType,
ConnectionStringType,
SslState,
HostType,
OperationStatus,
UsageState,
SiteAvailabilityState,
Expand Down Expand Up @@ -425,6 +426,7 @@
'AutoHealActionType',
'ConnectionStringType',
'SslState',
'HostType',
'OperationStatus',
'UsageState',
'SiteAvailabilityState',
Expand Down
7 changes: 6 additions & 1 deletion azure-mgmt-web/azure/mgmt/web/models/host_name_ssl_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class HostNameSslState(Model):
:type thumbprint: str
:param to_update: Set to <code>true</code> to update existing hostname.
:type to_update: bool
:param host_type: Indicates whether the hostname is a standard or
repository hostname. Possible values include: 'Standard', 'Repository'
:type host_type: str or :class:`HostType <azure.mgmt.web.models.HostType>`
"""

_attribute_map = {
Expand All @@ -35,11 +38,13 @@ class HostNameSslState(Model):
'virtual_ip': {'key': 'virtualIP', 'type': 'str'},
'thumbprint': {'key': 'thumbprint', 'type': 'str'},
'to_update': {'key': 'toUpdate', 'type': 'bool'},
'host_type': {'key': 'hostType', 'type': 'HostType'},
}

def __init__(self, name=None, ssl_state=None, virtual_ip=None, thumbprint=None, to_update=None):
def __init__(self, name=None, ssl_state=None, virtual_ip=None, thumbprint=None, to_update=None, host_type=None):
self.name = name
self.ssl_state = ssl_state
self.virtual_ip = virtual_ip
self.thumbprint = thumbprint
self.to_update = to_update
self.host_type = host_type
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ class SslState(Enum):
ip_based_enabled = "IpBasedEnabled"


class HostType(Enum):

standard = "Standard"
repository = "Repository"


class OperationStatus(Enum):

in_progress = "InProgress"
Expand Down
243 changes: 117 additions & 126 deletions azure-mgmt-web/azure/mgmt/web/web_site_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,122 @@ def __init__(
self.deleted_web_apps = DeletedWebAppsOperations(
self._client, self.config, self._serialize, self._deserialize)

def get_publishing_user(
self, custom_headers=None, raw=False, **operation_config):
"""Gets publishing user.

Gets publishing user.

:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: :class:`User <azure.mgmt.web.models.User>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
api_version = "2016-03-01"

# Construct URL
url = '/providers/Microsoft.Web/publishingUsers/web'

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('User', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized

def update_publishing_user(
self, user_details, custom_headers=None, raw=False, **operation_config):
"""Updates publishing user.

Updates publishing user.

:param user_details: Details of publishing user
:type user_details: :class:`User <azure.mgmt.web.models.User>`
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: :class:`User <azure.mgmt.web.models.User>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
api_version = "2016-03-01"

# Construct URL
url = '/providers/Microsoft.Web/publishingUsers/web'

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
body_content = self._serialize.body(user_details, 'User')

# Construct and send request
request = self._client.put(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('User', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized

def list_source_controls(
self, custom_headers=None, raw=False, **operation_config):
"""Gets the source controls available for Azure websites.
Expand Down Expand Up @@ -382,7 +498,7 @@ def internal_paging(next_link=None, raw=False):
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.post(url, query_parameters)
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, **operation_config)

Expand Down Expand Up @@ -470,131 +586,6 @@ def internal_paging(next_link=None, raw=False):

return deserialized

def get_publishing_credentials(
self, custom_headers=None, raw=False, **operation_config):
"""Get the publishing credentials for the subscription owner.

Get the publishing credentials for the subscription owner.

:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: :class:`User <azure.mgmt.web.models.User>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
api_version = "2016-03-01"

# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Web/publishingCredentials'
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('User', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized

def update_publishing_credentials(
self, request_message, custom_headers=None, raw=False, **operation_config):
"""Update the publishing credentials for the subscription owner.

Update the publishing credentials for the subscription owner.

:param request_message: A request message with the new publishing
credentials.
:type request_message: :class:`User <azure.mgmt.web.models.User>`
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: :class:`User <azure.mgmt.web.models.User>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
api_version = "2016-03-01"

# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Web/publishingCredentials'
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
body_content = self._serialize.body(request_message, 'User')

# Construct and send request
request = self._client.put(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('User', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized

def list_skus(
self, custom_headers=None, raw=False, **operation_config):
"""List all SKUs.
Expand Down