Exemplo n.º 1
0
def update_origin(client: OriginsOperations,
                  resource_group_name: str,
                  profile_name: str,
                  endpoint_name: str,
                  origin_name: str,
                  host_name: Optional[str] = None,
                  http_port: Optional[int] = None,
                  https_port: Optional[int] = None,
                  disabled: Optional[bool] = None,
                  origin_host_header: Optional[str] = None,
                  priority: Optional[int] = None,
                  weight: Optional[int] = None,
                  private_link_resource_id: Optional[str] = None,
                  private_link_location: Optional[str] = None,
                  private_link_approval_message: Optional[str] = None):
    from azure.mgmt.cdn.models import OriginUpdateParameters

    return client.update(
        resource_group_name, profile_name, endpoint_name, origin_name,
        OriginUpdateParameters(
            host_name=host_name,
            http_port=http_port,
            https_port=https_port,
            enabled=not disabled,
            origin_host_header=origin_host_header,
            priority=priority,
            weight=weight,
            private_link_resource_id=private_link_resource_id,
            private_link_location=private_link_location,
            private_link_approval_message=private_link_approval_message))
Exemplo n.º 2
0
def update_origin(client: OriginsOperations,
                  resource_group_name: str,
                  profile_name: str,
                  endpoint_name: str,
                  origin_name: str,
                  http_port: Optional[int] = None,
                  https_port: Optional[int] = None,
                  private_link_resource_id: Optional[str] = None,
                  private_link_location: Optional[str] = None,
                  private_link_approval_message: Optional[str] = None):
    from azure.mgmt.cdn.models import OriginUpdateParameters

    existing = client.get(resource_group_name, profile_name, endpoint_name, origin_name)

    if http_port is None:
        http_port = existing.http_port
    if https_port is None:
        https_port = existing.https_port
    if private_link_resource_id is None:
        private_link_resource_id = existing.private_link_resource_id
    if private_link_location is None:
        private_link_location = existing.private_link_location
    if private_link_approval_message is None:
        private_link_approval_message = existing.private_link_approval_message

    return client.update(resource_group_name,
                         profile_name,
                         endpoint_name,
                         origin_name,
                         OriginUpdateParameters(
                             http_port=http_port,
                             https_port=https_port,
                             enabled=existing.enabled,
                             origin_host_header=existing.origin_host_header,
                             priority=existing.priority,
                             weight=existing.weight,
                             private_link_resource_id=private_link_resource_id,
                             private_link_location=private_link_location,
                             private_link_approval_message=private_link_approval_message))