Пример #1
0
def supported_api_version(cli_ctx,
                          resource_type,
                          min_api=None,
                          max_api=None,
                          operation_group=None):
    """ Method to check if the current API version for a given resource_type is supported.
        If resource_type is set to None, the current profile version will be used as the basis of
        the comparison.

    :param resource_type: The resource type.
    :type resource_type: ResourceType.
    :param min_api: The minimum API that is supported (inclusive). Omit for no minimum constraint.
    "type min_api: str
    :param max_api: The maximum API that is supported (inclusive). Omit for no maximum constraint.
    :type max_api: str
    :returns: True if the current API version of resource_type satisfies the min/max constraints. False otherwise.
     Can return a tuple<operation_group, bool> if the resource_type supports SDKProfile.
    :rtype: bool or tuple[bool]
    """
    from azure.cli.core.profiles._shared import supported_api_version as _sdk_supported_api_version
    return _sdk_supported_api_version(cli_ctx.cloud.profile,
                                      resource_type=resource_type,
                                      min_api=min_api,
                                      max_api=max_api,
                                      operation_group=operation_group)
Пример #2
0
def supported_api_version(resource_type, min_api=None, max_api=None):
    """ Method to check if the current API version for a given resource_type is supported.

    :param resource_type: The resource type.
    :type resource_type: ResourceType.
    :param min_api: The minimum API that is supported (inclusive). Omit for no minimum constraint.
    "type min_api: str
    :param max_api: The maximum API that is supported (inclusive). Omit for no maximum constraint.
    "type max_api: str
    :returns:  bool -- True if the current API version of resource_type satisfies the
                       min/max constraints. False otherwise.
    """
    from azure.cli.core._profile import CLOUD
    return _sdk_supported_api_version(CLOUD.profile, resource_type, min_api, max_api)
Пример #3
0
def supported_api_version(resource_type, min_api=None, max_api=None):
    """ Method to check if the current API version for a given resource_type is supported.
        If resource_type is set to None, the current profile version will be used as the basis of
        the comparison.

    :param resource_type: The resource type.
    :type resource_type: ResourceType.
    :param min_api: The minimum API that is supported (inclusive). Omit for no minimum constraint.
    "type min_api: str
    :param max_api: The maximum API that is supported (inclusive). Omit for no maximum constraint.
    "type max_api: str
    :returns:  bool -- True if the current API version of resource_type satisfies the
                       min/max constraints. False otherwise.
    """
    from azure.cli.core._profile import CLOUD
    return _sdk_supported_api_version(CLOUD.profile, resource_type, min_api, max_api)
Пример #4
0
def supported_api_version(cli_ctx, resource_type, min_api=None, max_api=None, operation_group=None):
    """ Method to check if the current API version for a given resource_type is supported.
        If resource_type is set to None, the current profile version will be used as the basis of
        the comparison.

    :param resource_type: The resource type.
    :type resource_type: ResourceType.
    :param min_api: The minimum API that is supported (inclusive). Omit for no minimum constraint.
    "type min_api: str
    :param max_api: The maximum API that is supported (inclusive). Omit for no maximum constraint.
    :type max_api: str
    :returns: True if the current API version of resource_type satisfies the min/max constraints. False otherwise.
     Can return a tuple<operation_group, bool> if the resource_type supports SDKProfile.
    :rtype: bool or tuple[bool]
    """
    from azure.cli.core.profiles._shared import supported_api_version as _sdk_supported_api_version
    return _sdk_supported_api_version(cli_ctx.cloud.profile,
                                      resource_type=resource_type,
                                      min_api=min_api,
                                      max_api=max_api,
                                      operation_group=operation_group)