diff --git a/sdk/servicefabric/azure-servicefabric/README.md b/sdk/servicefabric/azure-servicefabric/README.md index 25e48b003528..e10ba3dc30fa 100644 --- a/sdk/servicefabric/azure-servicefabric/README.md +++ b/sdk/servicefabric/azure-servicefabric/README.md @@ -1,22 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Service Fabric Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. +# Usage -## Usage - -For code examples, see [Service -Fabric](https://docs.microsoft.com/python/api/overview/azure/servicefabric) +For code examples, see [Service Fabric](https://docs.microsoft.com/python/api/overview/azure/servicefabric) on docs.microsoft.com. -## Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-servicefabric%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-servicefabric%2FREADME.png) diff --git a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/_service_fabric_client_ap_is.py b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/_service_fabric_client_ap_is.py index 9390cf9d7c09..92dba0aa8b7c 100644 --- a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/_service_fabric_client_ap_is.py +++ b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/_service_fabric_client_ap_is.py @@ -64,7 +64,7 @@ def __init__( super(ServiceFabricClientAPIs, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '7.0.0.42' + self.api_version = '7.1.0.45' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/__init__.py b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/__init__.py index 340834dd2bc8..191a733e5688 100644 --- a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/__init__.py +++ b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/__init__.py @@ -35,6 +35,7 @@ from ._models_py3 import ApplicationHealthStateFilter from ._models_py3 import ApplicationInfo from ._models_py3 import ApplicationLoadInfo + from ._models_py3 import ApplicationLoadMetricInformation from ._models_py3 import ApplicationMetricDescription from ._models_py3 import ApplicationNameInfo from ._models_py3 import ApplicationNewHealthReportEvent @@ -144,6 +145,7 @@ from ._models_py3 import CreateComposeDeploymentDescription from ._models_py3 import CurrentUpgradeDomainProgressInfo from ._models_py3 import DeactivationIntentDescription + from ._models_py3 import DefaultExecutionPolicy from ._models_py3 import DeletePropertyBatchOperation from ._models_py3 import DeltaNodesCheckHealthEvaluation from ._models_py3 import DeployedApplicationHealth @@ -533,6 +535,7 @@ from ._models import ApplicationHealthStateFilter from ._models import ApplicationInfo from ._models import ApplicationLoadInfo + from ._models import ApplicationLoadMetricInformation from ._models import ApplicationMetricDescription from ._models import ApplicationNameInfo from ._models import ApplicationNewHealthReportEvent @@ -642,6 +645,7 @@ from ._models import CreateComposeDeploymentDescription from ._models import CurrentUpgradeDomainProgressInfo from ._models import DeactivationIntentDescription + from ._models import DefaultExecutionPolicy from ._models import DeletePropertyBatchOperation from ._models import DeltaNodesCheckHealthEvaluation from ._models import DeployedApplicationHealth @@ -1144,6 +1148,7 @@ 'ApplicationHealthStateFilter', 'ApplicationInfo', 'ApplicationLoadInfo', + 'ApplicationLoadMetricInformation', 'ApplicationMetricDescription', 'ApplicationNameInfo', 'ApplicationNewHealthReportEvent', @@ -1253,6 +1258,7 @@ 'CreateComposeDeploymentDescription', 'CurrentUpgradeDomainProgressInfo', 'DeactivationIntentDescription', + 'DefaultExecutionPolicy', 'DeletePropertyBatchOperation', 'DeltaNodesCheckHealthEvaluation', 'DeployedApplicationHealth', diff --git a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_models.py b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_models.py index 5196f5aab0b3..6e0869fad2b6 100644 --- a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_models.py +++ b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_models.py @@ -1545,10 +1545,10 @@ class ApplicationLoadInfo(Model): For applications that do not have application capacity defined this value will be zero. :type node_count: long - :param application_load_metric_information: List of application capacity - metric description. + :param application_load_metric_information: List of application load + metric information. :type application_load_metric_information: - list[~azure.servicefabric.models.ApplicationMetricDescription] + list[~azure.servicefabric.models.ApplicationLoadMetricInformation] """ _attribute_map = { @@ -1556,7 +1556,7 @@ class ApplicationLoadInfo(Model): 'minimum_nodes': {'key': 'MinimumNodes', 'type': 'long'}, 'maximum_nodes': {'key': 'MaximumNodes', 'type': 'long'}, 'node_count': {'key': 'NodeCount', 'type': 'long'}, - 'application_load_metric_information': {'key': 'ApplicationLoadMetricInformation', 'type': '[ApplicationMetricDescription]'}, + 'application_load_metric_information': {'key': 'ApplicationLoadMetricInformation', 'type': '[ApplicationLoadMetricInformation]'}, } def __init__(self, **kwargs): @@ -1568,6 +1568,44 @@ def __init__(self, **kwargs): self.application_load_metric_information = kwargs.get('application_load_metric_information', None) +class ApplicationLoadMetricInformation(Model): + """Describes load information for a custom resource balancing metric. This can + be used to limit the total consumption of this metric by the services of + this application. + + :param name: The name of the metric. + :type name: str + :param reservation_capacity: This is the capacity reserved in the cluster + for the application. + It's the product of NodeReservationCapacity and MinimumNodes. + If set to zero, no capacity is reserved for this metric. + When setting application capacity or when updating application capacity + this value must be smaller than or equal to MaximumCapacity for each + metric. + :type reservation_capacity: long + :param application_capacity: Total capacity for this metric in this + application instance. + :type application_capacity: long + :param application_load: Current load for this metric in this application + instance. + :type application_load: long + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'reservation_capacity': {'key': 'ReservationCapacity', 'type': 'long'}, + 'application_capacity': {'key': 'ApplicationCapacity', 'type': 'long'}, + 'application_load': {'key': 'ApplicationLoad', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(ApplicationLoadMetricInformation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.reservation_capacity = kwargs.get('reservation_capacity', None) + self.application_capacity = kwargs.get('application_capacity', None) + self.application_load = kwargs.get('application_load', None) + + class ApplicationMetricDescription(Model): """Describes capacity information for a custom resource balancing metric. This can be used to limit the total consumption of this metric by the services @@ -6873,8 +6911,8 @@ class ContainerCodePackageProperties(Model): :param image_registry_credential: Image registry credential. :type image_registry_credential: ~azure.servicefabric.models.ImageRegistryCredential - :param entrypoint: Override for the default entry point in the container. - :type entrypoint: str + :param entry_point: Override for the default entry point in the container. + :type entry_point: str :param commands: Command array to execute within the container in exec form. :type commands: list[str] @@ -6927,7 +6965,7 @@ class ContainerCodePackageProperties(Model): 'name': {'key': 'name', 'type': 'str'}, 'image': {'key': 'image', 'type': 'str'}, 'image_registry_credential': {'key': 'imageRegistryCredential', 'type': 'ImageRegistryCredential'}, - 'entrypoint': {'key': 'entrypoint', 'type': 'str'}, + 'entry_point': {'key': 'entryPoint', 'type': 'str'}, 'commands': {'key': 'commands', 'type': '[str]'}, 'environment_variables': {'key': 'environmentVariables', 'type': '[EnvironmentVariable]'}, 'settings': {'key': 'settings', 'type': '[Setting]'}, @@ -6948,7 +6986,7 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) self.image = kwargs.get('image', None) self.image_registry_credential = kwargs.get('image_registry_credential', None) - self.entrypoint = kwargs.get('entrypoint', None) + self.entry_point = kwargs.get('entry_point', None) self.commands = kwargs.get('commands', None) self.environment_variables = kwargs.get('environment_variables', None) self.settings = kwargs.get('settings', None) @@ -7216,6 +7254,57 @@ def __init__(self, **kwargs): self.deactivation_intent = kwargs.get('deactivation_intent', None) +class ExecutionPolicy(Model): + """The execution policy of the service. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DefaultExecutionPolicy, RunToCompletionExecutionPolicy + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Default': 'DefaultExecutionPolicy', 'RunToCompletion': 'RunToCompletionExecutionPolicy'} + } + + def __init__(self, **kwargs): + super(ExecutionPolicy, self).__init__(**kwargs) + self.type = None + + +class DefaultExecutionPolicy(ExecutionPolicy): + """The default execution policy. Always restart the service if an exit occurs. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DefaultExecutionPolicy, self).__init__(**kwargs) + self.type = 'Default' + + class DeletePropertyBatchOperation(PropertyBatchOperation): """Represents a PropertyBatchOperation that deletes a specified property if it exists. @@ -9569,35 +9658,6 @@ def __init__(self, **kwargs): self.kind = 'ExecutingFaults' -class ExecutionPolicy(Model): - """The execution policy of the service. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: RunToCompletionExecutionPolicy - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'runToCompletion': 'RunToCompletionExecutionPolicy'} - } - - def __init__(self, **kwargs): - super(ExecutionPolicy, self).__init__(**kwargs) - self.type = None - - class ProvisionApplicationTypeDescriptionBase(Model): """Represents the type of registration or provision requested, and if the operation needs to be asynchronous or not. Supported types of provision @@ -11153,14 +11213,14 @@ class ImageStoreInfo(Model): :type used_by_staging: ~azure.servicefabric.models.UsageInfo :param used_by_copy: the ImageStore's file system usage for copied application and cluster packages. [Removing application and cluster - packages](https://docs.microsoft.com/en-us/rest/api/servicefabric/sfclient-api-deleteimagestorecontent) + packages](https://docs.microsoft.com/rest/api/servicefabric/sfclient-api-deleteimagestorecontent) will free up this space. :type used_by_copy: ~azure.servicefabric.models.UsageInfo :param used_by_register: the ImageStore's file system usage for registered and cluster packages. [Unregistering - application](https://docs.microsoft.com/en-us/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) + application](https://docs.microsoft.com/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) and [cluster - packages](https://docs.microsoft.com/en-us/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) + packages](https://docs.microsoft.com/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) will free up this space. :type used_by_register: ~azure.servicefabric.models.UsageInfo """ @@ -15488,18 +15548,19 @@ class Probe(Model): """Probes have a number of fields that you can use to control their behavior. :param initial_delay_seconds: The initial delay in seconds to start - executing probe once code package has started. + executing probe once codepackage has started. Default value: 0 . :type initial_delay_seconds: int - :param period_seconds: Periodic seconds to execute probe. + :param period_seconds: Periodic seconds to execute probe. Default value: + 10 . :type period_seconds: int :param timeout_seconds: Period after which probe is considered as failed - if it hasn't completed successfully. + if it hasn't completed successfully. Default value: 1 . :type timeout_seconds: int :param success_threshold: The count of successful probe executions after - which probe is considered success. + which probe is considered success. Default value: 1 . :type success_threshold: int :param failure_threshold: The count of failures after which probe is - considered failed. + considered failed. Default value: 3 . :type failure_threshold: int :param exec_property: Exec command to run inside the container. :type exec_property: ~azure.servicefabric.models.ProbeExec @@ -15522,11 +15583,11 @@ class Probe(Model): def __init__(self, **kwargs): super(Probe, self).__init__(**kwargs) - self.initial_delay_seconds = kwargs.get('initial_delay_seconds', None) - self.period_seconds = kwargs.get('period_seconds', None) - self.timeout_seconds = kwargs.get('timeout_seconds', None) - self.success_threshold = kwargs.get('success_threshold', None) - self.failure_threshold = kwargs.get('failure_threshold', None) + self.initial_delay_seconds = kwargs.get('initial_delay_seconds', 0) + self.period_seconds = kwargs.get('period_seconds', 10) + self.timeout_seconds = kwargs.get('timeout_seconds', 1) + self.success_threshold = kwargs.get('success_threshold', 1) + self.failure_threshold = kwargs.get('failure_threshold', 3) self.exec_property = kwargs.get('exec_property', None) self.http_get = kwargs.get('http_get', None) self.tcp_socket = kwargs.get('tcp_socket', None) @@ -17391,15 +17452,19 @@ def __init__(self, **kwargs): class RunToCompletionExecutionPolicy(ExecutionPolicy): - """The run to completion execution policy. + """The run to completion execution policy, the service will perform its + desired operation and complete successfully. If the service encounters + failure, it will restarted based on restart policy specified. If the + service completes its operation successfully, it will not be restarted + again. All required parameters must be populated in order to send to Azure. :param type: Required. Constant filled by server. :type type: str :param restart: Required. Enumerates the restart policy for - RunToCompletionExecutionPolicy. Possible values include: 'onFailure', - 'never' + RunToCompletionExecutionPolicy. Possible values include: 'OnFailure', + 'Never' :type restart: str or ~azure.servicefabric.models.RestartPolicy """ @@ -17416,7 +17481,7 @@ class RunToCompletionExecutionPolicy(ExecutionPolicy): def __init__(self, **kwargs): super(RunToCompletionExecutionPolicy, self).__init__(**kwargs) self.restart = kwargs.get('restart', None) - self.type = 'runToCompletion' + self.type = 'RunToCompletion' class SafetyCheckWrapper(Model): @@ -21105,7 +21170,7 @@ class StatelessServiceDescription(ServiceDescription): The endpoint exposed on this instance is removed prior to starting the delay, which prevents new connections to this instance. In addition, clients that have subscribed to service endpoint change - events(https://docs.microsoft.com/en-us/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), + events(https://docs.microsoft.com/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), can do the following upon receiving the endpoint removal notification: - Stop sending new requests to this instance. @@ -21582,7 +21647,7 @@ class StatelessServiceUpdateDescription(ServiceUpdateDescription): The endpoint exposed on this instance is removed prior to starting the delay, which prevents new connections to this instance. In addition, clients that have subscribed to service endpoint change - events(https://docs.microsoft.com/en-us/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), + events(https://docs.microsoft.com/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), can do the following upon receiving the endpoint removal notification: - Stop sending new requests to this instance. diff --git a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_models_py3.py b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_models_py3.py index f1150e325dd1..66eec5039866 100644 --- a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_models_py3.py +++ b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_models_py3.py @@ -1545,10 +1545,10 @@ class ApplicationLoadInfo(Model): For applications that do not have application capacity defined this value will be zero. :type node_count: long - :param application_load_metric_information: List of application capacity - metric description. + :param application_load_metric_information: List of application load + metric information. :type application_load_metric_information: - list[~azure.servicefabric.models.ApplicationMetricDescription] + list[~azure.servicefabric.models.ApplicationLoadMetricInformation] """ _attribute_map = { @@ -1556,7 +1556,7 @@ class ApplicationLoadInfo(Model): 'minimum_nodes': {'key': 'MinimumNodes', 'type': 'long'}, 'maximum_nodes': {'key': 'MaximumNodes', 'type': 'long'}, 'node_count': {'key': 'NodeCount', 'type': 'long'}, - 'application_load_metric_information': {'key': 'ApplicationLoadMetricInformation', 'type': '[ApplicationMetricDescription]'}, + 'application_load_metric_information': {'key': 'ApplicationLoadMetricInformation', 'type': '[ApplicationLoadMetricInformation]'}, } def __init__(self, *, id: str=None, minimum_nodes: int=None, maximum_nodes: int=None, node_count: int=None, application_load_metric_information=None, **kwargs) -> None: @@ -1568,6 +1568,44 @@ def __init__(self, *, id: str=None, minimum_nodes: int=None, maximum_nodes: int= self.application_load_metric_information = application_load_metric_information +class ApplicationLoadMetricInformation(Model): + """Describes load information for a custom resource balancing metric. This can + be used to limit the total consumption of this metric by the services of + this application. + + :param name: The name of the metric. + :type name: str + :param reservation_capacity: This is the capacity reserved in the cluster + for the application. + It's the product of NodeReservationCapacity and MinimumNodes. + If set to zero, no capacity is reserved for this metric. + When setting application capacity or when updating application capacity + this value must be smaller than or equal to MaximumCapacity for each + metric. + :type reservation_capacity: long + :param application_capacity: Total capacity for this metric in this + application instance. + :type application_capacity: long + :param application_load: Current load for this metric in this application + instance. + :type application_load: long + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'reservation_capacity': {'key': 'ReservationCapacity', 'type': 'long'}, + 'application_capacity': {'key': 'ApplicationCapacity', 'type': 'long'}, + 'application_load': {'key': 'ApplicationLoad', 'type': 'long'}, + } + + def __init__(self, *, name: str=None, reservation_capacity: int=None, application_capacity: int=None, application_load: int=None, **kwargs) -> None: + super(ApplicationLoadMetricInformation, self).__init__(**kwargs) + self.name = name + self.reservation_capacity = reservation_capacity + self.application_capacity = application_capacity + self.application_load = application_load + + class ApplicationMetricDescription(Model): """Describes capacity information for a custom resource balancing metric. This can be used to limit the total consumption of this metric by the services @@ -6873,8 +6911,8 @@ class ContainerCodePackageProperties(Model): :param image_registry_credential: Image registry credential. :type image_registry_credential: ~azure.servicefabric.models.ImageRegistryCredential - :param entrypoint: Override for the default entry point in the container. - :type entrypoint: str + :param entry_point: Override for the default entry point in the container. + :type entry_point: str :param commands: Command array to execute within the container in exec form. :type commands: list[str] @@ -6927,7 +6965,7 @@ class ContainerCodePackageProperties(Model): 'name': {'key': 'name', 'type': 'str'}, 'image': {'key': 'image', 'type': 'str'}, 'image_registry_credential': {'key': 'imageRegistryCredential', 'type': 'ImageRegistryCredential'}, - 'entrypoint': {'key': 'entrypoint', 'type': 'str'}, + 'entry_point': {'key': 'entryPoint', 'type': 'str'}, 'commands': {'key': 'commands', 'type': '[str]'}, 'environment_variables': {'key': 'environmentVariables', 'type': '[EnvironmentVariable]'}, 'settings': {'key': 'settings', 'type': '[Setting]'}, @@ -6943,12 +6981,12 @@ class ContainerCodePackageProperties(Model): 'readiness_probe': {'key': 'readinessProbe', 'type': '[Probe]'}, } - def __init__(self, *, name: str, image: str, resources, image_registry_credential=None, entrypoint: str=None, commands=None, environment_variables=None, settings=None, labels=None, endpoints=None, volume_refs=None, volumes=None, diagnostics=None, reliable_collections_refs=None, liveness_probe=None, readiness_probe=None, **kwargs) -> None: + def __init__(self, *, name: str, image: str, resources, image_registry_credential=None, entry_point: str=None, commands=None, environment_variables=None, settings=None, labels=None, endpoints=None, volume_refs=None, volumes=None, diagnostics=None, reliable_collections_refs=None, liveness_probe=None, readiness_probe=None, **kwargs) -> None: super(ContainerCodePackageProperties, self).__init__(**kwargs) self.name = name self.image = image self.image_registry_credential = image_registry_credential - self.entrypoint = entrypoint + self.entry_point = entry_point self.commands = commands self.environment_variables = environment_variables self.settings = settings @@ -7216,6 +7254,57 @@ def __init__(self, *, deactivation_intent=None, **kwargs) -> None: self.deactivation_intent = deactivation_intent +class ExecutionPolicy(Model): + """The execution policy of the service. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DefaultExecutionPolicy, RunToCompletionExecutionPolicy + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Default': 'DefaultExecutionPolicy', 'RunToCompletion': 'RunToCompletionExecutionPolicy'} + } + + def __init__(self, **kwargs) -> None: + super(ExecutionPolicy, self).__init__(**kwargs) + self.type = None + + +class DefaultExecutionPolicy(ExecutionPolicy): + """The default execution policy. Always restart the service if an exit occurs. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DefaultExecutionPolicy, self).__init__(**kwargs) + self.type = 'Default' + + class DeletePropertyBatchOperation(PropertyBatchOperation): """Represents a PropertyBatchOperation that deletes a specified property if it exists. @@ -9569,35 +9658,6 @@ def __init__(self, *, time_stamp_utc, faults=None, **kwargs) -> None: self.kind = 'ExecutingFaults' -class ExecutionPolicy(Model): - """The execution policy of the service. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: RunToCompletionExecutionPolicy - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'runToCompletion': 'RunToCompletionExecutionPolicy'} - } - - def __init__(self, **kwargs) -> None: - super(ExecutionPolicy, self).__init__(**kwargs) - self.type = None - - class ProvisionApplicationTypeDescriptionBase(Model): """Represents the type of registration or provision requested, and if the operation needs to be asynchronous or not. Supported types of provision @@ -11153,14 +11213,14 @@ class ImageStoreInfo(Model): :type used_by_staging: ~azure.servicefabric.models.UsageInfo :param used_by_copy: the ImageStore's file system usage for copied application and cluster packages. [Removing application and cluster - packages](https://docs.microsoft.com/en-us/rest/api/servicefabric/sfclient-api-deleteimagestorecontent) + packages](https://docs.microsoft.com/rest/api/servicefabric/sfclient-api-deleteimagestorecontent) will free up this space. :type used_by_copy: ~azure.servicefabric.models.UsageInfo :param used_by_register: the ImageStore's file system usage for registered and cluster packages. [Unregistering - application](https://docs.microsoft.com/en-us/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) + application](https://docs.microsoft.com/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) and [cluster - packages](https://docs.microsoft.com/en-us/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) + packages](https://docs.microsoft.com/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) will free up this space. :type used_by_register: ~azure.servicefabric.models.UsageInfo """ @@ -15488,18 +15548,19 @@ class Probe(Model): """Probes have a number of fields that you can use to control their behavior. :param initial_delay_seconds: The initial delay in seconds to start - executing probe once code package has started. + executing probe once codepackage has started. Default value: 0 . :type initial_delay_seconds: int - :param period_seconds: Periodic seconds to execute probe. + :param period_seconds: Periodic seconds to execute probe. Default value: + 10 . :type period_seconds: int :param timeout_seconds: Period after which probe is considered as failed - if it hasn't completed successfully. + if it hasn't completed successfully. Default value: 1 . :type timeout_seconds: int :param success_threshold: The count of successful probe executions after - which probe is considered success. + which probe is considered success. Default value: 1 . :type success_threshold: int :param failure_threshold: The count of failures after which probe is - considered failed. + considered failed. Default value: 3 . :type failure_threshold: int :param exec_property: Exec command to run inside the container. :type exec_property: ~azure.servicefabric.models.ProbeExec @@ -15520,7 +15581,7 @@ class Probe(Model): 'tcp_socket': {'key': 'tcpSocket', 'type': 'ProbeTcpSocket'}, } - def __init__(self, *, initial_delay_seconds: int=None, period_seconds: int=None, timeout_seconds: int=None, success_threshold: int=None, failure_threshold: int=None, exec_property=None, http_get=None, tcp_socket=None, **kwargs) -> None: + def __init__(self, *, initial_delay_seconds: int=0, period_seconds: int=10, timeout_seconds: int=1, success_threshold: int=1, failure_threshold: int=3, exec_property=None, http_get=None, tcp_socket=None, **kwargs) -> None: super(Probe, self).__init__(**kwargs) self.initial_delay_seconds = initial_delay_seconds self.period_seconds = period_seconds @@ -17391,15 +17452,19 @@ def __init__(self, *, rolling_upgrade_mode="UnmonitoredAuto", force_restart: boo class RunToCompletionExecutionPolicy(ExecutionPolicy): - """The run to completion execution policy. + """The run to completion execution policy, the service will perform its + desired operation and complete successfully. If the service encounters + failure, it will restarted based on restart policy specified. If the + service completes its operation successfully, it will not be restarted + again. All required parameters must be populated in order to send to Azure. :param type: Required. Constant filled by server. :type type: str :param restart: Required. Enumerates the restart policy for - RunToCompletionExecutionPolicy. Possible values include: 'onFailure', - 'never' + RunToCompletionExecutionPolicy. Possible values include: 'OnFailure', + 'Never' :type restart: str or ~azure.servicefabric.models.RestartPolicy """ @@ -17416,7 +17481,7 @@ class RunToCompletionExecutionPolicy(ExecutionPolicy): def __init__(self, *, restart, **kwargs) -> None: super(RunToCompletionExecutionPolicy, self).__init__(**kwargs) self.restart = restart - self.type = 'runToCompletion' + self.type = 'RunToCompletion' class SafetyCheckWrapper(Model): @@ -21105,7 +21170,7 @@ class StatelessServiceDescription(ServiceDescription): The endpoint exposed on this instance is removed prior to starting the delay, which prevents new connections to this instance. In addition, clients that have subscribed to service endpoint change - events(https://docs.microsoft.com/en-us/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), + events(https://docs.microsoft.com/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), can do the following upon receiving the endpoint removal notification: - Stop sending new requests to this instance. @@ -21582,7 +21647,7 @@ class StatelessServiceUpdateDescription(ServiceUpdateDescription): The endpoint exposed on this instance is removed prior to starting the delay, which prevents new connections to this instance. In addition, clients that have subscribed to service endpoint change - events(https://docs.microsoft.com/en-us/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), + events(https://docs.microsoft.com/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), can do the following upon receiving the endpoint removal notification: - Stop sending new requests to this instance. diff --git a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_service_fabric_client_ap_is_enums.py b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_service_fabric_client_ap_is_enums.py index 6998f312e37d..ed96764ff68e 100644 --- a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_service_fabric_client_ap_is_enums.py +++ b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/models/_service_fabric_client_ap_is_enums.py @@ -1020,13 +1020,14 @@ class AutoScalingTriggerKind(str, Enum): class ExecutionPolicyType(str, Enum): - run_to_completion = "runToCompletion" #: Indicates that the service will perform its desired operation and complete successfully. If the service encounters failure, it will restarted based on restart policy specified. If the service completes its operation successfully, it will not be restarted again. + default = "Default" #: Indicates the default execution policy, always restart the service if an exit occurs. + run_to_completion = "RunToCompletion" #: Indicates that the service will perform its desired operation and complete successfully. If the service encounters failure, it will restarted based on restart policy specified. If the service completes its operation successfully, it will not be restarted again. class RestartPolicy(str, Enum): - on_failure = "onFailure" #: Service will be restarted when it encounters a failure. - never = "never" #: Service will never be restarted. If the service encounters a failure, it will move to Failed state. + on_failure = "OnFailure" #: Service will be restarted when it encounters a failure. + never = "Never" #: Service will never be restarted. If the service encounters a failure, it will move to Failed state. class NodeStatusFilter(str, Enum): diff --git a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/operations/_service_fabric_client_ap_is_operations.py b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/operations/_service_fabric_client_ap_is_operations.py index 577f731f7b69..28ef749c2ff5 100644 --- a/sdk/servicefabric/azure-servicefabric/azure/servicefabric/operations/_service_fabric_client_ap_is_operations.py +++ b/sdk/servicefabric/azure-servicefabric/azure/servicefabric/operations/_service_fabric_client_ap_is_operations.py @@ -2441,7 +2441,7 @@ def remove_node_state( this. For standalone cluster, if the Down seed node is not expected to come back up with its state intact, please remove the node from the cluster, see - https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-windows-server-add-remove-nodes. + https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-windows-server-add-remove-nodes. :param node_name: The name of the node. :type node_name: str diff --git a/sdk/servicefabric/azure-servicefabric/setup.py b/sdk/servicefabric/azure-servicefabric/setup.py index 5d707929c515..82cdcf6db086 100644 --- a/sdk/servicefabric/azure-servicefabric/setup.py +++ b/sdk/servicefabric/azure-servicefabric/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -67,6 +69,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False,