diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json b/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json
index 52966516080f..917b51167750 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json
@@ -1,11 +1,11 @@
{
- "commit": "cfe318beba82c1e5bda6a600f91de32cba814364",
+ "commit": "dae14b6ee91d684959c7ea00ad41e7b22c9a20aa",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
- "@autorest/python@6.19.0",
+ "@autorest/python@6.27.4",
"@autorest/modelerfour@4.27.0"
],
- "autorest_command": "autorest specification/containerinstance/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
+ "autorest_command": "autorest specification/containerinstance/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/containerinstance/resource-manager/readme.md"
}
\ No newline at end of file
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/__init__.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/__init__.py
index f2940eb2b25d..754b06db49f1 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/__init__.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/__init__.py
@@ -5,15 +5,21 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._container_instance_management_client import ContainerInstanceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._container_instance_management_client import ContainerInstanceManagementClient # type: ignore
from ._version import VERSION
__version__ = VERSION
try:
from ._patch import __all__ as _patch_all
- from ._patch import * # pylint: disable=unused-wildcard-import
+ from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
@@ -21,6 +27,6 @@
__all__ = [
"ContainerInstanceManagementClient",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py
index 79ddd479831a..1e6f1a99fcc8 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
@@ -28,13 +27,13 @@ class ContainerInstanceManagementClientConfiguration: # pylint: disable=too-man
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
- :keyword api_version: Api Version. Default value is "2024-05-01-preview". Note that overriding
+ :keyword api_version: Api Version. Default value is "2024-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
- api_version: str = kwargs.pop("api_version", "2024-05-01-preview")
+ api_version: str = kwargs.pop("api_version", "2024-11-01-preview")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_container_instance_management_client.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_container_instance_management_client.py
index b3dceda732e2..90a846d7631b 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_container_instance_management_client.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_container_instance_management_client.py
@@ -19,21 +19,21 @@
from ._configuration import ContainerInstanceManagementClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
- ContainerGroupProfileOperations,
- ContainerGroupProfilesOperations,
+ CGProfileOperations,
+ CGProfilesOperations,
ContainerGroupsOperations,
ContainersOperations,
LocationOperations,
+ NGroupsOperations,
Operations,
SubnetServiceAssociationLinkOperations,
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ContainerInstanceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ContainerInstanceManagementClient: # pylint: disable=too-many-instance-attributes
"""ContainerInstanceManagementClient.
:ivar container_groups: ContainerGroupsOperations operations
@@ -47,19 +47,19 @@ class ContainerInstanceManagementClient: # pylint: disable=client-accepts-api-v
:ivar subnet_service_association_link: SubnetServiceAssociationLinkOperations operations
:vartype subnet_service_association_link:
azure.mgmt.containerinstance.operations.SubnetServiceAssociationLinkOperations
- :ivar container_group_profiles: ContainerGroupProfilesOperations operations
- :vartype container_group_profiles:
- azure.mgmt.containerinstance.operations.ContainerGroupProfilesOperations
- :ivar container_group_profile: ContainerGroupProfileOperations operations
- :vartype container_group_profile:
- azure.mgmt.containerinstance.operations.ContainerGroupProfileOperations
+ :ivar ngroups: NGroupsOperations operations
+ :vartype ngroups: azure.mgmt.containerinstance.operations.NGroupsOperations
+ :ivar cg_profiles: CGProfilesOperations operations
+ :vartype cg_profiles: azure.mgmt.containerinstance.operations.CGProfilesOperations
+ :ivar cg_profile: CGProfileOperations operations
+ :vartype cg_profile: azure.mgmt.containerinstance.operations.CGProfileOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2024-05-01-preview". Note that overriding
+ :keyword api_version: Api Version. Default value is "2024-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -109,12 +109,9 @@ def __init__(
self.subnet_service_association_link = SubnetServiceAssociationLinkOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.container_group_profiles = ContainerGroupProfilesOperations(
- self._client, self._config, self._serialize, self._deserialize
- )
- self.container_group_profile = ContainerGroupProfileOperations(
- self._client, self._config, self._serialize, self._deserialize
- )
+ self.ngroups = NGroupsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.cg_profiles = CGProfilesOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.cg_profile = CGProfileOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_serialization.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_serialization.py
index 8139854b97bb..b24ab2885450 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_serialization.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_serialization.py
@@ -1,3 +1,4 @@
+# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -24,7 +25,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +52,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +90,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type:
:param data: Input, could be bytes or stream (will be decoded with UTF8) or text
:type data: str or bytes or IO
:param str content_type: The content type.
+ :return: The deserialized data.
+ :rtype: object
"""
if hasattr(data, "read"):
# Assume a stream
@@ -112,7 +113,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type:
try:
return json.loads(data_as_str)
except ValueError as err:
- raise DeserializationError("JSON is invalid: {}".format(err), err)
+ raise DeserializationError("JSON is invalid: {}".format(err), err) from err
elif "xml" in (content_type or []):
try:
@@ -155,6 +156,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +190,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +256,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +330,23 @@ def __init__(self, **kwargs: Any) -> None:
setattr(self, k, kwargs[k])
def __eq__(self, other: Any) -> bool:
- """Compare objects by comparing all attributes."""
+ """Compare objects by comparing all attributes.
+
+ :param object other: The object to compare
+ :returns: True if objects are equal
+ :rtype: bool
+ """
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__
return False
def __ne__(self, other: Any) -> bool:
- """Compare objects by comparing all attributes."""
+ """Compare objects by comparing all attributes.
+
+ :param object other: The object to compare
+ :returns: True if objects are not equal
+ :rtype: bool
+ """
return not self.__eq__(other)
def __str__(self) -> str:
@@ -326,7 +366,11 @@ def is_xml_model(cls) -> bool:
@classmethod
def _create_xml_node(cls):
- """Create XML node."""
+ """Create XML node.
+
+ :returns: The XML node
+ :rtype: xml.etree.ElementTree.Element
+ """
try:
xml_map = cls._xml_map # type: ignore
except AttributeError:
@@ -346,7 +390,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON:
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
- return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore
+ return serializer._serialize( # type: ignore # pylint: disable=protected-access
+ self, keep_readonly=keep_readonly, **kwargs
+ )
def as_dict(
self,
@@ -380,12 +426,15 @@ def my_key_transformer(key, attr_desc, value):
If you want XML serialization, you can pass the kwargs is_xml=True.
+ :param bool keep_readonly: If you want to serialize the readonly attributes
:param function key_transformer: A key transformer function.
:returns: A dict JSON compatible object
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
- return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore
+ return serializer._serialize( # type: ignore # pylint: disable=protected-access
+ self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs
+ )
@classmethod
def _infer_class_models(cls):
@@ -395,7 +444,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -408,6 +457,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -426,9 +476,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -448,21 +500,25 @@ def _flatten_subtype(cls, key, objects):
return {}
result = dict(cls._subtype_map[key])
for valuetype in cls._subtype_map[key].values():
- result.update(objects[valuetype]._flatten_subtype(key, objects))
+ result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access
return result
@classmethod
def _classify(cls, response, objects):
"""Check the class _subtype_map for any child classes.
We want to ignore any inherited _subtype_maps.
- Remove the polymorphic key from the initial data.
+
+ :param dict response: The initial data
+ :param dict objects: The class objects
+ :returns: The class to be used
+ :rtype: class
"""
for subtype_key in cls.__dict__.get("_subtype_map", {}).keys():
subtype_value = None
if not isinstance(response, ET.Element):
rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1]
- subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None)
+ subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None)
else:
subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response)
if subtype_value:
@@ -501,11 +557,13 @@ def _decode_attribute_map_key(key):
inside the received data.
:param str key: A key string from the generated code
+ :returns: The decoded key
+ :rtype: str
"""
return key.replace("\\.", ".")
-class Serializer(object):
+class Serializer: # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -540,7 +598,7 @@ class Serializer(object):
"multiple": lambda x, y: x % y != 0,
}
- def __init__(self, classes: Optional[Mapping[str, type]] = None):
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
self.serialize_type = {
"iso-8601": Serializer.serialize_iso,
"rfc-1123": Serializer.serialize_rfc,
@@ -560,13 +618,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -592,12 +653,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
serialized = {}
if is_xml_model_serialization:
- serialized = target_obj._create_xml_node()
+ serialized = target_obj._create_xml_node() # pylint: disable=protected-access
try:
- attributes = target_obj._attribute_map
+ attributes = target_obj._attribute_map # pylint: disable=protected-access
for attr, attr_desc in attributes.items():
attr_name = attr
- if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False):
+ if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access
+ attr_name, {}
+ ).get("readonly", False):
continue
if attr_name == "additional_properties" and attr_desc["key"] == "":
@@ -633,7 +696,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
if isinstance(new_attr, list):
serialized.extend(new_attr) # type: ignore
elif isinstance(new_attr, ET.Element):
- # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces.
+ # If the down XML has no XML/Name,
+ # we MUST replace the tag with the local tag. But keeping the namespaces.
if "name" not in getattr(orig_attr, "_xml_map", {}):
splitted_tag = new_attr.tag.split("}")
if len(splitted_tag) == 2: # Namespace
@@ -664,17 +728,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -703,7 +767,7 @@ def body(self, data, data_type, **kwargs):
attribute_key_case_insensitive_extractor,
last_rest_key_case_insensitive_extractor,
]
- data = deserializer._deserialize(data_type, data)
+ data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access
except DeserializationError as err:
raise SerializationError("Unable to build a model: " + str(err)) from err
@@ -712,9 +776,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -728,21 +794,20 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
@@ -759,19 +824,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -780,21 +846,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -805,7 +870,7 @@ def serialize_data(self, data, data_type, **kwargs):
if data_type in self.basic_types.values():
return self.serialize_basic(data, data_type, **kwargs)
- elif data_type in self.serialize_type:
+ if data_type in self.serialize_type:
return self.serialize_type[data_type](data, **kwargs)
# If dependencies is empty, try with current data class
@@ -821,11 +886,10 @@ def serialize_data(self, data, data_type, **kwargs):
except (ValueError, TypeError) as err:
msg = "Unable to serialize value: {!r} as type: {!r}."
raise SerializationError(msg.format(data, data_type)) from err
- else:
- return self._serialize(data, **kwargs)
+ return self._serialize(data, **kwargs)
@classmethod
- def _get_custom_serializers(cls, data_type, **kwargs):
+ def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements
custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type)
if custom_serializer:
return custom_serializer
@@ -841,23 +905,26 @@ def serialize_basic(cls, data, data_type, **kwargs):
- basic_types_serializers dict[str, callable] : If set, use the callable as serializer
- is_xml bool : If set, use xml_basic_types_serializers
- :param data: Object to be serialized.
+ :param obj data: Object to be serialized.
:param str data_type: Type of object in the iterable.
+ :rtype: str, int, float, bool
+ :return: serialized object
"""
custom_serializer = cls._get_custom_serializers(data_type, **kwargs)
if custom_serializer:
return custom_serializer(data)
if data_type == "str":
return cls.serialize_unicode(data)
- return eval(data_type)(data) # nosec
+ return eval(data_type)(data) # nosec # pylint: disable=eval-used
@classmethod
def serialize_unicode(cls, data):
"""Special handling for serializing unicode strings in Py2.
Encode to UTF-8 if unicode, otherwise handle as a str.
- :param data: Object to be serialized.
+ :param str data: Object to be serialized.
:rtype: str
+ :return: serialized object
"""
try: # If I received an enum, return its value
return data.value
@@ -871,8 +938,7 @@ def serialize_unicode(cls, data):
return data
except NameError:
return str(data)
- else:
- return str(data)
+ return str(data)
def serialize_iter(self, data, iter_type, div=None, **kwargs):
"""Serialize iterable.
@@ -882,15 +948,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
serialization_ctxt['type'] should be same as data_type.
- is_xml bool : If set, serialize as XML
- :param list attr: Object to be serialized.
+ :param list data: Object to be serialized.
:param str iter_type: Type of object in the iterable.
- :param bool required: Whether the objects in the iterable must
- not be None or empty.
:param str div: If set, this str will be used to combine the elements
in the iterable into a combined string. Default is 'None'.
- :keyword bool do_quote: Whether to quote the serialized result of each iterable element.
Defaults to False.
:rtype: list, str
+ :return: serialized iterable
"""
if isinstance(data, str):
raise SerializationError("Refuse str type as a valid iter type.")
@@ -945,9 +1009,8 @@ def serialize_dict(self, attr, dict_type, **kwargs):
:param dict attr: Object to be serialized.
:param str dict_type: Type of object in the dictionary.
- :param bool required: Whether the objects in the dictionary must
- not be None or empty.
:rtype: dict
+ :return: serialized dictionary
"""
serialization_ctxt = kwargs.get("serialization_ctxt", {})
serialized = {}
@@ -971,7 +1034,7 @@ def serialize_dict(self, attr, dict_type, **kwargs):
return serialized
- def serialize_object(self, attr, **kwargs):
+ def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Serialize a generic object.
This will be handled as a dictionary. If object passed in is not
a basic type (str, int, float, dict, list) it will simply be
@@ -979,6 +1042,7 @@ def serialize_object(self, attr, **kwargs):
:param dict attr: Object to be serialized.
:rtype: dict or str
+ :return: serialized object
"""
if attr is None:
return None
@@ -1003,7 +1067,7 @@ def serialize_object(self, attr, **kwargs):
return self.serialize_decimal(attr)
# If it's a model or I know this dependency, serialize as a Model
- elif obj_type in self.dependencies.values() or isinstance(attr, Model):
+ if obj_type in self.dependencies.values() or isinstance(attr, Model):
return self._serialize(attr)
if obj_type == dict:
@@ -1034,56 +1098,61 @@ def serialize_enum(attr, enum_obj=None):
try:
enum_obj(result) # type: ignore
return result
- except ValueError:
+ except ValueError as exc:
for enum_value in enum_obj: # type: ignore
if enum_value.value.lower() == str(attr).lower():
return enum_value.value
error = "{!r} is not valid value for enum {!r}"
- raise SerializationError(error.format(attr, enum_obj))
+ raise SerializationError(error.format(attr, enum_obj)) from exc
@staticmethod
- def serialize_bytearray(attr, **kwargs):
+ def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize bytearray into base-64 string.
- :param attr: Object to be serialized.
+ :param str attr: Object to be serialized.
:rtype: str
+ :return: serialized base64
"""
return b64encode(attr).decode()
@staticmethod
- def serialize_base64(attr, **kwargs):
+ def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize str into base-64 string.
- :param attr: Object to be serialized.
+ :param str attr: Object to be serialized.
:rtype: str
+ :return: serialized base64
"""
encoded = b64encode(attr).decode("ascii")
return encoded.strip("=").replace("+", "-").replace("/", "_")
@staticmethod
- def serialize_decimal(attr, **kwargs):
+ def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Decimal object to float.
- :param attr: Object to be serialized.
+ :param decimal attr: Object to be serialized.
:rtype: float
+ :return: serialized decimal
"""
return float(attr)
@staticmethod
- def serialize_long(attr, **kwargs):
+ def serialize_long(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize long (Py2) or int (Py3).
- :param attr: Object to be serialized.
+ :param int attr: Object to be serialized.
:rtype: int/long
+ :return: serialized long
"""
return _long_type(attr)
@staticmethod
- def serialize_date(attr, **kwargs):
+ def serialize_date(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Date object into ISO-8601 formatted string.
:param Date attr: Object to be serialized.
:rtype: str
+ :return: serialized date
"""
if isinstance(attr, str):
attr = isodate.parse_date(attr)
@@ -1091,11 +1160,12 @@ def serialize_date(attr, **kwargs):
return t
@staticmethod
- def serialize_time(attr, **kwargs):
+ def serialize_time(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Time object into ISO-8601 formatted string.
:param datetime.time attr: Object to be serialized.
:rtype: str
+ :return: serialized time
"""
if isinstance(attr, str):
attr = isodate.parse_time(attr)
@@ -1105,30 +1175,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1141,12 +1213,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1172,13 +1245,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1186,11 +1260,11 @@ def serialize_unix(attr, **kwargs):
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
return int(calendar.timegm(attr.utctimetuple()))
- except AttributeError:
- raise TypeError("Unix time object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("Unix time object must be valid Datetime object.") from exc
-def rest_key_extractor(attr, attr_desc, data):
+def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
key = attr_desc["key"]
working_data = data
@@ -1211,7 +1285,9 @@ def rest_key_extractor(attr, attr_desc, data):
return working_data.get(key)
-def rest_key_case_insensitive_extractor(attr, attr_desc, data):
+def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements
+ attr, attr_desc, data
+):
key = attr_desc["key"]
working_data = data
@@ -1232,17 +1308,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data):
return attribute_key_case_insensitive_extractor(key, None, working_data)
-def last_rest_key_extractor(attr, attr_desc, data):
- """Extract the attribute in "data" based on the last part of the JSON path key."""
+def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
+ """Extract the attribute in "data" based on the last part of the JSON path key.
+
+ :param str attr: The attribute to extract
+ :param dict attr_desc: The attribute description
+ :param dict data: The data to extract from
+ :rtype: object
+ :returns: The extracted attribute
+ """
key = attr_desc["key"]
dict_keys = _FLATTEN.split(key)
return attribute_key_extractor(dict_keys[-1], None, data)
-def last_rest_key_case_insensitive_extractor(attr, attr_desc, data):
+def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
"""Extract the attribute in "data" based on the last part of the JSON path key.
This is the case insensitive version of "last_rest_key_extractor"
+ :param str attr: The attribute to extract
+ :param dict attr_desc: The attribute description
+ :param dict data: The data to extract from
+ :rtype: object
+ :returns: The extracted attribute
"""
key = attr_desc["key"]
dict_keys = _FLATTEN.split(key)
@@ -1279,7 +1367,7 @@ def _extract_name_from_internal_type(internal_type):
return xml_name
-def xml_key_extractor(attr, attr_desc, data):
+def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements
if isinstance(data, dict):
return None
@@ -1331,22 +1419,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1354,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data):
return children[0]
-class Deserializer(object):
+class Deserializer:
"""Response object model deserializer.
:param dict classes: Class type dictionary for deserializing complex types.
@@ -1363,9 +1450,9 @@ class Deserializer(object):
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
- valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
+ valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
- def __init__(self, classes: Optional[Mapping[str, type]] = None):
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
self.deserialize_type = {
"iso-8601": Deserializer.deserialize_iso,
"rfc-1123": Deserializer.deserialize_rfc,
@@ -1403,11 +1490,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1416,12 +1504,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1440,13 +1529,13 @@ def _deserialize(self, target_obj, data):
if isinstance(response, str):
return self.deserialize_data(data, response)
- elif isinstance(response, type) and issubclass(response, Enum):
+ if isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)
if data is None or data is CoreNull:
return data
try:
- attributes = response._attribute_map # type: ignore
+ attributes = response._attribute_map # type: ignore # pylint: disable=protected-access
d_attrs = {}
for attr, attr_desc in attributes.items():
# Check empty string. If it's not empty, someone has a real "additionalProperties"...
@@ -1476,9 +1565,8 @@ def _deserialize(self, target_obj, data):
except (AttributeError, TypeError, KeyError) as err:
msg = "Unable to deserialize to object: " + class_name # type: ignore
raise DeserializationError(msg) from err
- else:
- additional_properties = self._build_additional_properties(attributes, data)
- return self._instantiate_model(response, d_attrs, additional_properties)
+ additional_properties = self._build_additional_properties(attributes, data)
+ return self._instantiate_model(response, d_attrs, additional_properties)
def _build_additional_properties(self, attribute_map, data):
if not self.additional_properties_detection:
@@ -1505,6 +1593,8 @@ def _classify_target(self, target, data):
:param str target: The target object type to deserialize to.
:param str/dict data: The response data to deserialize.
+ :return: The classified target object and its class name.
+ :rtype: tuple
"""
if target is None:
return None, None
@@ -1516,7 +1606,7 @@ def _classify_target(self, target, data):
return target, target
try:
- target = target._classify(data, self.dependencies) # type: ignore
+ target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access
except AttributeError:
pass # Target is not a Model, no classify
return target, target.__class__.__name__ # type: ignore
@@ -1531,10 +1621,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None):
:param str target_obj: The target object type to deserialize to.
:param str/dict data: The response data to deserialize.
:param str content_type: Swagger "produces" if available.
+ :return: Deserialized object.
+ :rtype: object
"""
try:
return self(target_obj, data, content_type=content_type)
- except:
+ except: # pylint: disable=bare-except
_LOGGER.debug(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
@@ -1552,10 +1644,12 @@ def _unpack_content(raw_data, content_type=None):
If raw_data is something else, bypass all logic and return it directly.
- :param raw_data: Data to be processed.
- :param content_type: How to parse if raw_data is a string/bytes.
+ :param obj raw_data: Data to be processed.
+ :param str content_type: How to parse if raw_data is a string/bytes.
:raises JSONDecodeError: If JSON is requested and parsing is impossible.
:raises UnicodeDecodeError: If bytes is not UTF8
+ :rtype: object
+ :return: Unpacked content.
"""
# Assume this is enough to detect a Pipeline Response without importing it
context = getattr(raw_data, "context", {})
@@ -1579,24 +1673,35 @@ def _unpack_content(raw_data, content_type=None):
def _instantiate_model(self, response, attrs, additional_properties=None):
"""Instantiate a response model passing in deserialized args.
- :param response: The response model class.
- :param d_attrs: The deserialized response attributes.
+ :param Response response: The response model class.
+ :param dict attrs: The deserialized response attributes.
+ :param dict additional_properties: Additional properties to be set.
+ :rtype: Response
+ :return: The instantiated response model.
"""
if callable(response):
subtype = getattr(response, "_subtype_map", {})
try:
- readonly = [k for k, v in response._validation.items() if v.get("readonly")]
- const = [k for k, v in response._validation.items() if v.get("constant")]
+ readonly = [
+ k
+ for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
+ if v.get("readonly")
+ ]
+ const = [
+ k
+ for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
+ if v.get("constant")
+ ]
kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const}
response_obj = response(**kwargs)
for attr in readonly:
setattr(response_obj, attr, attrs.get(attr))
if additional_properties:
- response_obj.additional_properties = additional_properties
+ response_obj.additional_properties = additional_properties # type: ignore
return response_obj
except TypeError as err:
msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore
- raise DeserializationError(msg + str(err))
+ raise DeserializationError(msg + str(err)) from err
else:
try:
for attr, value in attrs.items():
@@ -1605,15 +1710,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1627,7 +1733,11 @@ def deserialize_data(self, data, data_type):
if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())):
return data
- is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"]
+ is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment
+ "object",
+ "[]",
+ r"{}",
+ ]
if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text:
return None
data_val = self.deserialize_type[data_type](data)
@@ -1647,14 +1757,14 @@ def deserialize_data(self, data, data_type):
msg = "Unable to deserialize response data."
msg += " Data: {}, {}".format(data, data_type)
raise DeserializationError(msg) from err
- else:
- return self._deserialize(obj_type, data)
+ return self._deserialize(obj_type, data)
def deserialize_iter(self, attr, iter_type):
"""Deserialize an iterable.
:param list attr: Iterable to be deserialized.
:param str iter_type: The type of object in the iterable.
+ :return: Deserialized iterable.
:rtype: list
"""
if attr is None:
@@ -1671,6 +1781,7 @@ def deserialize_dict(self, attr, dict_type):
:param dict/list attr: Dictionary to be deserialized. Also accepts
a list of key, value pairs.
:param str dict_type: The object type of the items in the dictionary.
+ :return: Deserialized dictionary.
:rtype: dict
"""
if isinstance(attr, list):
@@ -1681,11 +1792,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1720,11 +1832,10 @@ def deserialize_object(self, attr, **kwargs):
pass
return deserialized
- else:
- error = "Cannot deserialize generic object with type: "
- raise TypeError(error + str(obj_type))
+ error = "Cannot deserialize generic object with type: "
+ raise TypeError(error + str(obj_type))
- def deserialize_basic(self, attr, data_type):
+ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements
"""Deserialize basic builtin data type from string.
Will attempt to convert to str, int, float and bool.
This function will also accept '1', '0', 'true' and 'false' as
@@ -1732,6 +1843,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1743,24 +1855,23 @@ def deserialize_basic(self, attr, data_type):
if data_type == "str":
# None or '', node is empty string.
return ""
- else:
- # None or '', node with a strong type is None.
- # Don't try to model "empty bool" or "empty int"
- return None
+ # None or '', node with a strong type is None.
+ # Don't try to model "empty bool" or "empty int"
+ return None
if data_type == "bool":
if attr in [True, False, 1, 0]:
return bool(attr)
- elif isinstance(attr, str):
+ if isinstance(attr, str):
if attr.lower() in ["true", "1"]:
return True
- elif attr.lower() in ["false", "0"]:
+ if attr.lower() in ["false", "0"]:
return False
raise TypeError("Invalid boolean value: {}".format(attr))
if data_type == "str":
return self.deserialize_unicode(attr)
- return eval(data_type)(attr) # nosec
+ return eval(data_type)(attr) # nosec # pylint: disable=eval-used
@staticmethod
def deserialize_unicode(data):
@@ -1768,6 +1879,7 @@ def deserialize_unicode(data):
as a string.
:param str data: response string to be deserialized.
+ :return: Deserialized string.
:rtype: str or unicode
"""
# We might be here because we have an enum modeled as string,
@@ -1781,8 +1893,7 @@ def deserialize_unicode(data):
return data
except NameError:
return str(data)
- else:
- return str(data)
+ return str(data)
@staticmethod
def deserialize_enum(data, enum_obj):
@@ -1794,6 +1905,7 @@ def deserialize_enum(data, enum_obj):
:param str data: Response string to be deserialized. If this value is
None or invalid it will be returned as-is.
:param Enum enum_obj: Enum object to deserialize to.
+ :return: Deserialized enum object.
:rtype: Enum
"""
if isinstance(data, enum_obj) or data is None:
@@ -1804,9 +1916,9 @@ def deserialize_enum(data, enum_obj):
# Workaround. We might consider remove it in the future.
try:
return list(enum_obj.__members__.values())[data]
- except IndexError:
+ except IndexError as exc:
error = "{!r} is not a valid index for enum {!r}"
- raise DeserializationError(error.format(data, enum_obj))
+ raise DeserializationError(error.format(data, enum_obj)) from exc
try:
return enum_obj(str(data))
except ValueError:
@@ -1822,6 +1934,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1834,6 +1947,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1849,8 +1963,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1865,6 +1980,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1877,6 +1993,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1887,14 +2004,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1910,6 +2027,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1924,6 +2042,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1939,14 +2058,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1976,8 +2095,7 @@ def deserialize_iso(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_unix(attr):
@@ -1985,6 +2103,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -1996,5 +2115,4 @@ def deserialize_unix(attr):
except ValueError as err:
msg = "Cannot deserialize to unix datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py
index a1e5cf8bc16e..e5754a47ce68 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "10.2.0b1"
+VERSION = "1.0.0b1"
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/__init__.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/__init__.py
index 381be0edd916..bcb1c4cb2f6a 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/__init__.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/__init__.py
@@ -5,12 +5,18 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._container_instance_management_client import ContainerInstanceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._container_instance_management_client import ContainerInstanceManagementClient # type: ignore
try:
from ._patch import __all__ as _patch_all
- from ._patch import * # pylint: disable=unused-wildcard-import
+ from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
@@ -18,6 +24,6 @@
__all__ = [
"ContainerInstanceManagementClient",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py
index fb8c3202e245..655a18a9824a 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
@@ -28,13 +27,13 @@ class ContainerInstanceManagementClientConfiguration: # pylint: disable=too-man
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
- :keyword api_version: Api Version. Default value is "2024-05-01-preview". Note that overriding
+ :keyword api_version: Api Version. Default value is "2024-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
- api_version: str = kwargs.pop("api_version", "2024-05-01-preview")
+ api_version: str = kwargs.pop("api_version", "2024-11-01-preview")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_container_instance_management_client.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_container_instance_management_client.py
index da75152b0ce7..dc53da7413a1 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_container_instance_management_client.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_container_instance_management_client.py
@@ -19,21 +19,21 @@
from .._serialization import Deserializer, Serializer
from ._configuration import ContainerInstanceManagementClientConfiguration
from .operations import (
- ContainerGroupProfileOperations,
- ContainerGroupProfilesOperations,
+ CGProfileOperations,
+ CGProfilesOperations,
ContainerGroupsOperations,
ContainersOperations,
LocationOperations,
+ NGroupsOperations,
Operations,
SubnetServiceAssociationLinkOperations,
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ContainerInstanceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ContainerInstanceManagementClient: # pylint: disable=too-many-instance-attributes
"""ContainerInstanceManagementClient.
:ivar container_groups: ContainerGroupsOperations operations
@@ -48,19 +48,19 @@ class ContainerInstanceManagementClient: # pylint: disable=client-accepts-api-v
:ivar subnet_service_association_link: SubnetServiceAssociationLinkOperations operations
:vartype subnet_service_association_link:
azure.mgmt.containerinstance.aio.operations.SubnetServiceAssociationLinkOperations
- :ivar container_group_profiles: ContainerGroupProfilesOperations operations
- :vartype container_group_profiles:
- azure.mgmt.containerinstance.aio.operations.ContainerGroupProfilesOperations
- :ivar container_group_profile: ContainerGroupProfileOperations operations
- :vartype container_group_profile:
- azure.mgmt.containerinstance.aio.operations.ContainerGroupProfileOperations
+ :ivar ngroups: NGroupsOperations operations
+ :vartype ngroups: azure.mgmt.containerinstance.aio.operations.NGroupsOperations
+ :ivar cg_profiles: CGProfilesOperations operations
+ :vartype cg_profiles: azure.mgmt.containerinstance.aio.operations.CGProfilesOperations
+ :ivar cg_profile: CGProfileOperations operations
+ :vartype cg_profile: azure.mgmt.containerinstance.aio.operations.CGProfileOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2024-05-01-preview". Note that overriding
+ :keyword api_version: Api Version. Default value is "2024-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -110,12 +110,9 @@ def __init__(
self.subnet_service_association_link = SubnetServiceAssociationLinkOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.container_group_profiles = ContainerGroupProfilesOperations(
- self._client, self._config, self._serialize, self._deserialize
- )
- self.container_group_profile = ContainerGroupProfileOperations(
- self._client, self._config, self._serialize, self._deserialize
- )
+ self.ngroups = NGroupsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.cg_profiles = CGProfilesOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.cg_profile = CGProfileOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/__init__.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/__init__.py
index 7120d9b773f9..88d90a09aa65 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/__init__.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/__init__.py
@@ -5,17 +5,24 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._container_groups_operations import ContainerGroupsOperations
-from ._operations import Operations
-from ._location_operations import LocationOperations
-from ._containers_operations import ContainersOperations
-from ._subnet_service_association_link_operations import SubnetServiceAssociationLinkOperations
-from ._container_group_profiles_operations import ContainerGroupProfilesOperations
-from ._container_group_profile_operations import ContainerGroupProfileOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._container_groups_operations import ContainerGroupsOperations # type: ignore
+from ._operations import Operations # type: ignore
+from ._location_operations import LocationOperations # type: ignore
+from ._containers_operations import ContainersOperations # type: ignore
+from ._subnet_service_association_link_operations import SubnetServiceAssociationLinkOperations # type: ignore
+from ._ngroups_operations import NGroupsOperations # type: ignore
+from ._cg_profiles_operations import CGProfilesOperations # type: ignore
+from ._cg_profile_operations import CGProfileOperations # type: ignore
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -24,8 +31,9 @@
"LocationOperations",
"ContainersOperations",
"SubnetServiceAssociationLinkOperations",
- "ContainerGroupProfilesOperations",
- "ContainerGroupProfileOperations",
+ "NGroupsOperations",
+ "CGProfilesOperations",
+ "CGProfileOperations",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_group_profiles_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_cg_profile_operations.py
similarity index 65%
rename from sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_group_profiles_operations.py
rename to sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_cg_profile_operations.py
index 3771af415361..fa3a8637cbac 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_group_profiles_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_cg_profile_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -18,41 +17,45 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
+from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
from ... import models as _models
-from ...operations._container_group_profiles_operations import (
+from ...operations._cg_profile_operations import (
build_create_or_update_request,
build_delete_request,
+ build_get_by_revision_number_request,
build_get_request,
- build_list_by_resource_group_request,
- build_list_request,
- build_patch_request,
+ build_list_all_revisions_request,
+ build_update_request,
)
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class ContainerGroupProfilesOperations:
+class CGProfileOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.containerinstance.aio.ContainerInstanceManagementClient`'s
- :attr:`container_group_profiles` attribute.
+ :attr:`cg_profile` attribute.
"""
models = _models
@@ -64,235 +67,6 @@ def __init__(self, *args, **kwargs) -> None:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
- @distributed_trace
- def list(self, **kwargs: Any) -> AsyncIterable["_models.ContainerGroupProfile"]:
- """Get a list of container group profiles in the specified subscription.
-
- Get a list of container group profiles in the specified subscription. This operation returns
- properties of each container group profile including containers, image registry credentials,
- restart policy, IP address type, OS type,volumes,current revision number, etc.
-
- :return: An iterator like instance of either ContainerGroupProfile or the result of
- cls(response)
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[_models.ContainerGroupProfileListResult] = kwargs.pop("cls", None)
-
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- def prepare_request(next_link=None):
- if not next_link:
-
- _request = build_list_request(
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- _request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- _request.url = self._client.format_url(_request.url)
- _request.method = "GET"
- return _request
-
- async def extract_data(pipeline_response):
- deserialized = self._deserialize("ContainerGroupProfileListResult", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, AsyncList(list_of_elem)
-
- async def get_next(next_link=None):
- _request = prepare_request(next_link)
-
- _stream = False
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return AsyncItemPaged(get_next, extract_data)
-
- @distributed_trace
- def list_by_resource_group(
- self, resource_group_name: str, **kwargs: Any
- ) -> AsyncIterable["_models.ContainerGroupProfile"]:
- """Get a list of container group profiles in the specified subscription and resource group.
-
- Get a list of container group profiles in a specified subscription and resource group. This
- operation returns properties of each container group profile including containers, image
- registry credentials, restart policy, IP address type, OS type volumes, current revision
- number, etc.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :return: An iterator like instance of either ContainerGroupProfile or the result of
- cls(response)
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[_models.ContainerGroupProfileListResult] = kwargs.pop("cls", None)
-
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- def prepare_request(next_link=None):
- if not next_link:
-
- _request = build_list_by_resource_group_request(
- resource_group_name=resource_group_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- _request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- _request.url = self._client.format_url(_request.url)
- _request.method = "GET"
- return _request
-
- async def extract_data(pipeline_response):
- deserialized = self._deserialize("ContainerGroupProfileListResult", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, AsyncList(list_of_elem)
-
- async def get_next(next_link=None):
- _request = prepare_request(next_link)
-
- _stream = False
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return AsyncItemPaged(get_next, extract_data)
-
- @distributed_trace_async
- async def get(
- self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
- ) -> _models.ContainerGroupProfile:
- """Get the properties of the specified container group profile.
-
- Gets the properties of the specified container group profile in the specified subscription and
- resource group. The operation returns the properties of container group profile including
- containers, image registry credentials, restart policy, IP address type, OS type, volumes,
- current revision number, etc.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
- :type container_group_profile_name: str
- :return: ContainerGroupProfile or the result of cls(response)
- :rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[_models.ContainerGroupProfile] = kwargs.pop("cls", None)
-
- _request = build_get_request(
- resource_group_name=resource_group_name,
- container_group_profile_name=container_group_profile_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- _stream = False
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("ContainerGroupProfile", pipeline_response.http_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
-
- return deserialized # type: ignore
-
@overload
async def create_or_update(
self,
@@ -303,17 +77,16 @@ async def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Create or update container group profiles.
+ """Create or Update a ContainerGroupProfile.
- Create or update container group profiles with specified configurations.
+ Create a CGProfile if it doesn't exist or update an existing CGProfile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
- :param container_group_profile: The properties of the container group profile to be created or
- updated. Required.
+ :param container_group_profile: The ContainerGroupProfile object. Required.
:type container_group_profile: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
@@ -333,17 +106,16 @@ async def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Create or update container group profiles.
+ """Create or Update a ContainerGroupProfile.
- Create or update container group profiles with specified configurations.
+ Create a CGProfile if it doesn't exist or update an existing CGProfile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
- :param container_group_profile: The properties of the container group profile to be created or
- updated. Required.
+ :param container_group_profile: The ContainerGroupProfile object. Required.
:type container_group_profile: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
@@ -361,24 +133,24 @@ async def create_or_update(
container_group_profile: Union[_models.ContainerGroupProfile, IO[bytes]],
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Create or update container group profiles.
+ """Create or Update a ContainerGroupProfile.
- Create or update container group profiles with specified configurations.
+ Create a CGProfile if it doesn't exist or update an existing CGProfile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
- :param container_group_profile: The properties of the container group profile to be created or
- updated. Is either a ContainerGroupProfile type or a IO[bytes] type. Required.
+ :param container_group_profile: The ContainerGroupProfile object. Is either a
+ ContainerGroupProfile type or a IO[bytes] type. Required.
:type container_group_profile: ~azure.mgmt.containerinstance.models.ContainerGroupProfile or
IO[bytes]
:return: ContainerGroupProfile or the result of cls(response)
:rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -423,17 +195,23 @@ async def create_or_update(
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["x-ms-correlation-request-id"] = self._deserialize(
+ "str", response.headers.get("x-ms-correlation-request-id")
+ )
deserialized = self._deserialize("ContainerGroupProfile", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
return deserialized # type: ignore
@overload
- async def patch(
+ async def update(
self,
resource_group_name: str,
container_group_profile_name: str,
@@ -442,14 +220,14 @@ async def patch(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Patch container group profiles.
+ """Container group profile PATCH REST API.
- Patches container group profile with specified properties.
+ Update a specified container group profile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
:param properties: The container group profile properties that need to be updated. Required.
:type properties: ~azure.mgmt.containerinstance.models.ContainerGroupProfilePatch
@@ -462,7 +240,7 @@ async def patch(
"""
@overload
- async def patch(
+ async def update(
self,
resource_group_name: str,
container_group_profile_name: str,
@@ -471,14 +249,14 @@ async def patch(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Patch container group profiles.
+ """Container group profile PATCH REST API.
- Patches container group profile with specified properties.
+ Update a specified container group profile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
:param properties: The container group profile properties that need to be updated. Required.
:type properties: IO[bytes]
@@ -491,21 +269,21 @@ async def patch(
"""
@distributed_trace_async
- async def patch(
+ async def update(
self,
resource_group_name: str,
container_group_profile_name: str,
properties: Union[_models.ContainerGroupProfilePatch, IO[bytes]],
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Patch container group profiles.
+ """Container group profile PATCH REST API.
- Patches container group profile with specified properties.
+ Update a specified container group profile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
:param properties: The container group profile properties that need to be updated. Is either a
ContainerGroupProfilePatch type or a IO[bytes] type. Required.
@@ -514,7 +292,7 @@ async def patch(
:rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -537,7 +315,7 @@ async def patch(
else:
_json = self._serialize.body(properties, "ContainerGroupProfilePatch")
- _request = build_patch_request(
+ _request = build_update_request(
resource_group_name=resource_group_name,
container_group_profile_name=container_group_profile_name,
subscription_id=self._config.subscription_id,
@@ -557,6 +335,71 @@ async def patch(
response = pipeline_response.http_response
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["x-ms-correlation-request-id"] = self._deserialize(
+ "str", response.headers.get("x-ms-correlation-request-id")
+ )
+
+ deserialized = self._deserialize("ContainerGroupProfile", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def get(
+ self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
+ ) -> _models.ContainerGroupProfile:
+ """Display information about a specified ContainerGroupProfile.
+
+ Get the properties of the specified container group profile.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
+ :type container_group_profile_name: str
+ :return: ContainerGroupProfile or the result of cls(response)
+ :rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ContainerGroupProfile] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ container_group_profile_name=container_group_profile_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
@@ -568,25 +411,235 @@ async def patch(
return deserialized # type: ignore
+ async def _delete_initial(
+ self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_delete_request(
+ resource_group_name=resource_group_name,
+ container_group_profile_name=container_group_profile_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["x-ms-correlation-request-id"] = self._deserialize(
+ "str", response.headers.get("x-ms-correlation-request-id")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def begin_delete(
+ self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Container group profile DELETE REST API.
+
+ Deletes a container group profile.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
+ :type container_group_profile_name: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_initial(
+ resource_group_name=resource_group_name,
+ container_group_profile_name=container_group_profile_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def list_all_revisions(
self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
- ) -> None:
- """Delete the specified container group profile.
+ ) -> AsyncIterable["_models.ContainerGroupProfile"]:
+ """Get a list of all the revisions of the specified container group profile in the given
+ subscription and resource group.
+
+ Get a list of all the revisions of the specified container group profile in the given
+ subscription and resource group. This operation returns properties of each revision of the
+ specified container group profile including containers, image registry credentials, restart
+ policy, IP address type, OS type volumes, revision number, etc.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
+ :type container_group_profile_name: str
+ :return: An iterator like instance of either ContainerGroupProfile or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ContainerGroupProfileListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_all_revisions_request(
+ resource_group_name=resource_group_name,
+ container_group_profile_name=container_group_profile_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("ContainerGroupProfileListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ @distributed_trace_async
+ async def get_by_revision_number(
+ self, resource_group_name: str, container_group_profile_name: str, revision_number: str, **kwargs: Any
+ ) -> _models.ContainerGroupProfile:
+ """Get the properties of the specified revision of the container group profile.
- Delete the specified container group profile in the specified subscription and resource group.
- The operation does not delete other resources provided by the user, such as volumes.
+ Gets the properties of the specified revision of the container group profile in the given
+ subscription and resource group. The operation returns the properties of container group
+ profile including containers, image registry credentials, restart policy, IP address type, OS
+ type, volumes, current revision number, etc.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
- :return: None or the result of cls(response)
- :rtype: None
+ :param revision_number: The revision number of the container group profile. Required.
+ :type revision_number: str
+ :return: ContainerGroupProfile or the result of cls(response)
+ :rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -598,11 +651,12 @@ async def delete( # pylint: disable=inconsistent-return-statements
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[_models.ContainerGroupProfile] = kwargs.pop("cls", None)
- _request = build_delete_request(
+ _request = build_get_by_revision_number_request(
resource_group_name=resource_group_name,
container_group_profile_name=container_group_profile_name,
+ revision_number=revision_number,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
@@ -617,9 +671,13 @@ async def delete( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
- if response.status_code not in [200, 204]:
+ if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = self._deserialize("ContainerGroupProfile", pipeline_response.http_response)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_group_profile_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_cg_profiles_operations.py
similarity index 60%
rename from sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_group_profile_operations.py
rename to sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_cg_profiles_operations.py
index 793cb6c08182..27abefcc6b20 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_group_profile_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_cg_profiles_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -22,32 +21,31 @@
from azure.core.pipeline import PipelineResponse
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
-from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ...operations._container_group_profile_operations import (
- build_get_by_revision_number_request,
- build_list_all_revisions_request,
+from ...operations._cg_profiles_operations import (
+ build_list_by_resource_group_request,
+ build_list_by_subscription_request,
)
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class ContainerGroupProfileOperations:
+class CGProfilesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.containerinstance.aio.ContainerInstanceManagementClient`'s
- :attr:`container_group_profile` attribute.
+ :attr:`cg_profiles` attribute.
"""
models = _models
@@ -60,22 +58,11 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
- def list_all_revisions(
- self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
- ) -> AsyncIterable["_models.ContainerGroupProfile"]:
- """Get a list of all the revisions of the specified container group profile in the given
- subscription and resource group.
+ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ContainerGroupProfile"]:
+ """List container group profiles in a subscription.
- Get a list of all the revisions of the specified container group profile in the given
- subscription and resource group. This operation returns properties of each revision of the
- specified container group profile including containers, image registry credentials, restart
- policy, IP address type, OS type volumes, revision number, etc.
+ Gets a list of all container group profiles under a subscription.
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
- :type container_group_profile_name: str
:return: An iterator like instance of either ContainerGroupProfile or the result of
cls(response)
:rtype:
@@ -88,7 +75,7 @@ def list_all_revisions(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ContainerGroupProfileListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -99,9 +86,7 @@ def list_all_revisions(
def prepare_request(next_link=None):
if not next_link:
- _request = build_list_all_revisions_request(
- resource_group_name=resource_group_name,
- container_group_profile_name=container_group_profile_name,
+ _request = build_list_by_subscription_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
@@ -150,29 +135,30 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- @distributed_trace_async
- async def get_by_revision_number(
- self, resource_group_name: str, container_group_profile_name: str, revision_number: str, **kwargs: Any
- ) -> _models.ContainerGroupProfile:
- """Get the properties of the specified revision of the container group profile.
+ @distributed_trace
+ def list_by_resource_group(
+ self, resource_group_name: str, **kwargs: Any
+ ) -> AsyncIterable["_models.ContainerGroupProfile"]:
+ """List container group profiles in a resource group.
- Gets the properties of the specified revision of the container group profile in the given
- subscription and resource group. The operation returns the properties of container group
- profile including containers, image registry credentials, restart policy, IP address type, OS
- type, volumes, current revision number, etc.
+ Gets a list of all container group profiles under a resource group.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
- :type container_group_profile_name: str
- :param revision_number: The revision number of the container group profile. Required.
- :type revision_number: str
- :return: ContainerGroupProfile or the result of cls(response)
- :rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
+ :return: An iterator like instance of either ContainerGroupProfile or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ContainerGroupProfileListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -180,37 +166,55 @@ async def get_by_revision_number(
}
error_map.update(kwargs.pop("error_map", {}) or {})
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ def prepare_request(next_link=None):
+ if not next_link:
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[_models.ContainerGroupProfile] = kwargs.pop("cls", None)
+ _request = build_list_by_resource_group_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
- _request = build_get_by_revision_number_request(
- resource_group_name=resource_group_name,
- container_group_profile_name=container_group_profile_name,
- revision_number=revision_number,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
- _stream = False
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("ContainerGroupProfileListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
- response = pipeline_response.http_response
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
- deserialized = self._deserialize("ContainerGroupProfile", pipeline_response.http_response)
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
+ return pipeline_response
- return deserialized # type: ignore
+ return AsyncItemPaged(get_next, extract_data)
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py
index a8badbbc07b9..9299b8f55126 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,21 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import (
- Any,
- AsyncIterable,
- AsyncIterator,
- Callable,
- Dict,
- IO,
- List,
- Optional,
- Type,
- TypeVar,
- Union,
- cast,
- overload,
-)
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -62,7 +48,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -87,16 +73,17 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
- def list(self, **kwargs: Any) -> AsyncIterable["_models.ContainerGroup"]:
+ def list(self, **kwargs: Any) -> AsyncIterable["_models.ListResultContainerGroup"]:
"""Get a list of container groups in the specified subscription.
Get a list of container groups in the specified subscription. This operation returns properties
of each container group including containers, image registry credentials, restart policy, IP
address type, OS type, state, and volumes.
- :return: An iterator like instance of either ContainerGroup or the result of cls(response)
+ :return: An iterator like instance of either ListResultContainerGroup or the result of
+ cls(response)
:rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.ContainerGroup]
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.ListResultContainerGroup]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
@@ -105,7 +92,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ContainerGroup"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ContainerGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -168,7 +155,7 @@ async def get_next(next_link=None):
@distributed_trace
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
- ) -> AsyncIterable["_models.ContainerGroup"]:
+ ) -> AsyncIterable["_models.ListResultContainerGroup"]:
"""Get a list of container groups in the specified subscription and resource group.
Get a list of container groups in a specified subscription and resource group. This operation
@@ -178,9 +165,10 @@ def list_by_resource_group(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :return: An iterator like instance of either ContainerGroup or the result of cls(response)
+ :return: An iterator like instance of either ListResultContainerGroup or the result of
+ cls(response)
:rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.ContainerGroup]
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.ListResultContainerGroup]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
@@ -189,7 +177,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ContainerGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -267,7 +255,7 @@ async def get(self, resource_group_name: str, container_group_name: str, **kwarg
:rtype: ~azure.mgmt.containerinstance.models.ContainerGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -316,7 +304,7 @@ async def _create_or_update_initial(
container_group: Union[_models.ContainerGroup, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -591,7 +579,7 @@ async def update(
:rtype: ~azure.mgmt.containerinstance.models.ContainerGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -648,7 +636,7 @@ async def update(
async def _delete_initial(
self, resource_group_name: str, container_group_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -761,7 +749,7 @@ def get_long_running_output(pipeline_response):
async def _restart_initial(
self, resource_group_name: str, container_group_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -867,9 +855,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace_async
- async def stop( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, container_group_name: str, **kwargs: Any
- ) -> None:
+ async def stop(self, resource_group_name: str, container_group_name: str, **kwargs: Any) -> None:
"""Stops all containers in a container group.
Stops all containers in a container group. Compute resources will be deallocated and billing
@@ -884,7 +870,7 @@ async def stop( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -925,7 +911,7 @@ async def stop( # pylint: disable=inconsistent-return-statements
async def _start_initial(
self, resource_group_name: str, container_group_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1048,7 +1034,7 @@ async def get_outbound_network_dependencies_endpoints( # pylint: disable=name-t
:rtype: list[str]
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py
index 4c510109dab9..976f2327e64f 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -34,7 +33,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -90,7 +89,7 @@ async def list_logs(
:rtype: ~azure.mgmt.containerinstance.models.Logs
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -230,7 +229,7 @@ async def execute_command(
:rtype: ~azure.mgmt.containerinstance.models.ContainerExecResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -305,7 +304,7 @@ async def attach(
:rtype: ~azure.mgmt.containerinstance.models.ContainerAttachResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py
index ebaa9dbe3b5a..a74e8d39359d 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -35,7 +34,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -75,7 +74,7 @@ def list_usage(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usa
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -155,7 +154,7 @@ def list_cached_images(self, location: str, **kwargs: Any) -> AsyncIterable["_mo
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.CachedImagesListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -235,7 +234,7 @@ def list_capabilities(self, location: str, **kwargs: Any) -> AsyncIterable["_mod
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.CapabilitiesListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_ngroups_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_ngroups_operations.py
new file mode 100644
index 000000000000..4ac538bbd616
--- /dev/null
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_ngroups_operations.py
@@ -0,0 +1,1098 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# 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.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+import sys
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import urllib.parse
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
+
+from ... import models as _models
+from ...operations._ngroups_operations import (
+ build_create_or_update_request,
+ build_delete_request,
+ build_get_request,
+ build_list_by_resource_group_request,
+ build_list_request,
+ build_restart_request,
+ build_start_request,
+ build_stop_request,
+ build_update_request,
+)
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class NGroupsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.containerinstance.aio.ContainerInstanceManagementClient`'s
+ :attr:`ngroups` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace_async
+ async def get(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> _models.NGroup:
+ """NGroups GET REST API.
+
+ Get the properties of the specified NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :return: NGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.containerinstance.models.NGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.NGroup] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("NGroup", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ async def _create_or_update_initial(
+ self, resource_group_name: str, ngroups_name: str, n_group: Union[_models.NGroup, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(n_group, (IOBase, bytes)):
+ _content = n_group
+ else:
+ _json = self._serialize.body(n_group, "NGroup")
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ ngroups_name: str,
+ n_group: _models.NGroup,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.NGroup]:
+ """NGroup PUT REST API.
+
+ Create or update a NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Required.
+ :type n_group: ~azure.mgmt.containerinstance.models.NGroup
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either NGroup or the result of
+ cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ ngroups_name: str,
+ n_group: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.NGroup]:
+ """NGroup PUT REST API.
+
+ Create or update a NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Required.
+ :type n_group: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either NGroup or the result of
+ cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_create_or_update(
+ self, resource_group_name: str, ngroups_name: str, n_group: Union[_models.NGroup, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.NGroup]:
+ """NGroup PUT REST API.
+
+ Create or update a NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Is either a NGroup type or a IO[bytes] type. Required.
+ :type n_group: ~azure.mgmt.containerinstance.models.NGroup or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either NGroup or the result of
+ cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.NGroup] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ n_group=n_group,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = self._deserialize("NGroup", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod,
+ AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs),
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.NGroup].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.NGroup](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ async def _update_initial(
+ self, resource_group_name: str, ngroups_name: str, n_group: Union[_models.NGroup, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(n_group, (IOBase, bytes)):
+ _content = n_group
+ else:
+ _json = self._serialize.body(n_group, "NGroup")
+
+ _request = build_update_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 200:
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ if response.status_code == 202:
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_update(
+ self,
+ resource_group_name: str,
+ ngroups_name: str,
+ n_group: _models.NGroup,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.NGroup]:
+ """NGroups PATCH REST API.
+
+ Update a specified NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Required.
+ :type n_group: ~azure.mgmt.containerinstance.models.NGroup
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either NGroup or the result of
+ cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_update(
+ self,
+ resource_group_name: str,
+ ngroups_name: str,
+ n_group: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.NGroup]:
+ """NGroups PATCH REST API.
+
+ Update a specified NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Required.
+ :type n_group: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either NGroup or the result of
+ cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_update(
+ self, resource_group_name: str, ngroups_name: str, n_group: Union[_models.NGroup, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.NGroup]:
+ """NGroups PATCH REST API.
+
+ Update a specified NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Is either a NGroup type or a IO[bytes] type. Required.
+ :type n_group: ~azure.mgmt.containerinstance.models.NGroup or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either NGroup or the result of
+ cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.NGroup] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._update_initial(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ n_group=n_group,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = self._deserialize("NGroup", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod,
+ AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs),
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.NGroup].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.NGroup](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ async def _delete_initial(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_delete_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_delete(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ """NGroups Delete REST API.
+
+ Deletes the NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_initial(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod,
+ AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs),
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ async def _start_initial(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_start_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_start(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ """Starts all container groups in the specified NGroups resource.
+
+ Starts all container groups in the specified NGroups resource. Compute resources will be
+ allocated and billing will start.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._start_initial(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod,
+ AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs),
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace_async
+ async def stop(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> None:
+ """Stops all container groups in the specified NGroups resource.
+
+ Stops all container groups in the specified NGroups resource. Compute resources will be
+ deallocated and billing will stop.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_stop_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ async def _restart_initial(
+ self, resource_group_name: str, ngroups_name: str, **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_restart_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_restart(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ """Restarts all container groups in the specified NGroups resource.
+
+ Restarts all container groups in the specified NGroups resource in place. If container image
+ has updates, new image will be downloaded.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._restart_initial(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod,
+ AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs),
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NGroup"]:
+ """GET NGroups under a resource group REST API.
+
+ Gets a list of all NGroups resources under a resource group.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :return: An iterator like instance of either NGroup or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.NGroupsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_by_resource_group_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("NGroupsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def list(self, **kwargs: Any) -> AsyncIterable["_models.NGroup"]:
+ """List NGroups in a subscription.
+
+ Gets a list of all NGroups resources under a subscription.
+
+ :return: An iterator like instance of either NGroup or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.NGroupsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_request(
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("NGroupsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py
index ea2cd970a8d2..0c5cd92c5328 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -69,7 +68,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_subnet_service_association_link_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_subnet_service_association_link_operations.py
index 9cd84db966f1..102b1bbd4a2e 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_subnet_service_association_link_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_subnet_service_association_link_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union, cast
+from typing import Any, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -33,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -60,7 +59,7 @@ def __init__(self, *args, **kwargs) -> None:
async def _delete_initial(
self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py
index a9551a9b83d2..292520ede16b 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py
@@ -5,89 +5,140 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._models_py3 import AzureFileVolume
-from ._models_py3 import CachedImages
-from ._models_py3 import CachedImagesListResult
-from ._models_py3 import Capabilities
-from ._models_py3 import CapabilitiesCapabilities
-from ._models_py3 import CapabilitiesListResult
-from ._models_py3 import CloudErrorBody
-from ._models_py3 import ConfidentialComputeProperties
-from ._models_py3 import ConfigMap
-from ._models_py3 import Container
-from ._models_py3 import ContainerAttachResponse
-from ._models_py3 import ContainerExec
-from ._models_py3 import ContainerExecRequest
-from ._models_py3 import ContainerExecRequestTerminalSize
-from ._models_py3 import ContainerExecResponse
-from ._models_py3 import ContainerGroup
-from ._models_py3 import ContainerGroupDiagnostics
-from ._models_py3 import ContainerGroupIdentity
-from ._models_py3 import ContainerGroupListResult
-from ._models_py3 import ContainerGroupProfile
-from ._models_py3 import ContainerGroupProfileListResult
-from ._models_py3 import ContainerGroupProfilePatch
-from ._models_py3 import ContainerGroupProfileProperties
-from ._models_py3 import ContainerGroupProfileReferenceDefinition
-from ._models_py3 import ContainerGroupProperties
-from ._models_py3 import ContainerGroupPropertiesInstanceView
-from ._models_py3 import ContainerGroupSubnetId
-from ._models_py3 import ContainerHttpGet
-from ._models_py3 import ContainerPort
-from ._models_py3 import ContainerProbe
-from ._models_py3 import ContainerPropertiesInstanceView
-from ._models_py3 import ContainerState
-from ._models_py3 import DeploymentExtensionSpec
-from ._models_py3 import DnsConfiguration
-from ._models_py3 import EncryptionProperties
-from ._models_py3 import EnvironmentVariable
-from ._models_py3 import Event
-from ._models_py3 import GitRepoVolume
-from ._models_py3 import GpuResource
-from ._models_py3 import HttpHeader
-from ._models_py3 import ImageRegistryCredential
-from ._models_py3 import InitContainerDefinition
-from ._models_py3 import InitContainerPropertiesDefinitionInstanceView
-from ._models_py3 import IpAddress
-from ._models_py3 import LogAnalytics
-from ._models_py3 import Logs
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import Port
-from ._models_py3 import Resource
-from ._models_py3 import ResourceLimits
-from ._models_py3 import ResourceRequests
-from ._models_py3 import ResourceRequirements
-from ._models_py3 import SecurityContextCapabilitiesDefinition
-from ._models_py3 import SecurityContextDefinition
-from ._models_py3 import StandbyPoolProfileDefinition
-from ._models_py3 import Usage
-from ._models_py3 import UsageListResult
-from ._models_py3 import UsageName
-from ._models_py3 import UserAssignedIdentities
-from ._models_py3 import Volume
-from ._models_py3 import VolumeMount
+from typing import TYPE_CHECKING
-from ._container_instance_management_client_enums import ContainerGroupIpAddressType
-from ._container_instance_management_client_enums import ContainerGroupNetworkProtocol
-from ._container_instance_management_client_enums import ContainerGroupPriority
-from ._container_instance_management_client_enums import ContainerGroupRestartPolicy
-from ._container_instance_management_client_enums import ContainerGroupSku
-from ._container_instance_management_client_enums import ContainerInstanceOperationsOrigin
-from ._container_instance_management_client_enums import ContainerNetworkProtocol
-from ._container_instance_management_client_enums import DnsNameLabelReusePolicy
-from ._container_instance_management_client_enums import GpuSku
-from ._container_instance_management_client_enums import LogAnalyticsLogType
-from ._container_instance_management_client_enums import OperatingSystemTypes
-from ._container_instance_management_client_enums import ResourceIdentityType
-from ._container_instance_management_client_enums import Scheme
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ApiEntityReference,
+ ApplicationGateway,
+ ApplicationGatewayBackendAddressPool,
+ AzureFileVolume,
+ CachedImages,
+ CachedImagesListResult,
+ Capabilities,
+ CapabilitiesCapabilities,
+ CapabilitiesListResult,
+ CloudErrorBody,
+ ConfidentialComputeProperties,
+ Container,
+ ContainerAttachResponse,
+ ContainerExec,
+ ContainerExecRequest,
+ ContainerExecRequestTerminalSize,
+ ContainerExecResponse,
+ ContainerGroup,
+ ContainerGroupDiagnostics,
+ ContainerGroupIdentity,
+ ContainerGroupListResult,
+ ContainerGroupProfile,
+ ContainerGroupProfileListResult,
+ ContainerGroupProfilePatch,
+ ContainerGroupProfileStub,
+ ContainerGroupProperties,
+ ContainerGroupPropertiesInstanceView,
+ ContainerGroupSubnetId,
+ ContainerHttpGet,
+ ContainerPort,
+ ContainerProbe,
+ ContainerPropertiesInstanceView,
+ ContainerState,
+ DeploymentExtensionSpec,
+ DnsConfiguration,
+ ElasticProfile,
+ ElasticProfileContainerGroupNamingPolicy,
+ ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy,
+ EncryptionProperties,
+ EnvironmentVariable,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ErrorResponse,
+ Event,
+ FileShare,
+ FileShareProperties,
+ GitRepoVolume,
+ GpuResource,
+ HttpHeader,
+ IdentityAccessControl,
+ IdentityAcls,
+ ImageRegistryCredential,
+ InitContainerDefinition,
+ InitContainerPropertiesDefinitionInstanceView,
+ IpAddress,
+ ListResultContainerGroup,
+ ListResultContainerGroupProperties,
+ LoadBalancer,
+ LoadBalancerBackendAddressPool,
+ LogAnalytics,
+ Logs,
+ NGroup,
+ NGroupCGPropertyContainer,
+ NGroupCGPropertyContainerProperties,
+ NGroupCGPropertyVolume,
+ NGroupContainerGroupProperties,
+ NGroupIdentity,
+ NGroupSkus,
+ NGroupsListResult,
+ NGroupsSkusList,
+ NetworkProfile,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ PlacementProfile,
+ Port,
+ Resource,
+ ResourceLimits,
+ ResourceRequests,
+ ResourceRequirements,
+ SecretReference,
+ SecurityContextCapabilitiesDefinition,
+ SecurityContextDefinition,
+ StorageProfile,
+ SystemData,
+ UpdateProfile,
+ UpdateProfileRollingUpdateProfile,
+ Usage,
+ UsageListResult,
+ UsageName,
+ UserAssignedIdentities,
+ Volume,
+ VolumeMount,
+)
+
+from ._container_instance_management_client_enums import ( # type: ignore
+ AzureFileShareAccessTier,
+ AzureFileShareAccessType,
+ ContainerGroupIpAddressType,
+ ContainerGroupNetworkProtocol,
+ ContainerGroupPriority,
+ ContainerGroupProvisioningState,
+ ContainerGroupRestartPolicy,
+ ContainerGroupSku,
+ ContainerInstanceOperationsOrigin,
+ ContainerNetworkProtocol,
+ CreatedByType,
+ DnsNameLabelReusePolicy,
+ GpuSku,
+ IdentityAccessLevel,
+ LogAnalyticsLogType,
+ NGroupProvisioningState,
+ NGroupUpdateMode,
+ OperatingSystemTypes,
+ ResourceIdentityType,
+ Scheme,
+)
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
+ "ApiEntityReference",
+ "ApplicationGateway",
+ "ApplicationGatewayBackendAddressPool",
"AzureFileVolume",
"CachedImages",
"CachedImagesListResult",
@@ -96,7 +147,6 @@
"CapabilitiesListResult",
"CloudErrorBody",
"ConfidentialComputeProperties",
- "ConfigMap",
"Container",
"ContainerAttachResponse",
"ContainerExec",
@@ -110,8 +160,7 @@
"ContainerGroupProfile",
"ContainerGroupProfileListResult",
"ContainerGroupProfilePatch",
- "ContainerGroupProfileProperties",
- "ContainerGroupProfileReferenceDefinition",
+ "ContainerGroupProfileStub",
"ContainerGroupProperties",
"ContainerGroupPropertiesInstanceView",
"ContainerGroupSubnetId",
@@ -122,48 +171,84 @@
"ContainerState",
"DeploymentExtensionSpec",
"DnsConfiguration",
+ "ElasticProfile",
+ "ElasticProfileContainerGroupNamingPolicy",
+ "ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy",
"EncryptionProperties",
"EnvironmentVariable",
+ "ErrorAdditionalInfo",
+ "ErrorDetail",
+ "ErrorResponse",
"Event",
+ "FileShare",
+ "FileShareProperties",
"GitRepoVolume",
"GpuResource",
"HttpHeader",
+ "IdentityAccessControl",
+ "IdentityAcls",
"ImageRegistryCredential",
"InitContainerDefinition",
"InitContainerPropertiesDefinitionInstanceView",
"IpAddress",
+ "ListResultContainerGroup",
+ "ListResultContainerGroupProperties",
+ "LoadBalancer",
+ "LoadBalancerBackendAddressPool",
"LogAnalytics",
"Logs",
+ "NGroup",
+ "NGroupCGPropertyContainer",
+ "NGroupCGPropertyContainerProperties",
+ "NGroupCGPropertyVolume",
+ "NGroupContainerGroupProperties",
+ "NGroupIdentity",
+ "NGroupSkus",
+ "NGroupsListResult",
+ "NGroupsSkusList",
+ "NetworkProfile",
"Operation",
"OperationDisplay",
"OperationListResult",
+ "PlacementProfile",
"Port",
"Resource",
"ResourceLimits",
"ResourceRequests",
"ResourceRequirements",
+ "SecretReference",
"SecurityContextCapabilitiesDefinition",
"SecurityContextDefinition",
- "StandbyPoolProfileDefinition",
+ "StorageProfile",
+ "SystemData",
+ "UpdateProfile",
+ "UpdateProfileRollingUpdateProfile",
"Usage",
"UsageListResult",
"UsageName",
"UserAssignedIdentities",
"Volume",
"VolumeMount",
+ "AzureFileShareAccessTier",
+ "AzureFileShareAccessType",
"ContainerGroupIpAddressType",
"ContainerGroupNetworkProtocol",
"ContainerGroupPriority",
+ "ContainerGroupProvisioningState",
"ContainerGroupRestartPolicy",
"ContainerGroupSku",
"ContainerInstanceOperationsOrigin",
"ContainerNetworkProtocol",
+ "CreatedByType",
"DnsNameLabelReusePolicy",
"GpuSku",
+ "IdentityAccessLevel",
"LogAnalyticsLogType",
+ "NGroupProvisioningState",
+ "NGroupUpdateMode",
"OperatingSystemTypes",
"ResourceIdentityType",
"Scheme",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_container_instance_management_client_enums.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_container_instance_management_client_enums.py
index b2346dedd4d4..153b2b459164 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_container_instance_management_client_enums.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_container_instance_management_client_enums.py
@@ -10,6 +10,27 @@
from azure.core import CaseInsensitiveEnumMeta
+class AzureFileShareAccessTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Access tier for specific share. GpV2 account can choose between TransactionOptimized (default),
+ Hot, and Cool. FileStorage account can choose Premium. Learn more at:
+ https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/create?tabs=HTTP#shareaccesstier.
+ """
+
+ COOL = "Cool"
+ HOT = "Hot"
+ PREMIUM = "Premium"
+ TRANSACTION_OPTIMIZED = "TransactionOptimized"
+
+
+class AzureFileShareAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Specifies how Container Groups can access the Azure file share i.e. all CG will share same
+ Azure file share or going to have exclusive file share.
+ """
+
+ SHARED = "Shared"
+ EXCLUSIVE = "Exclusive"
+
+
class ContainerGroupIpAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Specifies if the IP is exposed to the public internet or private VNET."""
@@ -31,6 +52,24 @@ class ContainerGroupPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta):
SPOT = "Spot"
+class ContainerGroupProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The provisioning state of the container group. This only appears in the response."""
+
+ NOT_SPECIFIED = "NotSpecified"
+ ACCEPTED = "Accepted"
+ PENDING = "Pending"
+ UPDATING = "Updating"
+ CREATING = "Creating"
+ REPAIRING = "Repairing"
+ UNHEALTHY = "Unhealthy"
+ FAILED = "Failed"
+ CANCELED = "Canceled"
+ SUCCEEDED = "Succeeded"
+ DELETING = "Deleting"
+ NOT_ACCESSIBLE = "NotAccessible"
+ PRE_PROVISIONED = "PreProvisioned"
+
+
class ContainerGroupRestartPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Restart policy for all containers within the container group.
@@ -48,6 +87,7 @@ class ContainerGroupRestartPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta):
class ContainerGroupSku(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The container group SKU."""
+ NOT_SPECIFIED = "NotSpecified"
STANDARD = "Standard"
DEDICATED = "Dedicated"
CONFIDENTIAL = "Confidential"
@@ -67,6 +107,15 @@ class ContainerNetworkProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta):
UDP = "UDP"
+class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The type of identity that created the resource."""
+
+ USER = "User"
+ APPLICATION = "Application"
+ MANAGED_IDENTITY = "ManagedIdentity"
+ KEY = "Key"
+
+
class DnsNameLabelReusePolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The value representing the security enum. The 'Unsecure' value is the default value if not
selected and means the object's domain name label is not secured against subdomain takeover.
@@ -93,6 +142,14 @@ class GpuSku(str, Enum, metaclass=CaseInsensitiveEnumMeta):
V100 = "V100"
+class IdentityAccessLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The access level of an identity."""
+
+ ALL = "All"
+ SYSTEM = "System"
+ USER = "User"
+
+
class LogAnalyticsLogType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The log type to be used."""
@@ -100,6 +157,25 @@ class LogAnalyticsLogType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
CONTAINER_INSTANCE_LOGS = "ContainerInstanceLogs"
+class NGroupProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The provisioning state, which only appears in the response."""
+
+ CREATING = "Creating"
+ UPDATING = "Updating"
+ FAILED = "Failed"
+ SUCCEEDED = "Succeeded"
+ CANCELED = "Canceled"
+ DELETING = "Deleting"
+ MIGRATING = "Migrating"
+
+
+class NGroupUpdateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """NGroupUpdateMode."""
+
+ MANUAL = "Manual"
+ ROLLING = "Rolling"
+
+
class OperatingSystemTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The operating system type required by the containers in the container group."""
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py
index 6deb8bee8d24..a6b098393e0c 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -7,6 +7,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import datetime
import sys
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
@@ -15,14 +16,89 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
+class ApiEntityReference(_serialization.Model):
+ """The API entity reference.
+
+ :ivar id: The ARM resource id in the form of
+ /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...
+ :vartype id: str
+ """
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ }
+
+ def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin
+ """
+ :keyword id: The ARM resource id in the form of
+ /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...
+ :paramtype id: str
+ """
+ super().__init__(**kwargs)
+ self.id = id
+
+
+class ApplicationGateway(_serialization.Model):
+ """Application Gateway the CG profile will use to interact with CGs in a backend pool.
+
+ :ivar resource: The Application Gateway ARM resource Id.
+ :vartype resource: str
+ :ivar backend_address_pools: List of Application Gateway Backend Address Pools.
+ :vartype backend_address_pools:
+ list[~azure.mgmt.containerinstance.models.ApplicationGatewayBackendAddressPool]
+ """
+
+ _attribute_map = {
+ "resource": {"key": "resource", "type": "str"},
+ "backend_address_pools": {"key": "backendAddressPools", "type": "[ApplicationGatewayBackendAddressPool]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ resource: Optional[str] = None,
+ backend_address_pools: Optional[List["_models.ApplicationGatewayBackendAddressPool"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword resource: The Application Gateway ARM resource Id.
+ :paramtype resource: str
+ :keyword backend_address_pools: List of Application Gateway Backend Address Pools.
+ :paramtype backend_address_pools:
+ list[~azure.mgmt.containerinstance.models.ApplicationGatewayBackendAddressPool]
+ """
+ super().__init__(**kwargs)
+ self.resource = resource
+ self.backend_address_pools = backend_address_pools
+
+
+class ApplicationGatewayBackendAddressPool(_serialization.Model):
+ """NGroups application gateway backend address pool.
+
+ :ivar resource: The application gateway backend address pool ARM resource Id.
+ :vartype resource: str
+ """
+
+ _attribute_map = {
+ "resource": {"key": "resource", "type": "str"},
+ }
+
+ def __init__(self, *, resource: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword resource: The application gateway backend address pool ARM resource Id.
+ :paramtype resource: str
+ """
+ super().__init__(**kwargs)
+ self.resource = resource
+
+
class AzureFileVolume(_serialization.Model):
"""The properties of the Azure File volume. Azure File shares are mounted as volumes.
@@ -38,6 +114,9 @@ class AzureFileVolume(_serialization.Model):
:vartype storage_account_name: str
:ivar storage_account_key: The storage account access key used to access the Azure File share.
:vartype storage_account_key: str
+ :ivar storage_account_key_reference: The reference to the storage account access key used to
+ access the Azure File share.
+ :vartype storage_account_key_reference: str
"""
_validation = {
@@ -50,6 +129,7 @@ class AzureFileVolume(_serialization.Model):
"read_only": {"key": "readOnly", "type": "bool"},
"storage_account_name": {"key": "storageAccountName", "type": "str"},
"storage_account_key": {"key": "storageAccountKey", "type": "str"},
+ "storage_account_key_reference": {"key": "storageAccountKeyReference", "type": "str"},
}
def __init__(
@@ -59,6 +139,7 @@ def __init__(
storage_account_name: str,
read_only: Optional[bool] = None,
storage_account_key: Optional[str] = None,
+ storage_account_key_reference: Optional[str] = None,
**kwargs: Any
) -> None:
"""
@@ -73,12 +154,16 @@ def __init__(
:keyword storage_account_key: The storage account access key used to access the Azure File
share.
:paramtype storage_account_key: str
+ :keyword storage_account_key_reference: The reference to the storage account access key used to
+ access the Azure File share.
+ :paramtype storage_account_key_reference: str
"""
super().__init__(**kwargs)
self.share_name = share_name
self.read_only = read_only
self.storage_account_name = storage_account_name
self.storage_account_key = storage_account_key
+ self.storage_account_key_reference = storage_account_key_reference
class CachedImages(_serialization.Model):
@@ -323,27 +408,7 @@ def __init__(self, *, cce_policy: Optional[str] = None, **kwargs: Any) -> None:
self.cce_policy = cce_policy
-class ConfigMap(_serialization.Model):
- """The container config map.
-
- :ivar key_value_pairs: The key value pairs dictionary in the config map.
- :vartype key_value_pairs: dict[str, str]
- """
-
- _attribute_map = {
- "key_value_pairs": {"key": "keyValuePairs", "type": "{str}"},
- }
-
- def __init__(self, *, key_value_pairs: Optional[Dict[str, str]] = None, **kwargs: Any) -> None:
- """
- :keyword key_value_pairs: The key value pairs dictionary in the config map.
- :paramtype key_value_pairs: dict[str, str]
- """
- super().__init__(**kwargs)
- self.key_value_pairs = key_value_pairs
-
-
-class Container(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class Container(_serialization.Model):
"""A container instance.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -352,7 +417,7 @@ class Container(_serialization.Model): # pylint: disable=too-many-instance-attr
:ivar name: The user-provided name of the container instance. Required.
:vartype name: str
- :ivar image: The name of the image used to create the container instance.
+ :ivar image: The name of the image used to create the container instance. Required.
:vartype image: str
:ivar command: The commands to execute within the container instance in exec form.
:vartype command: list[str]
@@ -362,7 +427,7 @@ class Container(_serialization.Model): # pylint: disable=too-many-instance-attr
:vartype environment_variables: list[~azure.mgmt.containerinstance.models.EnvironmentVariable]
:ivar instance_view: The instance view of the container instance. Only valid in response.
:vartype instance_view: ~azure.mgmt.containerinstance.models.ContainerPropertiesInstanceView
- :ivar resources: The resource requirements of the container instance.
+ :ivar resources: The resource requirements of the container instance. Required.
:vartype resources: ~azure.mgmt.containerinstance.models.ResourceRequirements
:ivar volume_mounts: The volume mounts available to the container instance.
:vartype volume_mounts: list[~azure.mgmt.containerinstance.models.VolumeMount]
@@ -372,13 +437,13 @@ class Container(_serialization.Model): # pylint: disable=too-many-instance-attr
:vartype readiness_probe: ~azure.mgmt.containerinstance.models.ContainerProbe
:ivar security_context: The container security properties.
:vartype security_context: ~azure.mgmt.containerinstance.models.SecurityContextDefinition
- :ivar config_map: The config map.
- :vartype config_map: ~azure.mgmt.containerinstance.models.ConfigMap
"""
_validation = {
"name": {"required": True},
+ "image": {"required": True},
"instance_view": {"readonly": True},
+ "resources": {"required": True},
}
_attribute_map = {
@@ -393,29 +458,27 @@ class Container(_serialization.Model): # pylint: disable=too-many-instance-attr
"liveness_probe": {"key": "properties.livenessProbe", "type": "ContainerProbe"},
"readiness_probe": {"key": "properties.readinessProbe", "type": "ContainerProbe"},
"security_context": {"key": "properties.securityContext", "type": "SecurityContextDefinition"},
- "config_map": {"key": "properties.configMap", "type": "ConfigMap"},
}
def __init__(
self,
*,
name: str,
- image: Optional[str] = None,
+ image: str,
+ resources: "_models.ResourceRequirements",
command: Optional[List[str]] = None,
ports: Optional[List["_models.ContainerPort"]] = None,
environment_variables: Optional[List["_models.EnvironmentVariable"]] = None,
- resources: Optional["_models.ResourceRequirements"] = None,
volume_mounts: Optional[List["_models.VolumeMount"]] = None,
liveness_probe: Optional["_models.ContainerProbe"] = None,
readiness_probe: Optional["_models.ContainerProbe"] = None,
security_context: Optional["_models.SecurityContextDefinition"] = None,
- config_map: Optional["_models.ConfigMap"] = None,
**kwargs: Any
) -> None:
"""
:keyword name: The user-provided name of the container instance. Required.
:paramtype name: str
- :keyword image: The name of the image used to create the container instance.
+ :keyword image: The name of the image used to create the container instance. Required.
:paramtype image: str
:keyword command: The commands to execute within the container instance in exec form.
:paramtype command: list[str]
@@ -424,7 +487,7 @@ def __init__(
:keyword environment_variables: The environment variables to set in the container instance.
:paramtype environment_variables:
list[~azure.mgmt.containerinstance.models.EnvironmentVariable]
- :keyword resources: The resource requirements of the container instance.
+ :keyword resources: The resource requirements of the container instance. Required.
:paramtype resources: ~azure.mgmt.containerinstance.models.ResourceRequirements
:keyword volume_mounts: The volume mounts available to the container instance.
:paramtype volume_mounts: list[~azure.mgmt.containerinstance.models.VolumeMount]
@@ -434,8 +497,6 @@ def __init__(
:paramtype readiness_probe: ~azure.mgmt.containerinstance.models.ContainerProbe
:keyword security_context: The container security properties.
:paramtype security_context: ~azure.mgmt.containerinstance.models.SecurityContextDefinition
- :keyword config_map: The config map.
- :paramtype config_map: ~azure.mgmt.containerinstance.models.ConfigMap
"""
super().__init__(**kwargs)
self.name = name
@@ -449,7 +510,6 @@ def __init__(
self.liveness_probe = liveness_probe
self.readiness_probe = readiness_probe
self.security_context = security_context
- self.config_map = config_map
class ContainerAttachResponse(_serialization.Model):
@@ -584,7 +644,7 @@ def __init__(self, *, web_socket_uri: Optional[str] = None, password: Optional[s
self.password = password
-class ContainerGroupProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class ContainerGroupProperties(_serialization.Model):
"""The container group properties.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -596,6 +656,9 @@ class ContainerGroupProperties(_serialization.Model): # pylint: disable=too-man
:ivar provisioning_state: The provisioning state of the container group. This only appears in
the response.
:vartype provisioning_state: str
+ :ivar secret_references: The secret references that will be referenced within the container
+ group.
+ :vartype secret_references: list[~azure.mgmt.containerinstance.models.SecretReference]
:ivar containers: The containers within the container group. Required.
:vartype containers: list[~azure.mgmt.containerinstance.models.Container]
:ivar image_registry_credentials: The image registry credentials by which the container group
@@ -613,7 +676,7 @@ class ContainerGroupProperties(_serialization.Model): # pylint: disable=too-man
:ivar ip_address: The IP address type of the container group.
:vartype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
:ivar os_type: The operating system type required by the containers in the container group.
- Known values are: "Windows" and "Linux".
+ Required. Known values are: "Windows" and "Linux".
:vartype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
:ivar volumes: The list of volumes that can be mounted by containers in this container group.
:vartype volumes: list[~azure.mgmt.containerinstance.models.Volume]
@@ -626,8 +689,8 @@ class ContainerGroupProperties(_serialization.Model): # pylint: disable=too-man
:vartype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
:ivar dns_config: The DNS config information for a container group.
:vartype dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration
- :ivar sku: The SKU for a container group. Known values are: "Standard", "Dedicated", and
- "Confidential".
+ :ivar sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
+ "Dedicated", and "Confidential".
:vartype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
:ivar encryption_properties: The encryption properties for a container group.
:vartype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
@@ -640,27 +703,21 @@ class ContainerGroupProperties(_serialization.Model): # pylint: disable=too-man
~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
:ivar priority: The priority of the container group. Known values are: "Regular" and "Spot".
:vartype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
- :ivar container_group_profile: The reference container group profile properties.
- :vartype container_group_profile:
- ~azure.mgmt.containerinstance.models.ContainerGroupProfileReferenceDefinition
- :ivar standby_pool_profile: The reference standby pool profile properties.
- :vartype standby_pool_profile:
- ~azure.mgmt.containerinstance.models.StandbyPoolProfileDefinition
- :ivar is_created_from_standby_pool: The flag indicating whether the container group is created
- by standby pool.
- :vartype is_created_from_standby_pool: bool
+ :ivar identity_acls: The access control levels of the identities.
+ :vartype identity_acls: ~azure.mgmt.containerinstance.models.IdentityAcls
"""
_validation = {
"provisioning_state": {"readonly": True},
"containers": {"required": True},
+ "os_type": {"required": True},
"instance_view": {"readonly": True},
- "is_created_from_standby_pool": {"readonly": True},
}
_attribute_map = {
"identity": {"key": "identity", "type": "ContainerGroupIdentity"},
"provisioning_state": {"key": "properties.provisioningState", "type": "str"},
+ "secret_references": {"key": "properties.secretReferences", "type": "[SecretReference]"},
"containers": {"key": "properties.containers", "type": "[Container]"},
"image_registry_credentials": {
"key": "properties.imageRegistryCredentials",
@@ -683,23 +740,19 @@ class ContainerGroupProperties(_serialization.Model): # pylint: disable=too-man
"type": "ConfidentialComputeProperties",
},
"priority": {"key": "properties.priority", "type": "str"},
- "container_group_profile": {
- "key": "properties.containerGroupProfile",
- "type": "ContainerGroupProfileReferenceDefinition",
- },
- "standby_pool_profile": {"key": "properties.standbyPoolProfile", "type": "StandbyPoolProfileDefinition"},
- "is_created_from_standby_pool": {"key": "properties.isCreatedFromStandbyPool", "type": "bool"},
+ "identity_acls": {"key": "properties.identityAcls", "type": "IdentityAcls"},
}
def __init__(
self,
*,
containers: List["_models.Container"],
+ os_type: Union[str, "_models.OperatingSystemTypes"],
identity: Optional["_models.ContainerGroupIdentity"] = None,
+ secret_references: Optional[List["_models.SecretReference"]] = None,
image_registry_credentials: Optional[List["_models.ImageRegistryCredential"]] = None,
restart_policy: Optional[Union[str, "_models.ContainerGroupRestartPolicy"]] = None,
ip_address: Optional["_models.IpAddress"] = None,
- os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None,
volumes: Optional[List["_models.Volume"]] = None,
diagnostics: Optional["_models.ContainerGroupDiagnostics"] = None,
subnet_ids: Optional[List["_models.ContainerGroupSubnetId"]] = None,
@@ -710,13 +763,15 @@ def __init__(
extensions: Optional[List["_models.DeploymentExtensionSpec"]] = None,
confidential_compute_properties: Optional["_models.ConfidentialComputeProperties"] = None,
priority: Optional[Union[str, "_models.ContainerGroupPriority"]] = None,
- container_group_profile: Optional["_models.ContainerGroupProfileReferenceDefinition"] = None,
- standby_pool_profile: Optional["_models.StandbyPoolProfileDefinition"] = None,
+ identity_acls: Optional["_models.IdentityAcls"] = None,
**kwargs: Any
) -> None:
"""
:keyword identity: The identity of the container group, if configured.
:paramtype identity: ~azure.mgmt.containerinstance.models.ContainerGroupIdentity
+ :keyword secret_references: The secret references that will be referenced within the container
+ group.
+ :paramtype secret_references: list[~azure.mgmt.containerinstance.models.SecretReference]
:keyword containers: The containers within the container group. Required.
:paramtype containers: list[~azure.mgmt.containerinstance.models.Container]
:keyword image_registry_credentials: The image registry credentials by which the container
@@ -734,7 +789,7 @@ def __init__(
:keyword ip_address: The IP address type of the container group.
:paramtype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
:keyword os_type: The operating system type required by the containers in the container group.
- Known values are: "Windows" and "Linux".
+ Required. Known values are: "Windows" and "Linux".
:paramtype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
:keyword volumes: The list of volumes that can be mounted by containers in this container
group.
@@ -745,8 +800,8 @@ def __init__(
:paramtype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
:keyword dns_config: The DNS config information for a container group.
:paramtype dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration
- :keyword sku: The SKU for a container group. Known values are: "Standard", "Dedicated", and
- "Confidential".
+ :keyword sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
+ "Dedicated", and "Confidential".
:paramtype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
:keyword encryption_properties: The encryption properties for a container group.
:paramtype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
@@ -759,16 +814,13 @@ def __init__(
~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
:keyword priority: The priority of the container group. Known values are: "Regular" and "Spot".
:paramtype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
- :keyword container_group_profile: The reference container group profile properties.
- :paramtype container_group_profile:
- ~azure.mgmt.containerinstance.models.ContainerGroupProfileReferenceDefinition
- :keyword standby_pool_profile: The reference standby pool profile properties.
- :paramtype standby_pool_profile:
- ~azure.mgmt.containerinstance.models.StandbyPoolProfileDefinition
+ :keyword identity_acls: The access control levels of the identities.
+ :paramtype identity_acls: ~azure.mgmt.containerinstance.models.IdentityAcls
"""
super().__init__(**kwargs)
self.identity = identity
self.provisioning_state = None
+ self.secret_references = secret_references
self.containers = containers
self.image_registry_credentials = image_registry_credentials
self.restart_policy = restart_policy
@@ -785,9 +837,7 @@ def __init__(
self.extensions = extensions
self.confidential_compute_properties = confidential_compute_properties
self.priority = priority
- self.container_group_profile = container_group_profile
- self.standby_pool_profile = standby_pool_profile
- self.is_created_from_standby_pool = None
+ self.identity_acls = identity_acls
class Resource(_serialization.Model):
@@ -849,7 +899,7 @@ def __init__(
self.zones = zones
-class ContainerGroup(Resource, ContainerGroupProperties): # pylint: disable=too-many-instance-attributes
+class ContainerGroup(Resource, ContainerGroupProperties):
"""A container group.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -861,6 +911,9 @@ class ContainerGroup(Resource, ContainerGroupProperties): # pylint: disable=too
:ivar provisioning_state: The provisioning state of the container group. This only appears in
the response.
:vartype provisioning_state: str
+ :ivar secret_references: The secret references that will be referenced within the container
+ group.
+ :vartype secret_references: list[~azure.mgmt.containerinstance.models.SecretReference]
:ivar containers: The containers within the container group. Required.
:vartype containers: list[~azure.mgmt.containerinstance.models.Container]
:ivar image_registry_credentials: The image registry credentials by which the container group
@@ -878,7 +931,7 @@ class ContainerGroup(Resource, ContainerGroupProperties): # pylint: disable=too
:ivar ip_address: The IP address type of the container group.
:vartype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
:ivar os_type: The operating system type required by the containers in the container group.
- Known values are: "Windows" and "Linux".
+ Required. Known values are: "Windows" and "Linux".
:vartype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
:ivar volumes: The list of volumes that can be mounted by containers in this container group.
:vartype volumes: list[~azure.mgmt.containerinstance.models.Volume]
@@ -891,8 +944,8 @@ class ContainerGroup(Resource, ContainerGroupProperties): # pylint: disable=too
:vartype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
:ivar dns_config: The DNS config information for a container group.
:vartype dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration
- :ivar sku: The SKU for a container group. Known values are: "Standard", "Dedicated", and
- "Confidential".
+ :ivar sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
+ "Dedicated", and "Confidential".
:vartype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
:ivar encryption_properties: The encryption properties for a container group.
:vartype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
@@ -905,15 +958,8 @@ class ContainerGroup(Resource, ContainerGroupProperties): # pylint: disable=too
~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
:ivar priority: The priority of the container group. Known values are: "Regular" and "Spot".
:vartype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
- :ivar container_group_profile: The reference container group profile properties.
- :vartype container_group_profile:
- ~azure.mgmt.containerinstance.models.ContainerGroupProfileReferenceDefinition
- :ivar standby_pool_profile: The reference standby pool profile properties.
- :vartype standby_pool_profile:
- ~azure.mgmt.containerinstance.models.StandbyPoolProfileDefinition
- :ivar is_created_from_standby_pool: The flag indicating whether the container group is created
- by standby pool.
- :vartype is_created_from_standby_pool: bool
+ :ivar identity_acls: The access control levels of the identities.
+ :vartype identity_acls: ~azure.mgmt.containerinstance.models.IdentityAcls
:ivar id: The resource id.
:vartype id: str
:ivar name: The resource name.
@@ -931,8 +977,8 @@ class ContainerGroup(Resource, ContainerGroupProperties): # pylint: disable=too
_validation = {
"provisioning_state": {"readonly": True},
"containers": {"required": True},
+ "os_type": {"required": True},
"instance_view": {"readonly": True},
- "is_created_from_standby_pool": {"readonly": True},
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
@@ -941,6 +987,7 @@ class ContainerGroup(Resource, ContainerGroupProperties): # pylint: disable=too
_attribute_map = {
"identity": {"key": "identity", "type": "ContainerGroupIdentity"},
"provisioning_state": {"key": "properties.provisioningState", "type": "str"},
+ "secret_references": {"key": "properties.secretReferences", "type": "[SecretReference]"},
"containers": {"key": "properties.containers", "type": "[Container]"},
"image_registry_credentials": {
"key": "properties.imageRegistryCredentials",
@@ -963,12 +1010,7 @@ class ContainerGroup(Resource, ContainerGroupProperties): # pylint: disable=too
"type": "ConfidentialComputeProperties",
},
"priority": {"key": "properties.priority", "type": "str"},
- "container_group_profile": {
- "key": "properties.containerGroupProfile",
- "type": "ContainerGroupProfileReferenceDefinition",
- },
- "standby_pool_profile": {"key": "properties.standbyPoolProfile", "type": "StandbyPoolProfileDefinition"},
- "is_created_from_standby_pool": {"key": "properties.isCreatedFromStandbyPool", "type": "bool"},
+ "identity_acls": {"key": "properties.identityAcls", "type": "IdentityAcls"},
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
@@ -981,11 +1023,12 @@ def __init__( # pylint: disable=too-many-locals
self,
*,
containers: List["_models.Container"],
+ os_type: Union[str, "_models.OperatingSystemTypes"],
identity: Optional["_models.ContainerGroupIdentity"] = None,
+ secret_references: Optional[List["_models.SecretReference"]] = None,
image_registry_credentials: Optional[List["_models.ImageRegistryCredential"]] = None,
restart_policy: Optional[Union[str, "_models.ContainerGroupRestartPolicy"]] = None,
ip_address: Optional["_models.IpAddress"] = None,
- os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None,
volumes: Optional[List["_models.Volume"]] = None,
diagnostics: Optional["_models.ContainerGroupDiagnostics"] = None,
subnet_ids: Optional[List["_models.ContainerGroupSubnetId"]] = None,
@@ -996,8 +1039,7 @@ def __init__( # pylint: disable=too-many-locals
extensions: Optional[List["_models.DeploymentExtensionSpec"]] = None,
confidential_compute_properties: Optional["_models.ConfidentialComputeProperties"] = None,
priority: Optional[Union[str, "_models.ContainerGroupPriority"]] = None,
- container_group_profile: Optional["_models.ContainerGroupProfileReferenceDefinition"] = None,
- standby_pool_profile: Optional["_models.StandbyPoolProfileDefinition"] = None,
+ identity_acls: Optional["_models.IdentityAcls"] = None,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
zones: Optional[List[str]] = None,
@@ -1006,6 +1048,9 @@ def __init__( # pylint: disable=too-many-locals
"""
:keyword identity: The identity of the container group, if configured.
:paramtype identity: ~azure.mgmt.containerinstance.models.ContainerGroupIdentity
+ :keyword secret_references: The secret references that will be referenced within the container
+ group.
+ :paramtype secret_references: list[~azure.mgmt.containerinstance.models.SecretReference]
:keyword containers: The containers within the container group. Required.
:paramtype containers: list[~azure.mgmt.containerinstance.models.Container]
:keyword image_registry_credentials: The image registry credentials by which the container
@@ -1023,7 +1068,7 @@ def __init__( # pylint: disable=too-many-locals
:keyword ip_address: The IP address type of the container group.
:paramtype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
:keyword os_type: The operating system type required by the containers in the container group.
- Known values are: "Windows" and "Linux".
+ Required. Known values are: "Windows" and "Linux".
:paramtype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
:keyword volumes: The list of volumes that can be mounted by containers in this container
group.
@@ -1034,8 +1079,8 @@ def __init__( # pylint: disable=too-many-locals
:paramtype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
:keyword dns_config: The DNS config information for a container group.
:paramtype dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration
- :keyword sku: The SKU for a container group. Known values are: "Standard", "Dedicated", and
- "Confidential".
+ :keyword sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
+ "Dedicated", and "Confidential".
:paramtype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
:keyword encryption_properties: The encryption properties for a container group.
:paramtype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
@@ -1048,12 +1093,8 @@ def __init__( # pylint: disable=too-many-locals
~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
:keyword priority: The priority of the container group. Known values are: "Regular" and "Spot".
:paramtype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
- :keyword container_group_profile: The reference container group profile properties.
- :paramtype container_group_profile:
- ~azure.mgmt.containerinstance.models.ContainerGroupProfileReferenceDefinition
- :keyword standby_pool_profile: The reference standby pool profile properties.
- :paramtype standby_pool_profile:
- ~azure.mgmt.containerinstance.models.StandbyPoolProfileDefinition
+ :keyword identity_acls: The access control levels of the identities.
+ :paramtype identity_acls: ~azure.mgmt.containerinstance.models.IdentityAcls
:keyword location: The resource location.
:paramtype location: str
:keyword tags: The resource tags.
@@ -1066,6 +1107,7 @@ def __init__( # pylint: disable=too-many-locals
tags=tags,
zones=zones,
identity=identity,
+ secret_references=secret_references,
containers=containers,
image_registry_credentials=image_registry_credentials,
restart_policy=restart_policy,
@@ -1081,12 +1123,12 @@ def __init__( # pylint: disable=too-many-locals
extensions=extensions,
confidential_compute_properties=confidential_compute_properties,
priority=priority,
- container_group_profile=container_group_profile,
- standby_pool_profile=standby_pool_profile,
+ identity_acls=identity_acls,
**kwargs
)
self.identity = identity
self.provisioning_state = None
+ self.secret_references = secret_references
self.containers = containers
self.image_registry_credentials = image_registry_credentials
self.restart_policy = restart_policy
@@ -1103,9 +1145,7 @@ def __init__( # pylint: disable=too-many-locals
self.extensions = extensions
self.confidential_compute_properties = confidential_compute_properties
self.priority = priority
- self.container_group_profile = container_group_profile
- self.standby_pool_profile = standby_pool_profile
- self.is_created_from_standby_pool = None
+ self.identity_acls = identity_acls
self.id = None
self.name = None
self.type = None
@@ -1197,22 +1237,26 @@ class ContainerGroupListResult(_serialization.Model):
"""The container group list response that contains the container group properties.
:ivar value: The list of container groups.
- :vartype value: list[~azure.mgmt.containerinstance.models.ContainerGroup]
+ :vartype value: list[~azure.mgmt.containerinstance.models.ListResultContainerGroup]
:ivar next_link: The URI to fetch the next page of container groups.
:vartype next_link: str
"""
_attribute_map = {
- "value": {"key": "value", "type": "[ContainerGroup]"},
+ "value": {"key": "value", "type": "[ListResultContainerGroup]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
- self, *, value: Optional[List["_models.ContainerGroup"]] = None, next_link: Optional[str] = None, **kwargs: Any
+ self,
+ *,
+ value: Optional[List["_models.ListResultContainerGroup"]] = None,
+ next_link: Optional[str] = None,
+ **kwargs: Any
) -> None:
"""
:keyword value: The list of container groups.
- :paramtype value: list[~azure.mgmt.containerinstance.models.ContainerGroup]
+ :paramtype value: list[~azure.mgmt.containerinstance.models.ListResultContainerGroup]
:keyword next_link: The URI to fetch the next page of container groups.
:paramtype next_link: str
"""
@@ -1221,15 +1265,36 @@ def __init__(
self.next_link = next_link
-class ContainerGroupProfileProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
- """The container group profile properties.
+class ContainerGroupProfile(Resource):
+ """container group profile object.
Variables are only populated by the server, and will be ignored when sending a request.
- All required parameters must be populated in order to send to server.
-
- :ivar containers: The containers within the container group. Required.
+ :ivar id: The resource id.
+ :vartype id: str
+ :ivar name: The resource name.
+ :vartype name: str
+ :ivar type: The resource type.
+ :vartype type: str
+ :ivar location: The resource location.
+ :vartype location: str
+ :ivar tags: The resource tags.
+ :vartype tags: dict[str, str]
+ :ivar zones: The zones for the container group.
+ :vartype zones: list[str]
+ :ivar system_data: Metadata pertaining to creation and last modification of the resource.
+ :vartype system_data: ~azure.mgmt.containerinstance.models.SystemData
+ :ivar sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
+ "Dedicated", and "Confidential".
+ :vartype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
+ :ivar encryption_properties: The encryption properties for a container group.
+ :vartype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
+ :ivar containers: The containers within the container group.
:vartype containers: list[~azure.mgmt.containerinstance.models.Container]
+ :ivar init_containers: The init containers for a container group.
+ :vartype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
+ :ivar extensions: extensions used by virtual kubelet.
+ :vartype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
:ivar image_registry_credentials: The image registry credentials by which the container group
is created from.
:vartype image_registry_credentials:
@@ -1242,84 +1307,122 @@ class ContainerGroupProfileProperties(_serialization.Model): # pylint: disable=
* ``Never`` Never restart. Known values are: "Always", "OnFailure", and "Never".
:vartype restart_policy: str or
~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy
+ :ivar shutdown_grace_period: Shutdown grace period for containers in a container group.
+ :vartype shutdown_grace_period: ~datetime.datetime
:ivar ip_address: The IP address type of the container group.
:vartype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
+ :ivar time_to_live: Post completion time to live for containers of a CG.
+ :vartype time_to_live: ~datetime.datetime
:ivar os_type: The operating system type required by the containers in the container group.
- Required. Known values are: "Windows" and "Linux".
+ Known values are: "Windows" and "Linux".
:vartype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
:ivar volumes: The list of volumes that can be mounted by containers in this container group.
:vartype volumes: list[~azure.mgmt.containerinstance.models.Volume]
:ivar diagnostics: The diagnostic information for a container group.
:vartype diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
- :ivar sku: The SKU for a container group. Known values are: "Standard", "Dedicated", and
- "Confidential".
- :vartype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
- :ivar encryption_properties: The encryption properties for a container group.
- :vartype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
- :ivar init_containers: The init containers for a container group.
- :vartype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
- :ivar extensions: extensions used by virtual kubelet.
- :vartype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
+ :ivar priority: The priority of the container group. Known values are: "Regular" and "Spot".
+ :vartype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
:ivar confidential_compute_properties: The properties for confidential container group.
:vartype confidential_compute_properties:
~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
- :ivar priority: The priority of the container group. Known values are: "Regular" and "Spot".
- :vartype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
- :ivar revision: The container group profile current revision number. This only appears in the
- response.
+ :ivar security_context: The container security properties.
+ :vartype security_context: ~azure.mgmt.containerinstance.models.SecurityContextDefinition
+ :ivar revision: Container group profile current revision number.
:vartype revision: int
+ :ivar registered_revisions: Registered revisions are calculated at request time based off the
+ records in the table logs.
+ :vartype registered_revisions: list[int]
+ :ivar use_krypton: Gets or sets Krypton use property.
+ :vartype use_krypton: bool
"""
_validation = {
- "containers": {"required": True},
- "os_type": {"required": True},
- "revision": {"readonly": True},
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
}
_attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "location": {"key": "location", "type": "str"},
+ "tags": {"key": "tags", "type": "{str}"},
+ "zones": {"key": "zones", "type": "[str]"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "sku": {"key": "properties.sku", "type": "str"},
+ "encryption_properties": {"key": "properties.encryptionProperties", "type": "EncryptionProperties"},
"containers": {"key": "properties.containers", "type": "[Container]"},
+ "init_containers": {"key": "properties.initContainers", "type": "[InitContainerDefinition]"},
+ "extensions": {"key": "properties.extensions", "type": "[DeploymentExtensionSpec]"},
"image_registry_credentials": {
"key": "properties.imageRegistryCredentials",
"type": "[ImageRegistryCredential]",
},
"restart_policy": {"key": "properties.restartPolicy", "type": "str"},
+ "shutdown_grace_period": {"key": "properties.shutdownGracePeriod", "type": "iso-8601"},
"ip_address": {"key": "properties.ipAddress", "type": "IpAddress"},
+ "time_to_live": {"key": "properties.timeToLive", "type": "iso-8601"},
"os_type": {"key": "properties.osType", "type": "str"},
"volumes": {"key": "properties.volumes", "type": "[Volume]"},
"diagnostics": {"key": "properties.diagnostics", "type": "ContainerGroupDiagnostics"},
- "sku": {"key": "properties.sku", "type": "str"},
- "encryption_properties": {"key": "properties.encryptionProperties", "type": "EncryptionProperties"},
- "init_containers": {"key": "properties.initContainers", "type": "[InitContainerDefinition]"},
- "extensions": {"key": "properties.extensions", "type": "[DeploymentExtensionSpec]"},
+ "priority": {"key": "properties.priority", "type": "str"},
"confidential_compute_properties": {
"key": "properties.confidentialComputeProperties",
"type": "ConfidentialComputeProperties",
},
- "priority": {"key": "properties.priority", "type": "str"},
+ "security_context": {"key": "properties.securityContext", "type": "SecurityContextDefinition"},
"revision": {"key": "properties.revision", "type": "int"},
+ "registered_revisions": {"key": "properties.registeredRevisions", "type": "[int]"},
+ "use_krypton": {"key": "properties.useKrypton", "type": "bool"},
}
- def __init__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
- containers: List["_models.Container"],
- os_type: Union[str, "_models.OperatingSystemTypes"],
+ location: Optional[str] = None,
+ tags: Optional[Dict[str, str]] = None,
+ zones: Optional[List[str]] = None,
+ sku: Optional[Union[str, "_models.ContainerGroupSku"]] = None,
+ encryption_properties: Optional["_models.EncryptionProperties"] = None,
+ containers: Optional[List["_models.Container"]] = None,
+ init_containers: Optional[List["_models.InitContainerDefinition"]] = None,
+ extensions: Optional[List["_models.DeploymentExtensionSpec"]] = None,
image_registry_credentials: Optional[List["_models.ImageRegistryCredential"]] = None,
restart_policy: Optional[Union[str, "_models.ContainerGroupRestartPolicy"]] = None,
+ shutdown_grace_period: Optional[datetime.datetime] = None,
ip_address: Optional["_models.IpAddress"] = None,
+ time_to_live: Optional[datetime.datetime] = None,
+ os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None,
volumes: Optional[List["_models.Volume"]] = None,
diagnostics: Optional["_models.ContainerGroupDiagnostics"] = None,
- sku: Optional[Union[str, "_models.ContainerGroupSku"]] = None,
- encryption_properties: Optional["_models.EncryptionProperties"] = None,
- init_containers: Optional[List["_models.InitContainerDefinition"]] = None,
- extensions: Optional[List["_models.DeploymentExtensionSpec"]] = None,
- confidential_compute_properties: Optional["_models.ConfidentialComputeProperties"] = None,
priority: Optional[Union[str, "_models.ContainerGroupPriority"]] = None,
+ confidential_compute_properties: Optional["_models.ConfidentialComputeProperties"] = None,
+ security_context: Optional["_models.SecurityContextDefinition"] = None,
+ revision: Optional[int] = None,
+ registered_revisions: Optional[List[int]] = None,
+ use_krypton: Optional[bool] = None,
**kwargs: Any
) -> None:
"""
- :keyword containers: The containers within the container group. Required.
+ :keyword location: The resource location.
+ :paramtype location: str
+ :keyword tags: The resource tags.
+ :paramtype tags: dict[str, str]
+ :keyword zones: The zones for the container group.
+ :paramtype zones: list[str]
+ :keyword sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
+ "Dedicated", and "Confidential".
+ :paramtype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
+ :keyword encryption_properties: The encryption properties for a container group.
+ :paramtype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
+ :keyword containers: The containers within the container group.
:paramtype containers: list[~azure.mgmt.containerinstance.models.Container]
+ :keyword init_containers: The init containers for a container group.
+ :paramtype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
+ :keyword extensions: extensions used by virtual kubelet.
+ :paramtype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
:keyword image_registry_credentials: The image registry credentials by which the container
group is created from.
:paramtype image_registry_credentials:
@@ -1332,285 +1435,88 @@ def __init__(
* ``Never`` Never restart. Known values are: "Always", "OnFailure", and "Never".
:paramtype restart_policy: str or
~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy
+ :keyword shutdown_grace_period: Shutdown grace period for containers in a container group.
+ :paramtype shutdown_grace_period: ~datetime.datetime
:keyword ip_address: The IP address type of the container group.
:paramtype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
+ :keyword time_to_live: Post completion time to live for containers of a CG.
+ :paramtype time_to_live: ~datetime.datetime
:keyword os_type: The operating system type required by the containers in the container group.
- Required. Known values are: "Windows" and "Linux".
+ Known values are: "Windows" and "Linux".
:paramtype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
:keyword volumes: The list of volumes that can be mounted by containers in this container
group.
:paramtype volumes: list[~azure.mgmt.containerinstance.models.Volume]
:keyword diagnostics: The diagnostic information for a container group.
:paramtype diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
- :keyword sku: The SKU for a container group. Known values are: "Standard", "Dedicated", and
- "Confidential".
- :paramtype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
- :keyword encryption_properties: The encryption properties for a container group.
- :paramtype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
- :keyword init_containers: The init containers for a container group.
- :paramtype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
- :keyword extensions: extensions used by virtual kubelet.
- :paramtype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
+ :keyword priority: The priority of the container group. Known values are: "Regular" and "Spot".
+ :paramtype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
:keyword confidential_compute_properties: The properties for confidential container group.
:paramtype confidential_compute_properties:
~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
- :keyword priority: The priority of the container group. Known values are: "Regular" and "Spot".
- :paramtype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
+ :keyword security_context: The container security properties.
+ :paramtype security_context: ~azure.mgmt.containerinstance.models.SecurityContextDefinition
+ :keyword revision: Container group profile current revision number.
+ :paramtype revision: int
+ :keyword registered_revisions: Registered revisions are calculated at request time based off
+ the records in the table logs.
+ :paramtype registered_revisions: list[int]
+ :keyword use_krypton: Gets or sets Krypton use property.
+ :paramtype use_krypton: bool
"""
- super().__init__(**kwargs)
+ super().__init__(location=location, tags=tags, zones=zones, **kwargs)
+ self.system_data = None
+ self.sku = sku
+ self.encryption_properties = encryption_properties
self.containers = containers
+ self.init_containers = init_containers
+ self.extensions = extensions
self.image_registry_credentials = image_registry_credentials
self.restart_policy = restart_policy
+ self.shutdown_grace_period = shutdown_grace_period
self.ip_address = ip_address
+ self.time_to_live = time_to_live
self.os_type = os_type
self.volumes = volumes
self.diagnostics = diagnostics
- self.sku = sku
- self.encryption_properties = encryption_properties
- self.init_containers = init_containers
- self.extensions = extensions
- self.confidential_compute_properties = confidential_compute_properties
self.priority = priority
- self.revision = None
+ self.confidential_compute_properties = confidential_compute_properties
+ self.security_context = security_context
+ self.revision = revision
+ self.registered_revisions = registered_revisions
+ self.use_krypton = use_krypton
-class ContainerGroupProfile(Resource, ContainerGroupProfileProperties): # pylint: disable=too-many-instance-attributes
- """A container group profile.
+class ContainerGroupProfileListResult(_serialization.Model):
+ """The container group profile list response.
- Variables are only populated by the server, and will be ignored when sending a request.
+ :ivar value: The list of ContainerGroupProfiles under a subscription or resource group.
+ :vartype value: list[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
+ :ivar next_link: The URI to fetch the next page of Container Group Profiles.
+ :vartype next_link: str
+ """
- All required parameters must be populated in order to send to server.
+ _attribute_map = {
+ "value": {"key": "value", "type": "[ContainerGroupProfile]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
- :ivar containers: The containers within the container group. Required.
- :vartype containers: list[~azure.mgmt.containerinstance.models.Container]
- :ivar image_registry_credentials: The image registry credentials by which the container group
- is created from.
- :vartype image_registry_credentials:
- list[~azure.mgmt.containerinstance.models.ImageRegistryCredential]
- :ivar restart_policy: Restart policy for all containers within the container group.
-
-
- * ``Always`` Always restart
- * ``OnFailure`` Restart on failure
- * ``Never`` Never restart. Known values are: "Always", "OnFailure", and "Never".
- :vartype restart_policy: str or
- ~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy
- :ivar ip_address: The IP address type of the container group.
- :vartype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
- :ivar os_type: The operating system type required by the containers in the container group.
- Required. Known values are: "Windows" and "Linux".
- :vartype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
- :ivar volumes: The list of volumes that can be mounted by containers in this container group.
- :vartype volumes: list[~azure.mgmt.containerinstance.models.Volume]
- :ivar diagnostics: The diagnostic information for a container group.
- :vartype diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
- :ivar sku: The SKU for a container group. Known values are: "Standard", "Dedicated", and
- "Confidential".
- :vartype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
- :ivar encryption_properties: The encryption properties for a container group.
- :vartype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
- :ivar init_containers: The init containers for a container group.
- :vartype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
- :ivar extensions: extensions used by virtual kubelet.
- :vartype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
- :ivar confidential_compute_properties: The properties for confidential container group.
- :vartype confidential_compute_properties:
- ~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
- :ivar priority: The priority of the container group. Known values are: "Regular" and "Spot".
- :vartype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
- :ivar revision: The container group profile current revision number. This only appears in the
- response.
- :vartype revision: int
- :ivar id: The resource id.
- :vartype id: str
- :ivar name: The resource name.
- :vartype name: str
- :ivar type: The resource type.
- :vartype type: str
- :ivar location: The resource location.
- :vartype location: str
- :ivar tags: The resource tags.
- :vartype tags: dict[str, str]
- :ivar zones: The zones for the container group.
- :vartype zones: list[str]
- """
-
- _validation = {
- "containers": {"required": True},
- "os_type": {"required": True},
- "revision": {"readonly": True},
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- }
-
- _attribute_map = {
- "containers": {"key": "properties.containers", "type": "[Container]"},
- "image_registry_credentials": {
- "key": "properties.imageRegistryCredentials",
- "type": "[ImageRegistryCredential]",
- },
- "restart_policy": {"key": "properties.restartPolicy", "type": "str"},
- "ip_address": {"key": "properties.ipAddress", "type": "IpAddress"},
- "os_type": {"key": "properties.osType", "type": "str"},
- "volumes": {"key": "properties.volumes", "type": "[Volume]"},
- "diagnostics": {"key": "properties.diagnostics", "type": "ContainerGroupDiagnostics"},
- "sku": {"key": "properties.sku", "type": "str"},
- "encryption_properties": {"key": "properties.encryptionProperties", "type": "EncryptionProperties"},
- "init_containers": {"key": "properties.initContainers", "type": "[InitContainerDefinition]"},
- "extensions": {"key": "properties.extensions", "type": "[DeploymentExtensionSpec]"},
- "confidential_compute_properties": {
- "key": "properties.confidentialComputeProperties",
- "type": "ConfidentialComputeProperties",
- },
- "priority": {"key": "properties.priority", "type": "str"},
- "revision": {"key": "properties.revision", "type": "int"},
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "location": {"key": "location", "type": "str"},
- "tags": {"key": "tags", "type": "{str}"},
- "zones": {"key": "zones", "type": "[str]"},
- }
-
- def __init__(
- self,
- *,
- containers: List["_models.Container"],
- os_type: Union[str, "_models.OperatingSystemTypes"],
- image_registry_credentials: Optional[List["_models.ImageRegistryCredential"]] = None,
- restart_policy: Optional[Union[str, "_models.ContainerGroupRestartPolicy"]] = None,
- ip_address: Optional["_models.IpAddress"] = None,
- volumes: Optional[List["_models.Volume"]] = None,
- diagnostics: Optional["_models.ContainerGroupDiagnostics"] = None,
- sku: Optional[Union[str, "_models.ContainerGroupSku"]] = None,
- encryption_properties: Optional["_models.EncryptionProperties"] = None,
- init_containers: Optional[List["_models.InitContainerDefinition"]] = None,
- extensions: Optional[List["_models.DeploymentExtensionSpec"]] = None,
- confidential_compute_properties: Optional["_models.ConfidentialComputeProperties"] = None,
- priority: Optional[Union[str, "_models.ContainerGroupPriority"]] = None,
- location: Optional[str] = None,
- tags: Optional[Dict[str, str]] = None,
- zones: Optional[List[str]] = None,
- **kwargs: Any
- ) -> None:
- """
- :keyword containers: The containers within the container group. Required.
- :paramtype containers: list[~azure.mgmt.containerinstance.models.Container]
- :keyword image_registry_credentials: The image registry credentials by which the container
- group is created from.
- :paramtype image_registry_credentials:
- list[~azure.mgmt.containerinstance.models.ImageRegistryCredential]
- :keyword restart_policy: Restart policy for all containers within the container group.
-
-
- * ``Always`` Always restart
- * ``OnFailure`` Restart on failure
- * ``Never`` Never restart. Known values are: "Always", "OnFailure", and "Never".
- :paramtype restart_policy: str or
- ~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy
- :keyword ip_address: The IP address type of the container group.
- :paramtype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
- :keyword os_type: The operating system type required by the containers in the container group.
- Required. Known values are: "Windows" and "Linux".
- :paramtype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
- :keyword volumes: The list of volumes that can be mounted by containers in this container
- group.
- :paramtype volumes: list[~azure.mgmt.containerinstance.models.Volume]
- :keyword diagnostics: The diagnostic information for a container group.
- :paramtype diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
- :keyword sku: The SKU for a container group. Known values are: "Standard", "Dedicated", and
- "Confidential".
- :paramtype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
- :keyword encryption_properties: The encryption properties for a container group.
- :paramtype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
- :keyword init_containers: The init containers for a container group.
- :paramtype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
- :keyword extensions: extensions used by virtual kubelet.
- :paramtype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
- :keyword confidential_compute_properties: The properties for confidential container group.
- :paramtype confidential_compute_properties:
- ~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
- :keyword priority: The priority of the container group. Known values are: "Regular" and "Spot".
- :paramtype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
- :keyword location: The resource location.
- :paramtype location: str
- :keyword tags: The resource tags.
- :paramtype tags: dict[str, str]
- :keyword zones: The zones for the container group.
- :paramtype zones: list[str]
- """
- super().__init__(
- location=location,
- tags=tags,
- zones=zones,
- containers=containers,
- image_registry_credentials=image_registry_credentials,
- restart_policy=restart_policy,
- ip_address=ip_address,
- os_type=os_type,
- volumes=volumes,
- diagnostics=diagnostics,
- sku=sku,
- encryption_properties=encryption_properties,
- init_containers=init_containers,
- extensions=extensions,
- confidential_compute_properties=confidential_compute_properties,
- priority=priority,
- **kwargs
- )
- self.containers = containers
- self.image_registry_credentials = image_registry_credentials
- self.restart_policy = restart_policy
- self.ip_address = ip_address
- self.os_type = os_type
- self.volumes = volumes
- self.diagnostics = diagnostics
- self.sku = sku
- self.encryption_properties = encryption_properties
- self.init_containers = init_containers
- self.extensions = extensions
- self.confidential_compute_properties = confidential_compute_properties
- self.priority = priority
- self.revision = None
- self.id = None
- self.name = None
- self.type = None
- self.location = location
- self.tags = tags
- self.zones = zones
-
-
-class ContainerGroupProfileListResult(_serialization.Model):
- """The container group profile list response that contains the container group profile properties.
-
- :ivar value: The list of container group profiles.
- :vartype value: list[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
- :ivar next_link: The URI to fetch the next page of container group profiles.
- :vartype next_link: str
- """
-
- _attribute_map = {
- "value": {"key": "value", "type": "[ContainerGroupProfile]"},
- "next_link": {"key": "nextLink", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- value: Optional[List["_models.ContainerGroupProfile"]] = None,
- next_link: Optional[str] = None,
- **kwargs: Any
- ) -> None:
- """
- :keyword value: The list of container group profiles.
- :paramtype value: list[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
- :keyword next_link: The URI to fetch the next page of container group profiles.
- :paramtype next_link: str
- """
- super().__init__(**kwargs)
- self.value = value
- self.next_link = next_link
+ def __init__(
+ self,
+ *,
+ value: Optional[List["_models.ContainerGroupProfile"]] = None,
+ next_link: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: The list of ContainerGroupProfiles under a subscription or resource group.
+ :paramtype value: list[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
+ :keyword next_link: The URI to fetch the next page of Container Group Profiles.
+ :paramtype next_link: str
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
class ContainerGroupProfilePatch(_serialization.Model):
@@ -1633,39 +1539,66 @@ def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> N
self.tags = tags
-class ContainerGroupProfileReferenceDefinition(_serialization.Model):
- """The container group profile reference.
+class ContainerGroupProfileStub(_serialization.Model):
+ """The object that contains a reference to a Container Group Profile and it's other related
+ properties.
- :ivar id: The container group profile reference id.This will be an ARM resource id in the form:
- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}'. # pylint: disable=line-too-long
- :vartype id: str
- :ivar revision: The container group profile reference revision.
+ :ivar resource: A reference to the container group profile ARM resource hosted in ACI RP.
+ :vartype resource: ~azure.mgmt.containerinstance.models.ApiEntityReference
+ :ivar revision: The revision of the CG profile is an optional property. If customer does not to
+ provide a revision then NGroups will pickup the latest revision of CGProfile.
:vartype revision: int
+ :ivar network_profile: A network profile for network settings of a ContainerGroupProfile.
+ :vartype network_profile: ~azure.mgmt.containerinstance.models.NetworkProfile
+ :ivar storage_profile: Storage profile for storage related settings of a container group
+ profile.
+ :vartype storage_profile: ~azure.mgmt.containerinstance.models.StorageProfile
+ :ivar container_group_properties: Container Group properties which can be set while creating or
+ updating the NGroups.
+ :vartype container_group_properties:
+ ~azure.mgmt.containerinstance.models.NGroupContainerGroupProperties
"""
_attribute_map = {
- "id": {"key": "id", "type": "str"},
+ "resource": {"key": "resource", "type": "ApiEntityReference"},
"revision": {"key": "revision", "type": "int"},
+ "network_profile": {"key": "networkProfile", "type": "NetworkProfile"},
+ "storage_profile": {"key": "storageProfile", "type": "StorageProfile"},
+ "container_group_properties": {"key": "containerGroupProperties", "type": "NGroupContainerGroupProperties"},
}
def __init__(
self,
*,
- id: Optional[str] = None, # pylint: disable=redefined-builtin
+ resource: Optional["_models.ApiEntityReference"] = None,
revision: Optional[int] = None,
+ network_profile: Optional["_models.NetworkProfile"] = None,
+ storage_profile: Optional["_models.StorageProfile"] = None,
+ container_group_properties: Optional["_models.NGroupContainerGroupProperties"] = None,
**kwargs: Any
) -> None:
"""
- :keyword id: The container group profile reference id.This will be an ARM resource id in the
- form:
- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}'. # pylint: disable=line-too-long
- :paramtype id: str
- :keyword revision: The container group profile reference revision.
+ :keyword resource: A reference to the container group profile ARM resource hosted in ACI RP.
+ :paramtype resource: ~azure.mgmt.containerinstance.models.ApiEntityReference
+ :keyword revision: The revision of the CG profile is an optional property. If customer does not
+ to provide a revision then NGroups will pickup the latest revision of CGProfile.
:paramtype revision: int
+ :keyword network_profile: A network profile for network settings of a ContainerGroupProfile.
+ :paramtype network_profile: ~azure.mgmt.containerinstance.models.NetworkProfile
+ :keyword storage_profile: Storage profile for storage related settings of a container group
+ profile.
+ :paramtype storage_profile: ~azure.mgmt.containerinstance.models.StorageProfile
+ :keyword container_group_properties: Container Group properties which can be set while creating
+ or updating the NGroups.
+ :paramtype container_group_properties:
+ ~azure.mgmt.containerinstance.models.NGroupContainerGroupProperties
"""
super().__init__(**kwargs)
- self.id = id
+ self.resource = resource
self.revision = revision
+ self.network_profile = network_profile
+ self.storage_profile = storage_profile
+ self.container_group_properties = container_group_properties
class ContainerGroupPropertiesInstanceView(_serialization.Model):
@@ -2069,6 +2002,113 @@ def __init__(
self.options = options
+class ElasticProfile(_serialization.Model):
+ """Describes the elastic profile of the NGroup.
+
+ :ivar desired_count:
+ :vartype desired_count: int
+ :ivar maintain_desired_count: Flag that indicates whether desiredCount should be maintained
+ when customer deletes SPECIFIC container groups (CGs) from the NGroups. In this case, new CGs
+ will be created by NGroup to compensate for the specific deleted ones.
+ :vartype maintain_desired_count: bool
+ :ivar container_group_naming_policy: Container Groups are named on a generic guid based naming
+ scheme/policy. Customer can modify naming policy to add prefix to CG names during scale out
+ operation.
+ :vartype container_group_naming_policy:
+ ~azure.mgmt.containerinstance.models.ElasticProfileContainerGroupNamingPolicy
+ """
+
+ _attribute_map = {
+ "desired_count": {"key": "desiredCount", "type": "int"},
+ "maintain_desired_count": {"key": "maintainDesiredCount", "type": "bool"},
+ "container_group_naming_policy": {
+ "key": "containerGroupNamingPolicy",
+ "type": "ElasticProfileContainerGroupNamingPolicy",
+ },
+ }
+
+ def __init__(
+ self,
+ *,
+ desired_count: Optional[int] = None,
+ maintain_desired_count: Optional[bool] = None,
+ container_group_naming_policy: Optional["_models.ElasticProfileContainerGroupNamingPolicy"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword desired_count:
+ :paramtype desired_count: int
+ :keyword maintain_desired_count: Flag that indicates whether desiredCount should be maintained
+ when customer deletes SPECIFIC container groups (CGs) from the NGroups. In this case, new CGs
+ will be created by NGroup to compensate for the specific deleted ones.
+ :paramtype maintain_desired_count: bool
+ :keyword container_group_naming_policy: Container Groups are named on a generic guid based
+ naming scheme/policy. Customer can modify naming policy to add prefix to CG names during scale
+ out operation.
+ :paramtype container_group_naming_policy:
+ ~azure.mgmt.containerinstance.models.ElasticProfileContainerGroupNamingPolicy
+ """
+ super().__init__(**kwargs)
+ self.desired_count = desired_count
+ self.maintain_desired_count = maintain_desired_count
+ self.container_group_naming_policy = container_group_naming_policy
+
+
+class ElasticProfileContainerGroupNamingPolicy(_serialization.Model):
+ """Container Groups are named on a generic guid based naming scheme/policy. Customer can modify
+ naming policy to add prefix to CG names during scale out operation.
+
+ :ivar guid_naming_policy:
+ :vartype guid_naming_policy:
+ ~azure.mgmt.containerinstance.models.ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy
+ """
+
+ _attribute_map = {
+ "guid_naming_policy": {
+ "key": "guidNamingPolicy",
+ "type": "ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy",
+ },
+ }
+
+ def __init__(
+ self,
+ *,
+ guid_naming_policy: Optional["_models.ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword guid_naming_policy:
+ :paramtype guid_naming_policy:
+ ~azure.mgmt.containerinstance.models.ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy
+ """
+ super().__init__(**kwargs)
+ self.guid_naming_policy = guid_naming_policy
+
+
+class ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy(_serialization.Model): # pylint: disable=name-too-long
+ """ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy.
+
+ :ivar prefix: The prefix can be used when there are tooling limitations (e.g. on the Azure
+ portal where CGs from multiple NGroups exist in the same RG). The prefix with the suffixed
+ resource name must still follow Azure resource naming guidelines.
+ :vartype prefix: str
+ """
+
+ _attribute_map = {
+ "prefix": {"key": "prefix", "type": "str"},
+ }
+
+ def __init__(self, *, prefix: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword prefix: The prefix can be used when there are tooling limitations (e.g. on the Azure
+ portal where CGs from multiple NGroups exist in the same RG). The prefix with the suffixed
+ resource name must still follow Azure resource naming guidelines.
+ :paramtype prefix: str
+ """
+ super().__init__(**kwargs)
+ self.prefix = prefix
+
+
class EncryptionProperties(_serialization.Model):
"""The container group encryption properties.
@@ -2128,6 +2168,8 @@ class EnvironmentVariable(_serialization.Model):
:vartype value: str
:ivar secure_value: The value of the secure environment variable.
:vartype secure_value: str
+ :ivar secure_value_reference: The reference of the secure environment variable.
+ :vartype secure_value_reference: str
"""
_validation = {
@@ -2138,10 +2180,17 @@ class EnvironmentVariable(_serialization.Model):
"name": {"key": "name", "type": "str"},
"value": {"key": "value", "type": "str"},
"secure_value": {"key": "secureValue", "type": "str"},
+ "secure_value_reference": {"key": "secureValueReference", "type": "str"},
}
def __init__(
- self, *, name: str, value: Optional[str] = None, secure_value: Optional[str] = None, **kwargs: Any
+ self,
+ *,
+ name: str,
+ value: Optional[str] = None,
+ secure_value: Optional[str] = None,
+ secure_value_reference: Optional[str] = None,
+ **kwargs: Any
) -> None:
"""
:keyword name: The name of the environment variable. Required.
@@ -2150,22 +2199,117 @@ def __init__(
:paramtype value: str
:keyword secure_value: The value of the secure environment variable.
:paramtype secure_value: str
+ :keyword secure_value_reference: The reference of the secure environment variable.
+ :paramtype secure_value_reference: str
"""
super().__init__(**kwargs)
self.name = name
self.value = value
self.secure_value = secure_value
+ self.secure_value_reference = secure_value_reference
-class Event(_serialization.Model):
- """A container group or container instance event.
+class ErrorAdditionalInfo(_serialization.Model):
+ """The resource management error additional info.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar count: The count of the event.
- :vartype count: int
- :ivar first_timestamp: The date-time of the earliest logged event.
- :vartype first_timestamp: ~datetime.datetime
+ :ivar type: The additional info type.
+ :vartype type: str
+ :ivar info: The additional info.
+ :vartype info: JSON
+ """
+
+ _validation = {
+ "type": {"readonly": True},
+ "info": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "info": {"key": "info", "type": "object"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.type = None
+ self.info = None
+
+
+class ErrorDetail(_serialization.Model):
+ """The error detail.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar code: The error code.
+ :vartype code: str
+ :ivar message: The error message.
+ :vartype message: str
+ :ivar target: The error target.
+ :vartype target: str
+ :ivar details: The error details.
+ :vartype details: list[~azure.mgmt.containerinstance.models.ErrorDetail]
+ :ivar additional_info: The error additional info.
+ :vartype additional_info: list[~azure.mgmt.containerinstance.models.ErrorAdditionalInfo]
+ """
+
+ _validation = {
+ "code": {"readonly": True},
+ "message": {"readonly": True},
+ "target": {"readonly": True},
+ "details": {"readonly": True},
+ "additional_info": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "code": {"key": "code", "type": "str"},
+ "message": {"key": "message", "type": "str"},
+ "target": {"key": "target", "type": "str"},
+ "details": {"key": "details", "type": "[ErrorDetail]"},
+ "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.code = None
+ self.message = None
+ self.target = None
+ self.details = None
+ self.additional_info = None
+
+
+class ErrorResponse(_serialization.Model):
+ """Common error response for all Azure Resource Manager APIs to return error details for failed
+ operations. (This also follows the OData error response format.).
+
+ :ivar error: The error object.
+ :vartype error: ~azure.mgmt.containerinstance.models.ErrorDetail
+ """
+
+ _attribute_map = {
+ "error": {"key": "error", "type": "ErrorDetail"},
+ }
+
+ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None:
+ """
+ :keyword error: The error object.
+ :paramtype error: ~azure.mgmt.containerinstance.models.ErrorDetail
+ """
+ super().__init__(**kwargs)
+ self.error = error
+
+
+class Event(_serialization.Model):
+ """A container group or container instance event.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar count: The count of the event.
+ :vartype count: int
+ :ivar first_timestamp: The date-time of the earliest logged event.
+ :vartype first_timestamp: ~datetime.datetime
:ivar last_timestamp: The date-time of the latest logged event.
:vartype last_timestamp: ~datetime.datetime
:ivar name: The event name.
@@ -2205,6 +2349,100 @@ def __init__(self, **kwargs: Any) -> None:
self.type = None
+class FileShare(_serialization.Model):
+ """File shares that can be mounted on container groups.
+
+ :ivar name:
+ :vartype name: str
+ :ivar resource_group_name:
+ :vartype resource_group_name: str
+ :ivar storage_account_name:
+ :vartype storage_account_name: str
+ :ivar properties:
+ :vartype properties: ~azure.mgmt.containerinstance.models.FileShareProperties
+ """
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "resource_group_name": {"key": "resourceGroupName", "type": "str"},
+ "storage_account_name": {"key": "storageAccountName", "type": "str"},
+ "properties": {"key": "properties", "type": "FileShareProperties"},
+ }
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ resource_group_name: Optional[str] = None,
+ storage_account_name: Optional[str] = None,
+ properties: Optional["_models.FileShareProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword name:
+ :paramtype name: str
+ :keyword resource_group_name:
+ :paramtype resource_group_name: str
+ :keyword storage_account_name:
+ :paramtype storage_account_name: str
+ :keyword properties:
+ :paramtype properties: ~azure.mgmt.containerinstance.models.FileShareProperties
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.resource_group_name = resource_group_name
+ self.storage_account_name = storage_account_name
+ self.properties = properties
+
+
+class FileShareProperties(_serialization.Model):
+ """FileShareProperties.
+
+ :ivar share_access_type: Specifies how Container Groups can access the Azure file share i.e.
+ all CG will share same Azure file share or going to have exclusive file share. Known values
+ are: "Shared" and "Exclusive".
+ :vartype share_access_type: str or
+ ~azure.mgmt.containerinstance.models.AzureFileShareAccessType
+ :ivar share_access_tier: Access tier for specific share. GpV2 account can choose between
+ TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Learn
+ more at:
+ https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/create?tabs=HTTP#shareaccesstier.
+ Known values are: "Cool", "Hot", "Premium", and "TransactionOptimized".
+ :vartype share_access_tier: str or
+ ~azure.mgmt.containerinstance.models.AzureFileShareAccessTier
+ """
+
+ _attribute_map = {
+ "share_access_type": {"key": "shareAccessType", "type": "str"},
+ "share_access_tier": {"key": "shareAccessTier", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ share_access_type: Optional[Union[str, "_models.AzureFileShareAccessType"]] = None,
+ share_access_tier: Union[str, "_models.AzureFileShareAccessTier"] = "TransactionOptimized",
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword share_access_type: Specifies how Container Groups can access the Azure file share i.e.
+ all CG will share same Azure file share or going to have exclusive file share. Known values
+ are: "Shared" and "Exclusive".
+ :paramtype share_access_type: str or
+ ~azure.mgmt.containerinstance.models.AzureFileShareAccessType
+ :keyword share_access_tier: Access tier for specific share. GpV2 account can choose between
+ TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Learn
+ more at:
+ https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/create?tabs=HTTP#shareaccesstier.
+ Known values are: "Cool", "Hot", "Premium", and "TransactionOptimized".
+ :paramtype share_access_tier: str or
+ ~azure.mgmt.containerinstance.models.AzureFileShareAccessTier
+ """
+ super().__init__(**kwargs)
+ self.share_access_type = share_access_type
+ self.share_access_tier = share_access_tier
+
+
class GitRepoVolume(_serialization.Model):
"""Represents a volume that is populated with the contents of a git repository.
@@ -2309,6 +2547,72 @@ def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, *
self.value = value
+class IdentityAccessControl(_serialization.Model):
+ """The access control for an identity.
+
+ :ivar access: The access level of the identity. Known values are: "All", "System", and "User".
+ :vartype access: str or ~azure.mgmt.containerinstance.models.IdentityAccessLevel
+ :ivar identity: An identity.
+ :vartype identity: str
+ """
+
+ _attribute_map = {
+ "access": {"key": "access", "type": "str"},
+ "identity": {"key": "identity", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ access: Optional[Union[str, "_models.IdentityAccessLevel"]] = None,
+ identity: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword access: The access level of the identity. Known values are: "All", "System", and
+ "User".
+ :paramtype access: str or ~azure.mgmt.containerinstance.models.IdentityAccessLevel
+ :keyword identity: An identity.
+ :paramtype identity: str
+ """
+ super().__init__(**kwargs)
+ self.access = access
+ self.identity = identity
+
+
+class IdentityAcls(_serialization.Model):
+ """The access control levels of the identities.
+
+ :ivar default_access: The default access level. Known values are: "All", "System", and "User".
+ :vartype default_access: str or ~azure.mgmt.containerinstance.models.IdentityAccessLevel
+ :ivar acls: The access control levels for each identity.
+ :vartype acls: list[~azure.mgmt.containerinstance.models.IdentityAccessControl]
+ """
+
+ _attribute_map = {
+ "default_access": {"key": "defaultAccess", "type": "str"},
+ "acls": {"key": "acls", "type": "[IdentityAccessControl]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ default_access: Optional[Union[str, "_models.IdentityAccessLevel"]] = None,
+ acls: Optional[List["_models.IdentityAccessControl"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword default_access: The default access level. Known values are: "All", "System", and
+ "User".
+ :paramtype default_access: str or ~azure.mgmt.containerinstance.models.IdentityAccessLevel
+ :keyword acls: The access control levels for each identity.
+ :paramtype acls: list[~azure.mgmt.containerinstance.models.IdentityAccessControl]
+ """
+ super().__init__(**kwargs)
+ self.default_access = default_access
+ self.acls = acls
+
+
class ImageRegistryCredential(_serialization.Model):
"""Image registry credential.
@@ -2321,6 +2625,8 @@ class ImageRegistryCredential(_serialization.Model):
:vartype username: str
:ivar password: The password for the private registry.
:vartype password: str
+ :ivar password_reference: The reference for the private registry password.
+ :vartype password_reference: str
:ivar identity: The identity for the private registry.
:vartype identity: str
:ivar identity_url: The identity URL for the private registry.
@@ -2335,6 +2641,7 @@ class ImageRegistryCredential(_serialization.Model):
"server": {"key": "server", "type": "str"},
"username": {"key": "username", "type": "str"},
"password": {"key": "password", "type": "str"},
+ "password_reference": {"key": "passwordReference", "type": "str"},
"identity": {"key": "identity", "type": "str"},
"identity_url": {"key": "identityUrl", "type": "str"},
}
@@ -2345,6 +2652,7 @@ def __init__(
server: str,
username: Optional[str] = None,
password: Optional[str] = None,
+ password_reference: Optional[str] = None,
identity: Optional[str] = None,
identity_url: Optional[str] = None,
**kwargs: Any
@@ -2357,6 +2665,8 @@ def __init__(
:paramtype username: str
:keyword password: The password for the private registry.
:paramtype password: str
+ :keyword password_reference: The reference for the private registry password.
+ :paramtype password_reference: str
:keyword identity: The identity for the private registry.
:paramtype identity: str
:keyword identity_url: The identity URL for the private registry.
@@ -2366,6 +2676,7 @@ def __init__(
self.server = server
self.username = username
self.password = password
+ self.password_reference = password_reference
self.identity = identity
self.identity_url = identity_url
@@ -2477,179 +2788,1103 @@ class InitContainerPropertiesDefinitionInstanceView(_serialization.Model): # py
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
- self.restart_count = None
- self.current_state = None
- self.previous_state = None
- self.events = None
+ self.restart_count = None
+ self.current_state = None
+ self.previous_state = None
+ self.events = None
+
+
+class IpAddress(_serialization.Model):
+ """IP address for the container group.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar ports: The list of ports exposed on the container group. Required.
+ :vartype ports: list[~azure.mgmt.containerinstance.models.Port]
+ :ivar type: Specifies if the IP is exposed to the public internet or private VNET. Required.
+ Known values are: "Public" and "Private".
+ :vartype type: str or ~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType
+ :ivar ip: The IP exposed to the public internet.
+ :vartype ip: str
+ :ivar dns_name_label: The Dns name label for the IP.
+ :vartype dns_name_label: str
+ :ivar auto_generated_domain_name_label_scope: The value representing the security enum. The
+ 'Unsecure' value is the default value if not selected and means the object's domain name label
+ is not secured against subdomain takeover. The 'TenantReuse' value is the default value if
+ selected and means the object's domain name label can be reused within the same tenant. The
+ 'SubscriptionReuse' value means the object's domain name label can be reused within the same
+ subscription. The 'ResourceGroupReuse' value means the object's domain name label can be reused
+ within the same resource group. The 'NoReuse' value means the object's domain name label cannot
+ be reused within the same resource group, subscription, or tenant. Known values are:
+ "Unsecure", "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and "Noreuse".
+ :vartype auto_generated_domain_name_label_scope: str or
+ ~azure.mgmt.containerinstance.models.DnsNameLabelReusePolicy
+ :ivar fqdn: The FQDN for the IP.
+ :vartype fqdn: str
+ """
+
+ _validation = {
+ "ports": {"required": True},
+ "type": {"required": True},
+ "fqdn": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "ports": {"key": "ports", "type": "[Port]"},
+ "type": {"key": "type", "type": "str"},
+ "ip": {"key": "ip", "type": "str"},
+ "dns_name_label": {"key": "dnsNameLabel", "type": "str"},
+ "auto_generated_domain_name_label_scope": {"key": "autoGeneratedDomainNameLabelScope", "type": "str"},
+ "fqdn": {"key": "fqdn", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ ports: List["_models.Port"],
+ type: Union[str, "_models.ContainerGroupIpAddressType"],
+ ip: Optional[str] = None,
+ dns_name_label: Optional[str] = None,
+ auto_generated_domain_name_label_scope: Union[str, "_models.DnsNameLabelReusePolicy"] = "Unsecure",
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword ports: The list of ports exposed on the container group. Required.
+ :paramtype ports: list[~azure.mgmt.containerinstance.models.Port]
+ :keyword type: Specifies if the IP is exposed to the public internet or private VNET. Required.
+ Known values are: "Public" and "Private".
+ :paramtype type: str or ~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType
+ :keyword ip: The IP exposed to the public internet.
+ :paramtype ip: str
+ :keyword dns_name_label: The Dns name label for the IP.
+ :paramtype dns_name_label: str
+ :keyword auto_generated_domain_name_label_scope: The value representing the security enum. The
+ 'Unsecure' value is the default value if not selected and means the object's domain name label
+ is not secured against subdomain takeover. The 'TenantReuse' value is the default value if
+ selected and means the object's domain name label can be reused within the same tenant. The
+ 'SubscriptionReuse' value means the object's domain name label can be reused within the same
+ subscription. The 'ResourceGroupReuse' value means the object's domain name label can be reused
+ within the same resource group. The 'NoReuse' value means the object's domain name label cannot
+ be reused within the same resource group, subscription, or tenant. Known values are:
+ "Unsecure", "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and "Noreuse".
+ :paramtype auto_generated_domain_name_label_scope: str or
+ ~azure.mgmt.containerinstance.models.DnsNameLabelReusePolicy
+ """
+ super().__init__(**kwargs)
+ self.ports = ports
+ self.type = type
+ self.ip = ip
+ self.dns_name_label = dns_name_label
+ self.auto_generated_domain_name_label_scope = auto_generated_domain_name_label_scope
+ self.fqdn = None
+
+
+class ListResultContainerGroupProperties(_serialization.Model):
+ """Properties of container group part of list result.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar identity: The identity of the container group, if configured.
+ :vartype identity: ~azure.mgmt.containerinstance.models.ContainerGroupIdentity
+ :ivar provisioning_state: The provisioning state of the container group. This only appears in
+ the response. Known values are: "NotSpecified", "Accepted", "Pending", "Updating", "Creating",
+ "Repairing", "Unhealthy", "Failed", "Canceled", "Succeeded", "Deleting", "NotAccessible", and
+ "PreProvisioned".
+ :vartype provisioning_state: str or
+ ~azure.mgmt.containerinstance.models.ContainerGroupProvisioningState
+ :ivar secret_references: The secret references that will be referenced within the container
+ group.
+ :vartype secret_references: list[~azure.mgmt.containerinstance.models.SecretReference]
+ :ivar containers: The containers within the container group. Required.
+ :vartype containers: list[~azure.mgmt.containerinstance.models.Container]
+ :ivar image_registry_credentials: The image registry credentials by which the container group
+ is created from.
+ :vartype image_registry_credentials:
+ list[~azure.mgmt.containerinstance.models.ImageRegistryCredential]
+ :ivar restart_policy: Restart policy for all containers within the container group.
+
+
+ * ``Always`` Always restart
+ * ``OnFailure`` Restart on failure
+ * ``Never`` Never restart. Known values are: "Always", "OnFailure", and "Never".
+ :vartype restart_policy: str or
+ ~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy
+ :ivar ip_address: The IP address type of the container group.
+ :vartype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
+ :ivar os_type: The operating system type required by the containers in the container group.
+ Required. Known values are: "Windows" and "Linux".
+ :vartype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
+ :ivar volumes: The list of volumes that can be mounted by containers in this container group.
+ :vartype volumes: list[~azure.mgmt.containerinstance.models.Volume]
+ :ivar diagnostics: The diagnostic information for a container group.
+ :vartype diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
+ :ivar subnet_ids: The subnet resource IDs for a container group.
+ :vartype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
+ :ivar dns_config: The DNS config information for a container group.
+ :vartype dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration
+ :ivar sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
+ "Dedicated", and "Confidential".
+ :vartype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
+ :ivar encryption_properties: The encryption properties for a container group.
+ :vartype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
+ :ivar init_containers: The init containers for a container group.
+ :vartype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
+ :ivar extensions: extensions used by virtual kubelet.
+ :vartype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
+ :ivar confidential_compute_properties: The properties for confidential container group.
+ :vartype confidential_compute_properties:
+ ~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
+ :ivar priority: The priority of the container group. Known values are: "Regular" and "Spot".
+ :vartype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
+ :ivar identity_acls: The access control levels of the identities.
+ :vartype identity_acls: ~azure.mgmt.containerinstance.models.IdentityAcls
+ """
+
+ _validation = {
+ "provisioning_state": {"readonly": True},
+ "containers": {"required": True},
+ "os_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "identity": {"key": "identity", "type": "ContainerGroupIdentity"},
+ "provisioning_state": {"key": "properties.provisioningState", "type": "str"},
+ "secret_references": {"key": "properties.secretReferences", "type": "[SecretReference]"},
+ "containers": {"key": "properties.containers", "type": "[Container]"},
+ "image_registry_credentials": {
+ "key": "properties.imageRegistryCredentials",
+ "type": "[ImageRegistryCredential]",
+ },
+ "restart_policy": {"key": "properties.restartPolicy", "type": "str"},
+ "ip_address": {"key": "properties.ipAddress", "type": "IpAddress"},
+ "os_type": {"key": "properties.osType", "type": "str"},
+ "volumes": {"key": "properties.volumes", "type": "[Volume]"},
+ "diagnostics": {"key": "properties.diagnostics", "type": "ContainerGroupDiagnostics"},
+ "subnet_ids": {"key": "properties.subnetIds", "type": "[ContainerGroupSubnetId]"},
+ "dns_config": {"key": "properties.dnsConfig", "type": "DnsConfiguration"},
+ "sku": {"key": "properties.sku", "type": "str"},
+ "encryption_properties": {"key": "properties.encryptionProperties", "type": "EncryptionProperties"},
+ "init_containers": {"key": "properties.initContainers", "type": "[InitContainerDefinition]"},
+ "extensions": {"key": "properties.extensions", "type": "[DeploymentExtensionSpec]"},
+ "confidential_compute_properties": {
+ "key": "properties.confidentialComputeProperties",
+ "type": "ConfidentialComputeProperties",
+ },
+ "priority": {"key": "properties.priority", "type": "str"},
+ "identity_acls": {"key": "properties.identityAcls", "type": "IdentityAcls"},
+ }
+
+ def __init__(
+ self,
+ *,
+ containers: List["_models.Container"],
+ os_type: Union[str, "_models.OperatingSystemTypes"],
+ identity: Optional["_models.ContainerGroupIdentity"] = None,
+ secret_references: Optional[List["_models.SecretReference"]] = None,
+ image_registry_credentials: Optional[List["_models.ImageRegistryCredential"]] = None,
+ restart_policy: Optional[Union[str, "_models.ContainerGroupRestartPolicy"]] = None,
+ ip_address: Optional["_models.IpAddress"] = None,
+ volumes: Optional[List["_models.Volume"]] = None,
+ diagnostics: Optional["_models.ContainerGroupDiagnostics"] = None,
+ subnet_ids: Optional[List["_models.ContainerGroupSubnetId"]] = None,
+ dns_config: Optional["_models.DnsConfiguration"] = None,
+ sku: Optional[Union[str, "_models.ContainerGroupSku"]] = None,
+ encryption_properties: Optional["_models.EncryptionProperties"] = None,
+ init_containers: Optional[List["_models.InitContainerDefinition"]] = None,
+ extensions: Optional[List["_models.DeploymentExtensionSpec"]] = None,
+ confidential_compute_properties: Optional["_models.ConfidentialComputeProperties"] = None,
+ priority: Optional[Union[str, "_models.ContainerGroupPriority"]] = None,
+ identity_acls: Optional["_models.IdentityAcls"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword identity: The identity of the container group, if configured.
+ :paramtype identity: ~azure.mgmt.containerinstance.models.ContainerGroupIdentity
+ :keyword secret_references: The secret references that will be referenced within the container
+ group.
+ :paramtype secret_references: list[~azure.mgmt.containerinstance.models.SecretReference]
+ :keyword containers: The containers within the container group. Required.
+ :paramtype containers: list[~azure.mgmt.containerinstance.models.Container]
+ :keyword image_registry_credentials: The image registry credentials by which the container
+ group is created from.
+ :paramtype image_registry_credentials:
+ list[~azure.mgmt.containerinstance.models.ImageRegistryCredential]
+ :keyword restart_policy: Restart policy for all containers within the container group.
+
+
+ * ``Always`` Always restart
+ * ``OnFailure`` Restart on failure
+ * ``Never`` Never restart. Known values are: "Always", "OnFailure", and "Never".
+ :paramtype restart_policy: str or
+ ~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy
+ :keyword ip_address: The IP address type of the container group.
+ :paramtype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
+ :keyword os_type: The operating system type required by the containers in the container group.
+ Required. Known values are: "Windows" and "Linux".
+ :paramtype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
+ :keyword volumes: The list of volumes that can be mounted by containers in this container
+ group.
+ :paramtype volumes: list[~azure.mgmt.containerinstance.models.Volume]
+ :keyword diagnostics: The diagnostic information for a container group.
+ :paramtype diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
+ :keyword subnet_ids: The subnet resource IDs for a container group.
+ :paramtype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
+ :keyword dns_config: The DNS config information for a container group.
+ :paramtype dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration
+ :keyword sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
+ "Dedicated", and "Confidential".
+ :paramtype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
+ :keyword encryption_properties: The encryption properties for a container group.
+ :paramtype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
+ :keyword init_containers: The init containers for a container group.
+ :paramtype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
+ :keyword extensions: extensions used by virtual kubelet.
+ :paramtype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
+ :keyword confidential_compute_properties: The properties for confidential container group.
+ :paramtype confidential_compute_properties:
+ ~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
+ :keyword priority: The priority of the container group. Known values are: "Regular" and "Spot".
+ :paramtype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
+ :keyword identity_acls: The access control levels of the identities.
+ :paramtype identity_acls: ~azure.mgmt.containerinstance.models.IdentityAcls
+ """
+ super().__init__(**kwargs)
+ self.identity = identity
+ self.provisioning_state = None
+ self.secret_references = secret_references
+ self.containers = containers
+ self.image_registry_credentials = image_registry_credentials
+ self.restart_policy = restart_policy
+ self.ip_address = ip_address
+ self.os_type = os_type
+ self.volumes = volumes
+ self.diagnostics = diagnostics
+ self.subnet_ids = subnet_ids
+ self.dns_config = dns_config
+ self.sku = sku
+ self.encryption_properties = encryption_properties
+ self.init_containers = init_containers
+ self.extensions = extensions
+ self.confidential_compute_properties = confidential_compute_properties
+ self.priority = priority
+ self.identity_acls = identity_acls
+
+
+class ListResultContainerGroup(Resource, ListResultContainerGroupProperties):
+ """A container group part of the list result.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar identity: The identity of the container group, if configured.
+ :vartype identity: ~azure.mgmt.containerinstance.models.ContainerGroupIdentity
+ :ivar provisioning_state: The provisioning state of the container group. This only appears in
+ the response. Known values are: "NotSpecified", "Accepted", "Pending", "Updating", "Creating",
+ "Repairing", "Unhealthy", "Failed", "Canceled", "Succeeded", "Deleting", "NotAccessible", and
+ "PreProvisioned".
+ :vartype provisioning_state: str or
+ ~azure.mgmt.containerinstance.models.ContainerGroupProvisioningState
+ :ivar secret_references: The secret references that will be referenced within the container
+ group.
+ :vartype secret_references: list[~azure.mgmt.containerinstance.models.SecretReference]
+ :ivar containers: The containers within the container group. Required.
+ :vartype containers: list[~azure.mgmt.containerinstance.models.Container]
+ :ivar image_registry_credentials: The image registry credentials by which the container group
+ is created from.
+ :vartype image_registry_credentials:
+ list[~azure.mgmt.containerinstance.models.ImageRegistryCredential]
+ :ivar restart_policy: Restart policy for all containers within the container group.
+
+
+ * ``Always`` Always restart
+ * ``OnFailure`` Restart on failure
+ * ``Never`` Never restart. Known values are: "Always", "OnFailure", and "Never".
+ :vartype restart_policy: str or
+ ~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy
+ :ivar ip_address: The IP address type of the container group.
+ :vartype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
+ :ivar os_type: The operating system type required by the containers in the container group.
+ Required. Known values are: "Windows" and "Linux".
+ :vartype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
+ :ivar volumes: The list of volumes that can be mounted by containers in this container group.
+ :vartype volumes: list[~azure.mgmt.containerinstance.models.Volume]
+ :ivar diagnostics: The diagnostic information for a container group.
+ :vartype diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
+ :ivar subnet_ids: The subnet resource IDs for a container group.
+ :vartype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
+ :ivar dns_config: The DNS config information for a container group.
+ :vartype dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration
+ :ivar sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
+ "Dedicated", and "Confidential".
+ :vartype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
+ :ivar encryption_properties: The encryption properties for a container group.
+ :vartype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
+ :ivar init_containers: The init containers for a container group.
+ :vartype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
+ :ivar extensions: extensions used by virtual kubelet.
+ :vartype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
+ :ivar confidential_compute_properties: The properties for confidential container group.
+ :vartype confidential_compute_properties:
+ ~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
+ :ivar priority: The priority of the container group. Known values are: "Regular" and "Spot".
+ :vartype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
+ :ivar identity_acls: The access control levels of the identities.
+ :vartype identity_acls: ~azure.mgmt.containerinstance.models.IdentityAcls
+ :ivar id: The resource id.
+ :vartype id: str
+ :ivar name: The resource name.
+ :vartype name: str
+ :ivar type: The resource type.
+ :vartype type: str
+ :ivar location: The resource location.
+ :vartype location: str
+ :ivar tags: The resource tags.
+ :vartype tags: dict[str, str]
+ :ivar zones: The zones for the container group.
+ :vartype zones: list[str]
+ """
+
+ _validation = {
+ "provisioning_state": {"readonly": True},
+ "containers": {"required": True},
+ "os_type": {"required": True},
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "identity": {"key": "identity", "type": "ContainerGroupIdentity"},
+ "provisioning_state": {"key": "properties.provisioningState", "type": "str"},
+ "secret_references": {"key": "properties.secretReferences", "type": "[SecretReference]"},
+ "containers": {"key": "properties.containers", "type": "[Container]"},
+ "image_registry_credentials": {
+ "key": "properties.imageRegistryCredentials",
+ "type": "[ImageRegistryCredential]",
+ },
+ "restart_policy": {"key": "properties.restartPolicy", "type": "str"},
+ "ip_address": {"key": "properties.ipAddress", "type": "IpAddress"},
+ "os_type": {"key": "properties.osType", "type": "str"},
+ "volumes": {"key": "properties.volumes", "type": "[Volume]"},
+ "diagnostics": {"key": "properties.diagnostics", "type": "ContainerGroupDiagnostics"},
+ "subnet_ids": {"key": "properties.subnetIds", "type": "[ContainerGroupSubnetId]"},
+ "dns_config": {"key": "properties.dnsConfig", "type": "DnsConfiguration"},
+ "sku": {"key": "properties.sku", "type": "str"},
+ "encryption_properties": {"key": "properties.encryptionProperties", "type": "EncryptionProperties"},
+ "init_containers": {"key": "properties.initContainers", "type": "[InitContainerDefinition]"},
+ "extensions": {"key": "properties.extensions", "type": "[DeploymentExtensionSpec]"},
+ "confidential_compute_properties": {
+ "key": "properties.confidentialComputeProperties",
+ "type": "ConfidentialComputeProperties",
+ },
+ "priority": {"key": "properties.priority", "type": "str"},
+ "identity_acls": {"key": "properties.identityAcls", "type": "IdentityAcls"},
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "location": {"key": "location", "type": "str"},
+ "tags": {"key": "tags", "type": "{str}"},
+ "zones": {"key": "zones", "type": "[str]"},
+ }
+
+ def __init__( # pylint: disable=too-many-locals
+ self,
+ *,
+ containers: List["_models.Container"],
+ os_type: Union[str, "_models.OperatingSystemTypes"],
+ identity: Optional["_models.ContainerGroupIdentity"] = None,
+ secret_references: Optional[List["_models.SecretReference"]] = None,
+ image_registry_credentials: Optional[List["_models.ImageRegistryCredential"]] = None,
+ restart_policy: Optional[Union[str, "_models.ContainerGroupRestartPolicy"]] = None,
+ ip_address: Optional["_models.IpAddress"] = None,
+ volumes: Optional[List["_models.Volume"]] = None,
+ diagnostics: Optional["_models.ContainerGroupDiagnostics"] = None,
+ subnet_ids: Optional[List["_models.ContainerGroupSubnetId"]] = None,
+ dns_config: Optional["_models.DnsConfiguration"] = None,
+ sku: Optional[Union[str, "_models.ContainerGroupSku"]] = None,
+ encryption_properties: Optional["_models.EncryptionProperties"] = None,
+ init_containers: Optional[List["_models.InitContainerDefinition"]] = None,
+ extensions: Optional[List["_models.DeploymentExtensionSpec"]] = None,
+ confidential_compute_properties: Optional["_models.ConfidentialComputeProperties"] = None,
+ priority: Optional[Union[str, "_models.ContainerGroupPriority"]] = None,
+ identity_acls: Optional["_models.IdentityAcls"] = None,
+ location: Optional[str] = None,
+ tags: Optional[Dict[str, str]] = None,
+ zones: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword identity: The identity of the container group, if configured.
+ :paramtype identity: ~azure.mgmt.containerinstance.models.ContainerGroupIdentity
+ :keyword secret_references: The secret references that will be referenced within the container
+ group.
+ :paramtype secret_references: list[~azure.mgmt.containerinstance.models.SecretReference]
+ :keyword containers: The containers within the container group. Required.
+ :paramtype containers: list[~azure.mgmt.containerinstance.models.Container]
+ :keyword image_registry_credentials: The image registry credentials by which the container
+ group is created from.
+ :paramtype image_registry_credentials:
+ list[~azure.mgmt.containerinstance.models.ImageRegistryCredential]
+ :keyword restart_policy: Restart policy for all containers within the container group.
+
+
+ * ``Always`` Always restart
+ * ``OnFailure`` Restart on failure
+ * ``Never`` Never restart. Known values are: "Always", "OnFailure", and "Never".
+ :paramtype restart_policy: str or
+ ~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy
+ :keyword ip_address: The IP address type of the container group.
+ :paramtype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
+ :keyword os_type: The operating system type required by the containers in the container group.
+ Required. Known values are: "Windows" and "Linux".
+ :paramtype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
+ :keyword volumes: The list of volumes that can be mounted by containers in this container
+ group.
+ :paramtype volumes: list[~azure.mgmt.containerinstance.models.Volume]
+ :keyword diagnostics: The diagnostic information for a container group.
+ :paramtype diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
+ :keyword subnet_ids: The subnet resource IDs for a container group.
+ :paramtype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
+ :keyword dns_config: The DNS config information for a container group.
+ :paramtype dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration
+ :keyword sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
+ "Dedicated", and "Confidential".
+ :paramtype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
+ :keyword encryption_properties: The encryption properties for a container group.
+ :paramtype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
+ :keyword init_containers: The init containers for a container group.
+ :paramtype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
+ :keyword extensions: extensions used by virtual kubelet.
+ :paramtype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
+ :keyword confidential_compute_properties: The properties for confidential container group.
+ :paramtype confidential_compute_properties:
+ ~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
+ :keyword priority: The priority of the container group. Known values are: "Regular" and "Spot".
+ :paramtype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
+ :keyword identity_acls: The access control levels of the identities.
+ :paramtype identity_acls: ~azure.mgmt.containerinstance.models.IdentityAcls
+ :keyword location: The resource location.
+ :paramtype location: str
+ :keyword tags: The resource tags.
+ :paramtype tags: dict[str, str]
+ :keyword zones: The zones for the container group.
+ :paramtype zones: list[str]
+ """
+ super().__init__(
+ location=location,
+ tags=tags,
+ zones=zones,
+ identity=identity,
+ secret_references=secret_references,
+ containers=containers,
+ image_registry_credentials=image_registry_credentials,
+ restart_policy=restart_policy,
+ ip_address=ip_address,
+ os_type=os_type,
+ volumes=volumes,
+ diagnostics=diagnostics,
+ subnet_ids=subnet_ids,
+ dns_config=dns_config,
+ sku=sku,
+ encryption_properties=encryption_properties,
+ init_containers=init_containers,
+ extensions=extensions,
+ confidential_compute_properties=confidential_compute_properties,
+ priority=priority,
+ identity_acls=identity_acls,
+ **kwargs
+ )
+ self.identity = identity
+ self.provisioning_state = None
+ self.secret_references = secret_references
+ self.containers = containers
+ self.image_registry_credentials = image_registry_credentials
+ self.restart_policy = restart_policy
+ self.ip_address = ip_address
+ self.os_type = os_type
+ self.volumes = volumes
+ self.diagnostics = diagnostics
+ self.subnet_ids = subnet_ids
+ self.dns_config = dns_config
+ self.sku = sku
+ self.encryption_properties = encryption_properties
+ self.init_containers = init_containers
+ self.extensions = extensions
+ self.confidential_compute_properties = confidential_compute_properties
+ self.priority = priority
+ self.identity_acls = identity_acls
+ self.id = None
+ self.name = None
+ self.type = None
+ self.location = location
+ self.tags = tags
+ self.zones = zones
+
+
+class LoadBalancer(_serialization.Model):
+ """LoadBalancer the CG profile will use to interact with CGs in a backend pool.
+
+ :ivar backend_address_pools: List of Load Balancer Backend Address Pools.
+ :vartype backend_address_pools:
+ list[~azure.mgmt.containerinstance.models.LoadBalancerBackendAddressPool]
+ """
+
+ _attribute_map = {
+ "backend_address_pools": {"key": "backendAddressPools", "type": "[LoadBalancerBackendAddressPool]"},
+ }
+
+ def __init__(
+ self, *, backend_address_pools: Optional[List["_models.LoadBalancerBackendAddressPool"]] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword backend_address_pools: List of Load Balancer Backend Address Pools.
+ :paramtype backend_address_pools:
+ list[~azure.mgmt.containerinstance.models.LoadBalancerBackendAddressPool]
+ """
+ super().__init__(**kwargs)
+ self.backend_address_pools = backend_address_pools
+
+
+class LoadBalancerBackendAddressPool(_serialization.Model):
+ """NGroups load balancer backend address pool.
+
+ :ivar resource: The Load Balancer backend address pool ARM resource Id.
+ :vartype resource: str
+ """
+
+ _attribute_map = {
+ "resource": {"key": "resource", "type": "str"},
+ }
+
+ def __init__(self, *, resource: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword resource: The Load Balancer backend address pool ARM resource Id.
+ :paramtype resource: str
+ """
+ super().__init__(**kwargs)
+ self.resource = resource
+
+
+class LogAnalytics(_serialization.Model):
+ """Container group log analytics information.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar workspace_id: The workspace id for log analytics. Required.
+ :vartype workspace_id: str
+ :ivar workspace_key: The workspace key for log analytics. Required.
+ :vartype workspace_key: str
+ :ivar log_type: The log type to be used. Known values are: "ContainerInsights" and
+ "ContainerInstanceLogs".
+ :vartype log_type: str or ~azure.mgmt.containerinstance.models.LogAnalyticsLogType
+ :ivar metadata: Metadata for log analytics.
+ :vartype metadata: dict[str, str]
+ :ivar workspace_resource_id: The workspace resource id for log analytics.
+ :vartype workspace_resource_id: str
+ """
+
+ _validation = {
+ "workspace_id": {"required": True},
+ "workspace_key": {"required": True},
+ }
+
+ _attribute_map = {
+ "workspace_id": {"key": "workspaceId", "type": "str"},
+ "workspace_key": {"key": "workspaceKey", "type": "str"},
+ "log_type": {"key": "logType", "type": "str"},
+ "metadata": {"key": "metadata", "type": "{str}"},
+ "workspace_resource_id": {"key": "workspaceResourceId", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ workspace_id: str,
+ workspace_key: str,
+ log_type: Optional[Union[str, "_models.LogAnalyticsLogType"]] = None,
+ metadata: Optional[Dict[str, str]] = None,
+ workspace_resource_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword workspace_id: The workspace id for log analytics. Required.
+ :paramtype workspace_id: str
+ :keyword workspace_key: The workspace key for log analytics. Required.
+ :paramtype workspace_key: str
+ :keyword log_type: The log type to be used. Known values are: "ContainerInsights" and
+ "ContainerInstanceLogs".
+ :paramtype log_type: str or ~azure.mgmt.containerinstance.models.LogAnalyticsLogType
+ :keyword metadata: Metadata for log analytics.
+ :paramtype metadata: dict[str, str]
+ :keyword workspace_resource_id: The workspace resource id for log analytics.
+ :paramtype workspace_resource_id: str
+ """
+ super().__init__(**kwargs)
+ self.workspace_id = workspace_id
+ self.workspace_key = workspace_key
+ self.log_type = log_type
+ self.metadata = metadata
+ self.workspace_resource_id = workspace_resource_id
+
+
+class Logs(_serialization.Model):
+ """The logs.
+
+ :ivar content: The content of the log.
+ :vartype content: str
+ """
+
+ _attribute_map = {
+ "content": {"key": "content", "type": "str"},
+ }
+
+ def __init__(self, *, content: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword content: The content of the log.
+ :paramtype content: str
+ """
+ super().__init__(**kwargs)
+ self.content = content
+
+
+class NetworkProfile(_serialization.Model):
+ """A network profile for network settings of a ContainerGroupProfile. Used to manage load balancer
+ and application gateway backend pools, specifically updating the IP addresses of CGs within the
+ backend pool.
+
+ :ivar load_balancer: LoadBalancer the CG profile will use to interact with CGs in a backend
+ pool.
+ :vartype load_balancer: ~azure.mgmt.containerinstance.models.LoadBalancer
+ :ivar application_gateway: Application Gateway the CG profile will use to interact with CGs in
+ a backend pool.
+ :vartype application_gateway: ~azure.mgmt.containerinstance.models.ApplicationGateway
+ """
+
+ _attribute_map = {
+ "load_balancer": {"key": "loadBalancer", "type": "LoadBalancer"},
+ "application_gateway": {"key": "applicationGateway", "type": "ApplicationGateway"},
+ }
+
+ def __init__(
+ self,
+ *,
+ load_balancer: Optional["_models.LoadBalancer"] = None,
+ application_gateway: Optional["_models.ApplicationGateway"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword load_balancer: LoadBalancer the CG profile will use to interact with CGs in a backend
+ pool.
+ :paramtype load_balancer: ~azure.mgmt.containerinstance.models.LoadBalancer
+ :keyword application_gateway: Application Gateway the CG profile will use to interact with CGs
+ in a backend pool.
+ :paramtype application_gateway: ~azure.mgmt.containerinstance.models.ApplicationGateway
+ """
+ super().__init__(**kwargs)
+ self.load_balancer = load_balancer
+ self.application_gateway = application_gateway
+
+
+class NGroup(Resource):
+ """Describes the NGroups resource.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: The resource id.
+ :vartype id: str
+ :ivar name: The resource name.
+ :vartype name: str
+ :ivar type: The resource type.
+ :vartype type: str
+ :ivar tags: The resource tags.
+ :vartype tags: dict[str, str]
+ :ivar system_data: Metadata pertaining to creation and last modification of the resource.
+ :vartype system_data: ~azure.mgmt.containerinstance.models.SystemData
+ :ivar identity: The identity of the NGroup, if configured.
+ :vartype identity: ~azure.mgmt.containerinstance.models.NGroupIdentity
+ :ivar zones: The NGroups zones. NOTE: Availability zones can only be set when you create the
+ scale set.
+ :vartype zones: list[str]
+ :ivar location: The geo-location where the resource lives.
+ :vartype location: str
+ :ivar elastic_profile: The elastic profile.
+ :vartype elastic_profile: ~azure.mgmt.containerinstance.models.ElasticProfile
+ :ivar placement_profile: Provides options w.r.t allocation and management w.r.t certain
+ placement policies. These utilize capabilities provided by the underlying Azure infrastructure.
+ They are typically used for high availability scenarios. E.g., distributing CGs across fault
+ domains.
+ :vartype placement_profile: ~azure.mgmt.containerinstance.models.PlacementProfile
+ :ivar container_group_profiles: The Container Group Profiles that could be used in the NGroups
+ resource.
+ :vartype container_group_profiles:
+ list[~azure.mgmt.containerinstance.models.ContainerGroupProfileStub]
+ :ivar provisioning_state: The provisioning state, which only appears in the response. Known
+ values are: "Creating", "Updating", "Failed", "Succeeded", "Canceled", "Deleting", and
+ "Migrating".
+ :vartype provisioning_state: str or
+ ~azure.mgmt.containerinstance.models.NGroupProvisioningState
+ :ivar update_profile: Used by the customer to specify the way to update the Container Groups in
+ NGroup.
+ :vartype update_profile: ~azure.mgmt.containerinstance.models.UpdateProfile
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "provisioning_state": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "tags": {"key": "tags", "type": "{str}"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "identity": {"key": "identity", "type": "NGroupIdentity"},
+ "zones": {"key": "zones", "type": "[str]"},
+ "location": {"key": "location", "type": "str"},
+ "elastic_profile": {"key": "properties.elasticProfile", "type": "ElasticProfile"},
+ "placement_profile": {"key": "properties.placementProfile", "type": "PlacementProfile"},
+ "container_group_profiles": {"key": "properties.containerGroupProfiles", "type": "[ContainerGroupProfileStub]"},
+ "provisioning_state": {"key": "properties.provisioningState", "type": "str"},
+ "update_profile": {"key": "properties.updateProfile", "type": "UpdateProfile"},
+ }
+
+ def __init__(
+ self,
+ *,
+ tags: Optional[Dict[str, str]] = None,
+ identity: Optional["_models.NGroupIdentity"] = None,
+ zones: Optional[List[str]] = None,
+ location: Optional[str] = None,
+ elastic_profile: Optional["_models.ElasticProfile"] = None,
+ placement_profile: Optional["_models.PlacementProfile"] = None,
+ container_group_profiles: Optional[List["_models.ContainerGroupProfileStub"]] = None,
+ update_profile: Optional["_models.UpdateProfile"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword tags: The resource tags.
+ :paramtype tags: dict[str, str]
+ :keyword identity: The identity of the NGroup, if configured.
+ :paramtype identity: ~azure.mgmt.containerinstance.models.NGroupIdentity
+ :keyword zones: The NGroups zones. NOTE: Availability zones can only be set when you create the
+ scale set.
+ :paramtype zones: list[str]
+ :keyword location: The geo-location where the resource lives.
+ :paramtype location: str
+ :keyword elastic_profile: The elastic profile.
+ :paramtype elastic_profile: ~azure.mgmt.containerinstance.models.ElasticProfile
+ :keyword placement_profile: Provides options w.r.t allocation and management w.r.t certain
+ placement policies. These utilize capabilities provided by the underlying Azure infrastructure.
+ They are typically used for high availability scenarios. E.g., distributing CGs across fault
+ domains.
+ :paramtype placement_profile: ~azure.mgmt.containerinstance.models.PlacementProfile
+ :keyword container_group_profiles: The Container Group Profiles that could be used in the
+ NGroups resource.
+ :paramtype container_group_profiles:
+ list[~azure.mgmt.containerinstance.models.ContainerGroupProfileStub]
+ :keyword update_profile: Used by the customer to specify the way to update the Container Groups
+ in NGroup.
+ :paramtype update_profile: ~azure.mgmt.containerinstance.models.UpdateProfile
+ """
+ super().__init__(tags=tags, **kwargs)
+ self.system_data = None
+ self.identity = identity
+ self.zones = zones
+ self.location = location
+ self.elastic_profile = elastic_profile
+ self.placement_profile = placement_profile
+ self.container_group_profiles = container_group_profiles
+ self.provisioning_state = None
+ self.update_profile = update_profile
+
+
+class NGroupCGPropertyContainer(_serialization.Model):
+ """Container properties that can be provided with NGroups object.
+
+ :ivar name: container name.
+ :vartype name: str
+ :ivar properties: container properties.
+ :vartype properties: ~azure.mgmt.containerinstance.models.NGroupCGPropertyContainerProperties
+ """
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "properties": {"key": "properties", "type": "NGroupCGPropertyContainerProperties"},
+ }
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ properties: Optional["_models.NGroupCGPropertyContainerProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword name: container name.
+ :paramtype name: str
+ :keyword properties: container properties.
+ :paramtype properties: ~azure.mgmt.containerinstance.models.NGroupCGPropertyContainerProperties
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.properties = properties
+
+
+class NGroupCGPropertyContainerProperties(_serialization.Model):
+ """container properties.
+
+ :ivar volume_mounts:
+ :vartype volume_mounts: list[~azure.mgmt.containerinstance.models.VolumeMount]
+ """
+
+ _attribute_map = {
+ "volume_mounts": {"key": "volumeMounts", "type": "[VolumeMount]"},
+ }
+
+ def __init__(self, *, volume_mounts: Optional[List["_models.VolumeMount"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword volume_mounts:
+ :paramtype volume_mounts: list[~azure.mgmt.containerinstance.models.VolumeMount]
+ """
+ super().__init__(**kwargs)
+ self.volume_mounts = volume_mounts
+
+
+class NGroupCGPropertyVolume(_serialization.Model):
+ """Contains information about the volumes that can be mounted by Containers in the Container
+ Groups.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar name: The name of the volume. Required.
+ :vartype name: str
+ :ivar azure_file: The Azure File volume.
+ :vartype azure_file: ~azure.mgmt.containerinstance.models.AzureFileVolume
+ """
+
+ _validation = {
+ "name": {"required": True},
+ }
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "azure_file": {"key": "azureFile", "type": "AzureFileVolume"},
+ }
+
+ def __init__(self, *, name: str, azure_file: Optional["_models.AzureFileVolume"] = None, **kwargs: Any) -> None:
+ """
+ :keyword name: The name of the volume. Required.
+ :paramtype name: str
+ :keyword azure_file: The Azure File volume.
+ :paramtype azure_file: ~azure.mgmt.containerinstance.models.AzureFileVolume
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.azure_file = azure_file
+
+
+class NGroupContainerGroupProperties(_serialization.Model):
+ """Container Group properties which can be set while creating or updating the NGroups.
+
+ :ivar subnet_ids: Contains information about Virtual Network Subnet ARM Resource.
+ :vartype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
+ :ivar volumes: Contains information about the volumes that can be mounted by Containers in the
+ Container Groups.
+ :vartype volumes: list[~azure.mgmt.containerinstance.models.NGroupCGPropertyVolume]
+ :ivar containers: Contains information about Container which can be set while creating or
+ updating the NGroups.
+ :vartype containers: list[~azure.mgmt.containerinstance.models.NGroupCGPropertyContainer]
+ """
+
+ _attribute_map = {
+ "subnet_ids": {"key": "subnetIds", "type": "[ContainerGroupSubnetId]"},
+ "volumes": {"key": "volumes", "type": "[NGroupCGPropertyVolume]"},
+ "containers": {"key": "containers", "type": "[NGroupCGPropertyContainer]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ subnet_ids: Optional[List["_models.ContainerGroupSubnetId"]] = None,
+ volumes: Optional[List["_models.NGroupCGPropertyVolume"]] = None,
+ containers: Optional[List["_models.NGroupCGPropertyContainer"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword subnet_ids: Contains information about Virtual Network Subnet ARM Resource.
+ :paramtype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
+ :keyword volumes: Contains information about the volumes that can be mounted by Containers in
+ the Container Groups.
+ :paramtype volumes: list[~azure.mgmt.containerinstance.models.NGroupCGPropertyVolume]
+ :keyword containers: Contains information about Container which can be set while creating or
+ updating the NGroups.
+ :paramtype containers: list[~azure.mgmt.containerinstance.models.NGroupCGPropertyContainer]
+ """
+ super().__init__(**kwargs)
+ self.subnet_ids = subnet_ids
+ self.volumes = volumes
+ self.containers = containers
-class IpAddress(_serialization.Model):
- """IP address for the container group.
+class NGroupIdentity(_serialization.Model):
+ """Identity for the NGroup.
Variables are only populated by the server, and will be ignored when sending a request.
- All required parameters must be populated in order to send to server.
-
- :ivar ports: The list of ports exposed on the container group. Required.
- :vartype ports: list[~azure.mgmt.containerinstance.models.Port]
- :ivar type: Specifies if the IP is exposed to the public internet or private VNET. Required.
- Known values are: "Public" and "Private".
- :vartype type: str or ~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType
- :ivar ip: The IP exposed to the public internet.
- :vartype ip: str
- :ivar dns_name_label: The Dns name label for the IP.
- :vartype dns_name_label: str
- :ivar auto_generated_domain_name_label_scope: The value representing the security enum. The
- 'Unsecure' value is the default value if not selected and means the object's domain name label
- is not secured against subdomain takeover. The 'TenantReuse' value is the default value if
- selected and means the object's domain name label can be reused within the same tenant. The
- 'SubscriptionReuse' value means the object's domain name label can be reused within the same
- subscription. The 'ResourceGroupReuse' value means the object's domain name label can be reused
- within the same resource group. The 'NoReuse' value means the object's domain name label cannot
- be reused within the same resource group, subscription, or tenant. Known values are:
- "Unsecure", "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and "Noreuse".
- :vartype auto_generated_domain_name_label_scope: str or
- ~azure.mgmt.containerinstance.models.DnsNameLabelReusePolicy
- :ivar fqdn: The FQDN for the IP.
- :vartype fqdn: str
+ :ivar principal_id: The principal id of the NGroup identity. This property will only be
+ provided for a system assigned identity.
+ :vartype principal_id: str
+ :ivar tenant_id: The tenant id associated with the NGroup. This property will only be provided
+ for a system assigned identity.
+ :vartype tenant_id: str
+ :ivar type: The type of identity used for the NGroup. The type 'SystemAssigned, UserAssigned'
+ includes both an implicitly created identity and a set of user assigned identities. The type
+ 'None' will remove any identities from the NGroup. Known values are: "SystemAssigned",
+ "UserAssigned", "SystemAssigned, UserAssigned", and "None".
+ :vartype type: str or ~azure.mgmt.containerinstance.models.ResourceIdentityType
+ :ivar user_assigned_identities: The list of user identities associated with the NGroup.
+ :vartype user_assigned_identities: dict[str,
+ ~azure.mgmt.containerinstance.models.UserAssignedIdentities]
"""
_validation = {
- "ports": {"required": True},
- "type": {"required": True},
- "fqdn": {"readonly": True},
+ "principal_id": {"readonly": True},
+ "tenant_id": {"readonly": True},
}
_attribute_map = {
- "ports": {"key": "ports", "type": "[Port]"},
+ "principal_id": {"key": "principalId", "type": "str"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
"type": {"key": "type", "type": "str"},
- "ip": {"key": "ip", "type": "str"},
- "dns_name_label": {"key": "dnsNameLabel", "type": "str"},
- "auto_generated_domain_name_label_scope": {"key": "autoGeneratedDomainNameLabelScope", "type": "str"},
- "fqdn": {"key": "fqdn", "type": "str"},
+ "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentities}"},
}
def __init__(
self,
*,
- ports: List["_models.Port"],
- type: Union[str, "_models.ContainerGroupIpAddressType"],
- ip: Optional[str] = None,
- dns_name_label: Optional[str] = None,
- auto_generated_domain_name_label_scope: Union[str, "_models.DnsNameLabelReusePolicy"] = "Unsecure",
+ type: Optional[Union[str, "_models.ResourceIdentityType"]] = None,
+ user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentities"]] = None,
**kwargs: Any
) -> None:
"""
- :keyword ports: The list of ports exposed on the container group. Required.
- :paramtype ports: list[~azure.mgmt.containerinstance.models.Port]
- :keyword type: Specifies if the IP is exposed to the public internet or private VNET. Required.
- Known values are: "Public" and "Private".
- :paramtype type: str or ~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType
- :keyword ip: The IP exposed to the public internet.
- :paramtype ip: str
- :keyword dns_name_label: The Dns name label for the IP.
- :paramtype dns_name_label: str
- :keyword auto_generated_domain_name_label_scope: The value representing the security enum. The
- 'Unsecure' value is the default value if not selected and means the object's domain name label
- is not secured against subdomain takeover. The 'TenantReuse' value is the default value if
- selected and means the object's domain name label can be reused within the same tenant. The
- 'SubscriptionReuse' value means the object's domain name label can be reused within the same
- subscription. The 'ResourceGroupReuse' value means the object's domain name label can be reused
- within the same resource group. The 'NoReuse' value means the object's domain name label cannot
- be reused within the same resource group, subscription, or tenant. Known values are:
- "Unsecure", "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and "Noreuse".
- :paramtype auto_generated_domain_name_label_scope: str or
- ~azure.mgmt.containerinstance.models.DnsNameLabelReusePolicy
+ :keyword type: The type of identity used for the NGroup. The type 'SystemAssigned,
+ UserAssigned' includes both an implicitly created identity and a set of user assigned
+ identities. The type 'None' will remove any identities from the NGroup. Known values are:
+ "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", and "None".
+ :paramtype type: str or ~azure.mgmt.containerinstance.models.ResourceIdentityType
+ :keyword user_assigned_identities: The list of user identities associated with the NGroup.
+ :paramtype user_assigned_identities: dict[str,
+ ~azure.mgmt.containerinstance.models.UserAssignedIdentities]
"""
super().__init__(**kwargs)
- self.ports = ports
+ self.principal_id = None
+ self.tenant_id = None
self.type = type
- self.ip = ip
- self.dns_name_label = dns_name_label
- self.auto_generated_domain_name_label_scope = auto_generated_domain_name_label_scope
- self.fqdn = None
-
+ self.user_assigned_identities = user_assigned_identities
-class LogAnalytics(_serialization.Model):
- """Container group log analytics information.
- All required parameters must be populated in order to send to server.
+class NGroupSkus(_serialization.Model):
+ """The container probe, for liveness or readiness.
- :ivar workspace_id: The workspace id for log analytics. Required.
- :vartype workspace_id: str
- :ivar workspace_key: The workspace key for log analytics. Required.
- :vartype workspace_key: str
- :ivar log_type: The log type to be used. Known values are: "ContainerInsights" and
- "ContainerInstanceLogs".
- :vartype log_type: str or ~azure.mgmt.containerinstance.models.LogAnalyticsLogType
- :ivar metadata: Metadata for log analytics.
- :vartype metadata: dict[str, str]
- :ivar workspace_resource_id: The workspace resource id for log analytics.
- :vartype workspace_resource_id: str
+ :ivar resource_type: The type of resource the sku is applied to.
+ :vartype resource_type: str
+ :ivar sku: The sku of the resource type.
+ :vartype sku: str
+ :ivar sku_capacity: The number of container groups of the NGroups.
+ :vartype sku_capacity: str
"""
- _validation = {
- "workspace_id": {"required": True},
- "workspace_key": {"required": True},
- }
-
_attribute_map = {
- "workspace_id": {"key": "workspaceId", "type": "str"},
- "workspace_key": {"key": "workspaceKey", "type": "str"},
- "log_type": {"key": "logType", "type": "str"},
- "metadata": {"key": "metadata", "type": "{str}"},
- "workspace_resource_id": {"key": "workspaceResourceId", "type": "str"},
+ "resource_type": {"key": "resourceType", "type": "str"},
+ "sku": {"key": "sku", "type": "str"},
+ "sku_capacity": {"key": "skuCapacity", "type": "str"},
}
def __init__(
self,
*,
- workspace_id: str,
- workspace_key: str,
- log_type: Optional[Union[str, "_models.LogAnalyticsLogType"]] = None,
- metadata: Optional[Dict[str, str]] = None,
- workspace_resource_id: Optional[str] = None,
+ resource_type: Optional[str] = None,
+ sku: Optional[str] = None,
+ sku_capacity: Optional[str] = None,
**kwargs: Any
) -> None:
"""
- :keyword workspace_id: The workspace id for log analytics. Required.
- :paramtype workspace_id: str
- :keyword workspace_key: The workspace key for log analytics. Required.
- :paramtype workspace_key: str
- :keyword log_type: The log type to be used. Known values are: "ContainerInsights" and
- "ContainerInstanceLogs".
- :paramtype log_type: str or ~azure.mgmt.containerinstance.models.LogAnalyticsLogType
- :keyword metadata: Metadata for log analytics.
- :paramtype metadata: dict[str, str]
- :keyword workspace_resource_id: The workspace resource id for log analytics.
- :paramtype workspace_resource_id: str
+ :keyword resource_type: The type of resource the sku is applied to.
+ :paramtype resource_type: str
+ :keyword sku: The sku of the resource type.
+ :paramtype sku: str
+ :keyword sku_capacity: The number of container groups of the NGroups.
+ :paramtype sku_capacity: str
"""
super().__init__(**kwargs)
- self.workspace_id = workspace_id
- self.workspace_key = workspace_key
- self.log_type = log_type
- self.metadata = metadata
- self.workspace_resource_id = workspace_resource_id
+ self.resource_type = resource_type
+ self.sku = sku
+ self.sku_capacity = sku_capacity
-class Logs(_serialization.Model):
- """The logs.
+class NGroupsListResult(_serialization.Model):
+ """The NGroups list response that contains the NGroups properties.
- :ivar content: The content of the log.
- :vartype content: str
+ :ivar value: The list of NGroups.
+ :vartype value: list[~azure.mgmt.containerinstance.models.NGroup]
+ :ivar next_link: The URI to fetch the next page of NGroups.
+ :vartype next_link: str
"""
_attribute_map = {
- "content": {"key": "content", "type": "str"},
+ "value": {"key": "value", "type": "[NGroup]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
- def __init__(self, *, content: Optional[str] = None, **kwargs: Any) -> None:
+ def __init__(
+ self, *, value: Optional[List["_models.NGroup"]] = None, next_link: Optional[str] = None, **kwargs: Any
+ ) -> None:
"""
- :keyword content: The content of the log.
- :paramtype content: str
+ :keyword value: The list of NGroups.
+ :paramtype value: list[~azure.mgmt.containerinstance.models.NGroup]
+ :keyword next_link: The URI to fetch the next page of NGroups.
+ :paramtype next_link: str
"""
super().__init__(**kwargs)
- self.content = content
+ self.value = value
+ self.next_link = next_link
+
+
+class NGroupsSkusList(_serialization.Model):
+ """List of SKU definitions. NGroups offer a single sku.
+
+ :ivar value: The list of NGroups SKUs.
+ :vartype value: list[~azure.mgmt.containerinstance.models.NGroupSkus]
+ :ivar next_link: The URI to fetch the next page of NGroups SKUs.
+ :vartype next_link: str
+ """
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[NGroupSkus]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(
+ self, *, value: Optional[List["_models.NGroupSkus"]] = None, next_link: Optional[str] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: The list of NGroups SKUs.
+ :paramtype value: list[~azure.mgmt.containerinstance.models.NGroupSkus]
+ :keyword next_link: The URI to fetch the next page of NGroups SKUs.
+ :paramtype next_link: str
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
class Operation(_serialization.Model):
@@ -2780,6 +4015,31 @@ def __init__(
self.next_link = next_link
+class PlacementProfile(_serialization.Model):
+ """Provides options w.r.t allocation and management w.r.t certain placement policies. These
+ utilize capabilities provided by the underlying Azure infrastructure. They are typically used
+ for high availability scenarios. E.g., distributing CGs across fault domains.
+
+ :ivar fault_domain_count: The number of fault domains to be used to spread CGs in the NGroups
+ resource. This can only be specified during NGroup creation and is immutable after that.
+ :vartype fault_domain_count: int
+ """
+
+ _attribute_map = {
+ "fault_domain_count": {"key": "faultDomainCount", "type": "int"},
+ }
+
+ def __init__(self, *, fault_domain_count: Optional[int] = None, **kwargs: Any) -> None:
+ """
+ :keyword fault_domain_count: The number of fault domains to be used to spread CGs in the
+ NGroups resource. This can only be specified during NGroup creation and is immutable after
+ that.
+ :paramtype fault_domain_count: int
+ """
+ super().__init__(**kwargs)
+ self.fault_domain_count = fault_domain_count
+
+
class Port(_serialization.Model):
"""The port exposed on the container group.
@@ -2932,6 +4192,48 @@ def __init__(
self.limits = limits
+class SecretReference(_serialization.Model):
+ """A secret reference.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar name: The identifier of the secret reference. Required.
+ :vartype name: str
+ :ivar identity: The ARM resource id of the managed identity that has access to the secret in
+ the key vault. Required.
+ :vartype identity: str
+ :ivar secret_reference_uri: The URI to the secret in key vault. Required.
+ :vartype secret_reference_uri: str
+ """
+
+ _validation = {
+ "name": {"required": True},
+ "identity": {"required": True},
+ "secret_reference_uri": {"required": True},
+ }
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "identity": {"key": "identity", "type": "str"},
+ "secret_reference_uri": {"key": "secretReferenceUri", "type": "str"},
+ }
+
+ def __init__(self, *, name: str, identity: str, secret_reference_uri: str, **kwargs: Any) -> None:
+ """
+ :keyword name: The identifier of the secret reference. Required.
+ :paramtype name: str
+ :keyword identity: The ARM resource id of the managed identity that has access to the secret in
+ the key vault. Required.
+ :paramtype identity: str
+ :keyword secret_reference_uri: The URI to the secret in key vault. Required.
+ :paramtype secret_reference_uri: str
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.identity = identity
+ self.secret_reference_uri = secret_reference_uri
+
+
class SecurityContextCapabilitiesDefinition(_serialization.Model):
"""The capabilities to add or drop from a container.
@@ -3025,43 +4327,180 @@ def __init__(
self.seccomp_profile = seccomp_profile
-class StandbyPoolProfileDefinition(_serialization.Model):
- """The standby pool profile reference.
+class StorageProfile(_serialization.Model):
+ """Storage profile for storage related settings of a container group profile.
- :ivar id: The standby pool profile reference id.This will be an ARM resource id in the form:
- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyPoolName}'. # pylint: disable=line-too-long
- :vartype id: str
- :ivar fail_container_group_create_on_reuse_failure: The flag to determine whether ACI should
- fail the create request if the container group can not be obtained from standby pool.
- :vartype fail_container_group_create_on_reuse_failure: bool
+ :ivar file_shares:
+ :vartype file_shares: list[~azure.mgmt.containerinstance.models.FileShare]
"""
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "fail_container_group_create_on_reuse_failure": {
- "key": "failContainerGroupCreateOnReuseFailure",
- "type": "bool",
- },
+ "file_shares": {"key": "fileShares", "type": "[FileShare]"},
+ }
+
+ def __init__(self, *, file_shares: Optional[List["_models.FileShare"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword file_shares:
+ :paramtype file_shares: list[~azure.mgmt.containerinstance.models.FileShare]
+ """
+ super().__init__(**kwargs)
+ self.file_shares = file_shares
+
+
+class SystemData(_serialization.Model):
+ """Metadata pertaining to creation and last modification of the resource.
+
+ :ivar created_by: The identity that created the resource.
+ :vartype created_by: str
+ :ivar created_by_type: The type of identity that created the resource. Known values are:
+ "User", "Application", "ManagedIdentity", and "Key".
+ :vartype created_by_type: str or ~azure.mgmt.containerinstance.models.CreatedByType
+ :ivar created_at: The timestamp of resource creation (UTC).
+ :vartype created_at: ~datetime.datetime
+ :ivar last_modified_by: The identity that last modified the resource.
+ :vartype last_modified_by: str
+ :ivar last_modified_by_type: The type of identity that last modified the resource. Known values
+ are: "User", "Application", "ManagedIdentity", and "Key".
+ :vartype last_modified_by_type: str or ~azure.mgmt.containerinstance.models.CreatedByType
+ :ivar last_modified_at: The timestamp of resource last modification (UTC).
+ :vartype last_modified_at: ~datetime.datetime
+ """
+
+ _attribute_map = {
+ "created_by": {"key": "createdBy", "type": "str"},
+ "created_by_type": {"key": "createdByType", "type": "str"},
+ "created_at": {"key": "createdAt", "type": "iso-8601"},
+ "last_modified_by": {"key": "lastModifiedBy", "type": "str"},
+ "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"},
+ "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"},
}
def __init__(
self,
*,
- id: Optional[str] = None, # pylint: disable=redefined-builtin
- fail_container_group_create_on_reuse_failure: Optional[bool] = None,
+ created_by: Optional[str] = None,
+ created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
+ created_at: Optional[datetime.datetime] = None,
+ last_modified_by: Optional[str] = None,
+ last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
+ last_modified_at: Optional[datetime.datetime] = None,
**kwargs: Any
) -> None:
"""
- :keyword id: The standby pool profile reference id.This will be an ARM resource id in the form:
- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyPoolName}'. # pylint: disable=line-too-long
- :paramtype id: str
- :keyword fail_container_group_create_on_reuse_failure: The flag to determine whether ACI should
- fail the create request if the container group can not be obtained from standby pool.
- :paramtype fail_container_group_create_on_reuse_failure: bool
+ :keyword created_by: The identity that created the resource.
+ :paramtype created_by: str
+ :keyword created_by_type: The type of identity that created the resource. Known values are:
+ "User", "Application", "ManagedIdentity", and "Key".
+ :paramtype created_by_type: str or ~azure.mgmt.containerinstance.models.CreatedByType
+ :keyword created_at: The timestamp of resource creation (UTC).
+ :paramtype created_at: ~datetime.datetime
+ :keyword last_modified_by: The identity that last modified the resource.
+ :paramtype last_modified_by: str
+ :keyword last_modified_by_type: The type of identity that last modified the resource. Known
+ values are: "User", "Application", "ManagedIdentity", and "Key".
+ :paramtype last_modified_by_type: str or ~azure.mgmt.containerinstance.models.CreatedByType
+ :keyword last_modified_at: The timestamp of resource last modification (UTC).
+ :paramtype last_modified_at: ~datetime.datetime
"""
super().__init__(**kwargs)
- self.id = id
- self.fail_container_group_create_on_reuse_failure = fail_container_group_create_on_reuse_failure
+ self.created_by = created_by
+ self.created_by_type = created_by_type
+ self.created_at = created_at
+ self.last_modified_by = last_modified_by
+ self.last_modified_by_type = last_modified_by_type
+ self.last_modified_at = last_modified_at
+
+
+class UpdateProfile(_serialization.Model):
+ """Used by the customer to specify the way to update the Container Groups in NGroup.
+
+ :ivar update_mode: Known values are: "Manual" and "Rolling".
+ :vartype update_mode: str or ~azure.mgmt.containerinstance.models.NGroupUpdateMode
+ :ivar rolling_update_profile: This profile allows the customers to customize the rolling
+ update.
+ :vartype rolling_update_profile:
+ ~azure.mgmt.containerinstance.models.UpdateProfileRollingUpdateProfile
+ """
+
+ _attribute_map = {
+ "update_mode": {"key": "updateMode", "type": "str"},
+ "rolling_update_profile": {"key": "rollingUpdateProfile", "type": "UpdateProfileRollingUpdateProfile"},
+ }
+
+ def __init__(
+ self,
+ *,
+ update_mode: Optional[Union[str, "_models.NGroupUpdateMode"]] = None,
+ rolling_update_profile: Optional["_models.UpdateProfileRollingUpdateProfile"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword update_mode: Known values are: "Manual" and "Rolling".
+ :paramtype update_mode: str or ~azure.mgmt.containerinstance.models.NGroupUpdateMode
+ :keyword rolling_update_profile: This profile allows the customers to customize the rolling
+ update.
+ :paramtype rolling_update_profile:
+ ~azure.mgmt.containerinstance.models.UpdateProfileRollingUpdateProfile
+ """
+ super().__init__(**kwargs)
+ self.update_mode = update_mode
+ self.rolling_update_profile = rolling_update_profile
+
+
+class UpdateProfileRollingUpdateProfile(_serialization.Model):
+ """This profile allows the customers to customize the rolling update.
+
+ :ivar max_batch_percent: Maximum percentage of total Container Groups which can be updated
+ simultaneously by rolling update in one batch.
+ :vartype max_batch_percent: int
+ :ivar max_unhealthy_percent: Maximum percentage of the updated Container Groups which can be in
+ unhealthy state after each batch is updated.
+ :vartype max_unhealthy_percent: int
+ :ivar pause_time_between_batches: The wait time between batches after completing the one batch
+ of the rolling update and starting the next batch. The time duration should be specified in ISO
+ 8601 format for duration.
+ :vartype pause_time_between_batches: str
+ :ivar in_place_update: Default is false. If set to true, the CGs will be updated in-place
+ instead of creating new CG and deleting old ones.
+ :vartype in_place_update: bool
+ """
+
+ _attribute_map = {
+ "max_batch_percent": {"key": "maxBatchPercent", "type": "int"},
+ "max_unhealthy_percent": {"key": "maxUnhealthyPercent", "type": "int"},
+ "pause_time_between_batches": {"key": "pauseTimeBetweenBatches", "type": "str"},
+ "in_place_update": {"key": "inPlaceUpdate", "type": "bool"},
+ }
+
+ def __init__(
+ self,
+ *,
+ max_batch_percent: Optional[int] = None,
+ max_unhealthy_percent: Optional[int] = None,
+ pause_time_between_batches: Optional[str] = None,
+ in_place_update: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword max_batch_percent: Maximum percentage of total Container Groups which can be updated
+ simultaneously by rolling update in one batch.
+ :paramtype max_batch_percent: int
+ :keyword max_unhealthy_percent: Maximum percentage of the updated Container Groups which can be
+ in unhealthy state after each batch is updated.
+ :paramtype max_unhealthy_percent: int
+ :keyword pause_time_between_batches: The wait time between batches after completing the one
+ batch of the rolling update and starting the next batch. The time duration should be specified
+ in ISO 8601 format for duration.
+ :paramtype pause_time_between_batches: str
+ :keyword in_place_update: Default is false. If set to true, the CGs will be updated in-place
+ instead of creating new CG and deleting old ones.
+ :paramtype in_place_update: bool
+ """
+ super().__init__(**kwargs)
+ self.max_batch_percent = max_batch_percent
+ self.max_unhealthy_percent = max_unhealthy_percent
+ self.pause_time_between_batches = pause_time_between_batches
+ self.in_place_update = in_place_update
class Usage(_serialization.Model):
@@ -3201,6 +4640,8 @@ class Volume(_serialization.Model):
:vartype empty_dir: JSON
:ivar secret: The secret volume.
:vartype secret: dict[str, str]
+ :ivar secret_reference: The secret reference volume.
+ :vartype secret_reference: dict[str, str]
:ivar git_repo: The git repo volume.
:vartype git_repo: ~azure.mgmt.containerinstance.models.GitRepoVolume
"""
@@ -3214,6 +4655,7 @@ class Volume(_serialization.Model):
"azure_file": {"key": "azureFile", "type": "AzureFileVolume"},
"empty_dir": {"key": "emptyDir", "type": "object"},
"secret": {"key": "secret", "type": "{str}"},
+ "secret_reference": {"key": "secretReference", "type": "{str}"},
"git_repo": {"key": "gitRepo", "type": "GitRepoVolume"},
}
@@ -3224,6 +4666,7 @@ def __init__(
azure_file: Optional["_models.AzureFileVolume"] = None,
empty_dir: Optional[JSON] = None,
secret: Optional[Dict[str, str]] = None,
+ secret_reference: Optional[Dict[str, str]] = None,
git_repo: Optional["_models.GitRepoVolume"] = None,
**kwargs: Any
) -> None:
@@ -3236,6 +4679,8 @@ def __init__(
:paramtype empty_dir: JSON
:keyword secret: The secret volume.
:paramtype secret: dict[str, str]
+ :keyword secret_reference: The secret reference volume.
+ :paramtype secret_reference: dict[str, str]
:keyword git_repo: The git repo volume.
:paramtype git_repo: ~azure.mgmt.containerinstance.models.GitRepoVolume
"""
@@ -3244,6 +4689,7 @@ def __init__(
self.azure_file = azure_file
self.empty_dir = empty_dir
self.secret = secret
+ self.secret_reference = secret_reference
self.git_repo = git_repo
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py
index 7120d9b773f9..88d90a09aa65 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py
@@ -5,17 +5,24 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._container_groups_operations import ContainerGroupsOperations
-from ._operations import Operations
-from ._location_operations import LocationOperations
-from ._containers_operations import ContainersOperations
-from ._subnet_service_association_link_operations import SubnetServiceAssociationLinkOperations
-from ._container_group_profiles_operations import ContainerGroupProfilesOperations
-from ._container_group_profile_operations import ContainerGroupProfileOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._container_groups_operations import ContainerGroupsOperations # type: ignore
+from ._operations import Operations # type: ignore
+from ._location_operations import LocationOperations # type: ignore
+from ._containers_operations import ContainersOperations # type: ignore
+from ._subnet_service_association_link_operations import SubnetServiceAssociationLinkOperations # type: ignore
+from ._ngroups_operations import NGroupsOperations # type: ignore
+from ._cg_profiles_operations import CGProfilesOperations # type: ignore
+from ._cg_profile_operations import CGProfileOperations # type: ignore
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -24,8 +31,9 @@
"LocationOperations",
"ContainersOperations",
"SubnetServiceAssociationLinkOperations",
- "ContainerGroupProfilesOperations",
- "ContainerGroupProfileOperations",
+ "NGroupsOperations",
+ "CGProfilesOperations",
+ "CGProfileOperations",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_group_profiles_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_cg_profile_operations.py
similarity index 70%
rename from sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_group_profiles_operations.py
rename to sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_cg_profile_operations.py
index a759ea9e9238..71c666dee245 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_group_profiles_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_cg_profile_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -17,14 +16,18 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
+from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._serialization import Serializer
@@ -32,7 +35,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,19 +43,34 @@
_SERIALIZER.client_side_validation = False
-def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
+def build_create_or_update_request(
+ resource_group_name: str, container_group_profile_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
- "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroupProfiles"
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}",
) # pylint: disable=line-too-long
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "containerGroupProfileName": _SERIALIZER.url(
+ "container_group_profile_name",
+ container_group_profile_name,
+ "str",
+ max_length=63,
+ min_length=1,
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
+ ),
}
_url: str = _url.format(**path_format_arguments) # type: ignore
@@ -61,28 +79,41 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
-def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
+def build_update_request(
+ resource_group_name: str, container_group_profile_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}",
) # pylint: disable=line-too-long
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
+ "containerGroupProfileName": _SERIALIZER.url(
+ "container_group_profile_name",
+ container_group_profile_name,
+ "str",
+ max_length=63,
+ min_length=1,
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
+ ),
}
_url: str = _url.format(**path_format_arguments) # type: ignore
@@ -91,9 +122,11 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+ return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
def build_get_request(
@@ -102,7 +135,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -121,7 +154,7 @@ def build_get_request(
"str",
max_length=63,
min_length=1,
- pattern=r"^(?!.*--)[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
),
}
@@ -136,14 +169,13 @@ def build_get_request(
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-def build_create_or_update_request(
+def build_delete_request(
resource_group_name: str, container_group_profile_name: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -162,7 +194,7 @@ def build_create_or_update_request(
"str",
max_length=63,
min_length=1,
- pattern=r"^(?!.*--)[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
),
}
@@ -172,27 +204,24 @@ def build_create_or_update_request(
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
-def build_patch_request(
+def build_list_all_revisions_request(
resource_group_name: str, container_group_profile_name: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}/revisions",
) # pylint: disable=line-too-long
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
@@ -205,7 +234,7 @@ def build_patch_request(
"str",
max_length=63,
min_length=1,
- pattern=r"^(?!.*--)[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
),
}
@@ -215,26 +244,28 @@ def build_patch_request(
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
- return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-def build_delete_request(
- resource_group_name: str, container_group_profile_name: str, subscription_id: str, **kwargs: Any
+def build_get_by_revision_number_request(
+ resource_group_name: str,
+ container_group_profile_name: str,
+ revision_number: str,
+ subscription_id: str,
+ **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}/revisions/{revisionNumber}",
) # pylint: disable=line-too-long
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
@@ -247,8 +278,9 @@ def build_delete_request(
"str",
max_length=63,
min_length=1,
- pattern=r"^(?!.*--)[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
),
+ "revisionNumber": _SERIALIZER.url("revision_number", revision_number, "str"),
}
_url: str = _url.format(**path_format_arguments) # type: ignore
@@ -259,17 +291,17 @@ def build_delete_request(
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
- return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-class ContainerGroupProfilesOperations:
+class CGProfileOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.containerinstance.ContainerInstanceManagementClient`'s
- :attr:`container_group_profiles` attribute.
+ :attr:`cg_profile` attribute.
"""
models = _models
@@ -281,235 +313,6 @@ def __init__(self, *args, **kwargs):
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
- @distributed_trace
- def list(self, **kwargs: Any) -> Iterable["_models.ContainerGroupProfile"]:
- """Get a list of container group profiles in the specified subscription.
-
- Get a list of container group profiles in the specified subscription. This operation returns
- properties of each container group profile including containers, image registry credentials,
- restart policy, IP address type, OS type,volumes,current revision number, etc.
-
- :return: An iterator like instance of either ContainerGroupProfile or the result of
- cls(response)
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[_models.ContainerGroupProfileListResult] = kwargs.pop("cls", None)
-
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- def prepare_request(next_link=None):
- if not next_link:
-
- _request = build_list_request(
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- _request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- _request.url = self._client.format_url(_request.url)
- _request.method = "GET"
- return _request
-
- def extract_data(pipeline_response):
- deserialized = self._deserialize("ContainerGroupProfileListResult", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, iter(list_of_elem)
-
- def get_next(next_link=None):
- _request = prepare_request(next_link)
-
- _stream = False
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return ItemPaged(get_next, extract_data)
-
- @distributed_trace
- def list_by_resource_group(
- self, resource_group_name: str, **kwargs: Any
- ) -> Iterable["_models.ContainerGroupProfile"]:
- """Get a list of container group profiles in the specified subscription and resource group.
-
- Get a list of container group profiles in a specified subscription and resource group. This
- operation returns properties of each container group profile including containers, image
- registry credentials, restart policy, IP address type, OS type volumes, current revision
- number, etc.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :return: An iterator like instance of either ContainerGroupProfile or the result of
- cls(response)
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[_models.ContainerGroupProfileListResult] = kwargs.pop("cls", None)
-
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- def prepare_request(next_link=None):
- if not next_link:
-
- _request = build_list_by_resource_group_request(
- resource_group_name=resource_group_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- _request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- _request.url = self._client.format_url(_request.url)
- _request.method = "GET"
- return _request
-
- def extract_data(pipeline_response):
- deserialized = self._deserialize("ContainerGroupProfileListResult", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, iter(list_of_elem)
-
- def get_next(next_link=None):
- _request = prepare_request(next_link)
-
- _stream = False
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return ItemPaged(get_next, extract_data)
-
- @distributed_trace
- def get(
- self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
- ) -> _models.ContainerGroupProfile:
- """Get the properties of the specified container group profile.
-
- Gets the properties of the specified container group profile in the specified subscription and
- resource group. The operation returns the properties of container group profile including
- containers, image registry credentials, restart policy, IP address type, OS type, volumes,
- current revision number, etc.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
- :type container_group_profile_name: str
- :return: ContainerGroupProfile or the result of cls(response)
- :rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[_models.ContainerGroupProfile] = kwargs.pop("cls", None)
-
- _request = build_get_request(
- resource_group_name=resource_group_name,
- container_group_profile_name=container_group_profile_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- _stream = False
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("ContainerGroupProfile", pipeline_response.http_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
-
- return deserialized # type: ignore
-
@overload
def create_or_update(
self,
@@ -520,17 +323,16 @@ def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Create or update container group profiles.
+ """Create or Update a ContainerGroupProfile.
- Create or update container group profiles with specified configurations.
+ Create a CGProfile if it doesn't exist or update an existing CGProfile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
- :param container_group_profile: The properties of the container group profile to be created or
- updated. Required.
+ :param container_group_profile: The ContainerGroupProfile object. Required.
:type container_group_profile: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
@@ -550,17 +352,16 @@ def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Create or update container group profiles.
+ """Create or Update a ContainerGroupProfile.
- Create or update container group profiles with specified configurations.
+ Create a CGProfile if it doesn't exist or update an existing CGProfile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
- :param container_group_profile: The properties of the container group profile to be created or
- updated. Required.
+ :param container_group_profile: The ContainerGroupProfile object. Required.
:type container_group_profile: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
@@ -578,24 +379,24 @@ def create_or_update(
container_group_profile: Union[_models.ContainerGroupProfile, IO[bytes]],
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Create or update container group profiles.
+ """Create or Update a ContainerGroupProfile.
- Create or update container group profiles with specified configurations.
+ Create a CGProfile if it doesn't exist or update an existing CGProfile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
- :param container_group_profile: The properties of the container group profile to be created or
- updated. Is either a ContainerGroupProfile type or a IO[bytes] type. Required.
+ :param container_group_profile: The ContainerGroupProfile object. Is either a
+ ContainerGroupProfile type or a IO[bytes] type. Required.
:type container_group_profile: ~azure.mgmt.containerinstance.models.ContainerGroupProfile or
IO[bytes]
:return: ContainerGroupProfile or the result of cls(response)
:rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -640,17 +441,23 @@ def create_or_update(
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["x-ms-correlation-request-id"] = self._deserialize(
+ "str", response.headers.get("x-ms-correlation-request-id")
+ )
deserialized = self._deserialize("ContainerGroupProfile", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
return deserialized # type: ignore
@overload
- def patch(
+ def update(
self,
resource_group_name: str,
container_group_profile_name: str,
@@ -659,14 +466,14 @@ def patch(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Patch container group profiles.
+ """Container group profile PATCH REST API.
- Patches container group profile with specified properties.
+ Update a specified container group profile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
:param properties: The container group profile properties that need to be updated. Required.
:type properties: ~azure.mgmt.containerinstance.models.ContainerGroupProfilePatch
@@ -679,7 +486,7 @@ def patch(
"""
@overload
- def patch(
+ def update(
self,
resource_group_name: str,
container_group_profile_name: str,
@@ -688,14 +495,14 @@ def patch(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Patch container group profiles.
+ """Container group profile PATCH REST API.
- Patches container group profile with specified properties.
+ Update a specified container group profile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
:param properties: The container group profile properties that need to be updated. Required.
:type properties: IO[bytes]
@@ -708,21 +515,21 @@ def patch(
"""
@distributed_trace
- def patch(
+ def update(
self,
resource_group_name: str,
container_group_profile_name: str,
properties: Union[_models.ContainerGroupProfilePatch, IO[bytes]],
**kwargs: Any
) -> _models.ContainerGroupProfile:
- """Patch container group profiles.
+ """Container group profile PATCH REST API.
- Patches container group profile with specified properties.
+ Update a specified container group profile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
:param properties: The container group profile properties that need to be updated. Is either a
ContainerGroupProfilePatch type or a IO[bytes] type. Required.
@@ -731,7 +538,7 @@ def patch(
:rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -754,7 +561,7 @@ def patch(
else:
_json = self._serialize.body(properties, "ContainerGroupProfilePatch")
- _request = build_patch_request(
+ _request = build_update_request(
resource_group_name=resource_group_name,
container_group_profile_name=container_group_profile_name,
subscription_id=self._config.subscription_id,
@@ -774,6 +581,71 @@ def patch(
response = pipeline_response.http_response
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["x-ms-correlation-request-id"] = self._deserialize(
+ "str", response.headers.get("x-ms-correlation-request-id")
+ )
+
+ deserialized = self._deserialize("ContainerGroupProfile", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def get(
+ self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
+ ) -> _models.ContainerGroupProfile:
+ """Display information about a specified ContainerGroupProfile.
+
+ Get the properties of the specified container group profile.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
+ :type container_group_profile_name: str
+ :return: ContainerGroupProfile or the result of cls(response)
+ :rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ContainerGroupProfile] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ container_group_profile_name=container_group_profile_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
@@ -785,25 +657,235 @@ def patch(
return deserialized # type: ignore
+ def _delete_initial(
+ self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_delete_request(
+ resource_group_name=resource_group_name,
+ container_group_profile_name=container_group_profile_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["x-ms-correlation-request-id"] = self._deserialize(
+ "str", response.headers.get("x-ms-correlation-request-id")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
@distributed_trace
- def delete( # pylint: disable=inconsistent-return-statements
+ def begin_delete(
self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
- ) -> None:
- """Delete the specified container group profile.
+ ) -> LROPoller[None]:
+ """Container group profile DELETE REST API.
- Delete the specified container group profile in the specified subscription and resource group.
- The operation does not delete other resources provided by the user, such as volumes.
+ Deletes a container group profile.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
:type container_group_profile_name: str
- :return: None or the result of cls(response)
- :rtype: None
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_initial(
+ resource_group_name=resource_group_name,
+ container_group_profile_name=container_group_profile_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def list_all_revisions(
+ self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
+ ) -> Iterable["_models.ContainerGroupProfile"]:
+ """Get a list of all the revisions of the specified container group profile in the given
+ subscription and resource group.
+
+ Get a list of all the revisions of the specified container group profile in the given
+ subscription and resource group. This operation returns properties of each revision of the
+ specified container group profile including containers, image registry credentials, restart
+ policy, IP address type, OS type volumes, revision number, etc.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
+ :type container_group_profile_name: str
+ :return: An iterator like instance of either ContainerGroupProfile or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ContainerGroupProfileListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_all_revisions_request(
+ resource_group_name=resource_group_name,
+ container_group_profile_name=container_group_profile_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("ContainerGroupProfileListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def get_by_revision_number(
+ self, resource_group_name: str, container_group_profile_name: str, revision_number: str, **kwargs: Any
+ ) -> _models.ContainerGroupProfile:
+ """Get the properties of the specified revision of the container group profile.
+
+ Gets the properties of the specified revision of the container group profile in the given
+ subscription and resource group. The operation returns the properties of container group
+ profile including containers, image registry credentials, restart policy, IP address type, OS
+ type, volumes, current revision number, etc.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param container_group_profile_name: ContainerGroupProfile name. Required.
+ :type container_group_profile_name: str
+ :param revision_number: The revision number of the container group profile. Required.
+ :type revision_number: str
+ :return: ContainerGroupProfile or the result of cls(response)
+ :rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -815,11 +897,12 @@ def delete( # pylint: disable=inconsistent-return-statements
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[_models.ContainerGroupProfile] = kwargs.pop("cls", None)
- _request = build_delete_request(
+ _request = build_get_by_revision_number_request(
resource_group_name=resource_group_name,
container_group_profile_name=container_group_profile_name,
+ revision_number=revision_number,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
@@ -834,9 +917,13 @@ def delete( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
- if response.status_code not in [200, 204]:
+ if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = self._deserialize("ContainerGroupProfile", pipeline_response.http_response)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_group_profile_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_cg_profiles_operations.py
similarity index 60%
rename from sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_group_profile_operations.py
rename to sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_cg_profiles_operations.py
index ea2f7ca60b95..4505363d5b96 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_group_profile_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_cg_profiles_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from azure.core.exceptions import (
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,33 +38,19 @@
_SERIALIZER.client_side_validation = False
-def build_list_all_revisions_request(
- resource_group_name: str, container_group_profile_name: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
+def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}/revisions",
+ "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroupProfiles"
) # pylint: disable=line-too-long
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "containerGroupProfileName": _SERIALIZER.url(
- "container_group_profile_name",
- container_group_profile_name,
- "str",
- max_length=63,
- min_length=1,
- pattern=r"^(?!.*--)[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
- ),
}
_url: str = _url.format(**path_format_arguments) # type: ignore
@@ -79,38 +64,23 @@ def build_list_all_revisions_request(
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-def build_get_by_revision_number_request(
- resource_group_name: str,
- container_group_profile_name: str,
- revision_number: str,
- subscription_id: str,
- **kwargs: Any
-) -> HttpRequest:
+def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}/revisions/{revisionNumber}",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles",
) # pylint: disable=line-too-long
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
- "containerGroupProfileName": _SERIALIZER.url(
- "container_group_profile_name",
- container_group_profile_name,
- "str",
- max_length=63,
- min_length=1,
- pattern=r"^(?!.*--)[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
- ),
- "revisionNumber": _SERIALIZER.url("revision_number", revision_number, "str"),
}
_url: str = _url.format(**path_format_arguments) # type: ignore
@@ -124,14 +94,14 @@ def build_get_by_revision_number_request(
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-class ContainerGroupProfileOperations:
+class CGProfilesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.containerinstance.ContainerInstanceManagementClient`'s
- :attr:`container_group_profile` attribute.
+ :attr:`cg_profiles` attribute.
"""
models = _models
@@ -144,22 +114,11 @@ def __init__(self, *args, **kwargs):
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
- def list_all_revisions(
- self, resource_group_name: str, container_group_profile_name: str, **kwargs: Any
- ) -> Iterable["_models.ContainerGroupProfile"]:
- """Get a list of all the revisions of the specified container group profile in the given
- subscription and resource group.
+ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ContainerGroupProfile"]:
+ """List container group profiles in a subscription.
- Get a list of all the revisions of the specified container group profile in the given
- subscription and resource group. This operation returns properties of each revision of the
- specified container group profile including containers, image registry credentials, restart
- policy, IP address type, OS type volumes, revision number, etc.
+ Gets a list of all container group profiles under a subscription.
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
- :type container_group_profile_name: str
:return: An iterator like instance of either ContainerGroupProfile or the result of
cls(response)
:rtype:
@@ -172,7 +131,7 @@ def list_all_revisions(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ContainerGroupProfileListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -183,9 +142,7 @@ def list_all_revisions(
def prepare_request(next_link=None):
if not next_link:
- _request = build_list_all_revisions_request(
- resource_group_name=resource_group_name,
- container_group_profile_name=container_group_profile_name,
+ _request = build_list_by_subscription_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
@@ -235,28 +192,29 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
@distributed_trace
- def get_by_revision_number(
- self, resource_group_name: str, container_group_profile_name: str, revision_number: str, **kwargs: Any
- ) -> _models.ContainerGroupProfile:
- """Get the properties of the specified revision of the container group profile.
+ def list_by_resource_group(
+ self, resource_group_name: str, **kwargs: Any
+ ) -> Iterable["_models.ContainerGroupProfile"]:
+ """List container group profiles in a resource group.
- Gets the properties of the specified revision of the container group profile in the given
- subscription and resource group. The operation returns the properties of container group
- profile including containers, image registry credentials, restart policy, IP address type, OS
- type, volumes, current revision number, etc.
+ Gets a list of all container group profiles under a resource group.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param container_group_profile_name: The name of the container group profile. Required.
- :type container_group_profile_name: str
- :param revision_number: The revision number of the container group profile. Required.
- :type revision_number: str
- :return: ContainerGroupProfile or the result of cls(response)
- :rtype: ~azure.mgmt.containerinstance.models.ContainerGroupProfile
+ :return: An iterator like instance of either ContainerGroupProfile or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.containerinstance.models.ContainerGroupProfile]
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ContainerGroupProfileListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -264,37 +222,55 @@ def get_by_revision_number(
}
error_map.update(kwargs.pop("error_map", {}) or {})
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ def prepare_request(next_link=None):
+ if not next_link:
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[_models.ContainerGroupProfile] = kwargs.pop("cls", None)
+ _request = build_list_by_resource_group_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
- _request = build_get_by_revision_number_request(
- resource_group_name=resource_group_name,
- container_group_profile_name=container_group_profile_name,
- revision_number=revision_number,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
- _stream = False
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("ContainerGroupProfileListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
- response = pipeline_response.http_response
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
- deserialized = self._deserialize("ContainerGroupProfile", pipeline_response.http_response)
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
+ return pipeline_response
- return deserialized # type: ignore
+ return ItemPaged(get_next, extract_data)
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py
index 4ae227c0b153..af357de36370 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -48,7 +48,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -74,7 +74,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -106,7 +106,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -139,7 +139,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -175,7 +175,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -211,7 +211,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -244,7 +244,7 @@ def build_restart_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -277,7 +277,7 @@ def build_stop_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -310,7 +310,7 @@ def build_start_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -343,7 +343,7 @@ def build_get_outbound_network_dependencies_endpoints_request( # pylint: disabl
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -390,15 +390,17 @@ def __init__(self, *args, **kwargs):
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
- def list(self, **kwargs: Any) -> Iterable["_models.ContainerGroup"]:
+ def list(self, **kwargs: Any) -> Iterable["_models.ListResultContainerGroup"]:
"""Get a list of container groups in the specified subscription.
Get a list of container groups in the specified subscription. This operation returns properties
of each container group including containers, image registry credentials, restart policy, IP
address type, OS type, state, and volumes.
- :return: An iterator like instance of either ContainerGroup or the result of cls(response)
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerinstance.models.ContainerGroup]
+ :return: An iterator like instance of either ListResultContainerGroup or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.containerinstance.models.ListResultContainerGroup]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
@@ -407,7 +409,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ContainerGroup"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ContainerGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -468,7 +470,9 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
@distributed_trace
- def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ContainerGroup"]:
+ def list_by_resource_group(
+ self, resource_group_name: str, **kwargs: Any
+ ) -> Iterable["_models.ListResultContainerGroup"]:
"""Get a list of container groups in the specified subscription and resource group.
Get a list of container groups in a specified subscription and resource group. This operation
@@ -478,8 +482,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :return: An iterator like instance of either ContainerGroup or the result of cls(response)
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerinstance.models.ContainerGroup]
+ :return: An iterator like instance of either ListResultContainerGroup or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.containerinstance.models.ListResultContainerGroup]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
@@ -488,7 +494,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ContainerGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -566,7 +572,7 @@ def get(self, resource_group_name: str, container_group_name: str, **kwargs: Any
:rtype: ~azure.mgmt.containerinstance.models.ContainerGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -615,7 +621,7 @@ def _create_or_update_initial(
container_group: Union[_models.ContainerGroup, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -890,7 +896,7 @@ def update(
:rtype: ~azure.mgmt.containerinstance.models.ContainerGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -945,7 +951,7 @@ def update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, container_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1056,7 +1062,7 @@ def get_long_running_output(pipeline_response):
)
def _restart_initial(self, resource_group_name: str, container_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1177,7 +1183,7 @@ def stop( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1216,7 +1222,7 @@ def stop( # pylint: disable=inconsistent-return-statements
return cls(pipeline_response, None, {}) # type: ignore
def _start_initial(self, resource_group_name: str, container_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1337,7 +1343,7 @@ def get_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lon
:rtype: list[str]
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py
index 402c91e64a96..abe80fe85107 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -30,7 +29,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -51,7 +50,7 @@ def build_list_logs_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -89,7 +88,7 @@ def build_execute_command_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -126,7 +125,7 @@ def build_attach_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -205,7 +204,7 @@ def list_logs(
:rtype: ~azure.mgmt.containerinstance.models.Logs
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -345,7 +344,7 @@ def execute_command(
:rtype: ~azure.mgmt.containerinstance.models.ContainerExecResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -420,7 +419,7 @@ def attach(
:rtype: ~azure.mgmt.containerinstance.models.ContainerAttachResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py
index b7ad2e02b809..e9b5b2ae3b95 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from azure.core.exceptions import (
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -43,7 +42,7 @@ def build_list_usage_request(location: str, subscription_id: str, **kwargs: Any)
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -71,7 +70,7 @@ def build_list_cached_images_request(location: str, subscription_id: str, **kwar
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -99,7 +98,7 @@ def build_list_capabilities_request(location: str, subscription_id: str, **kwarg
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -158,7 +157,7 @@ def list_usage(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -237,7 +236,7 @@ def list_cached_images(self, location: str, **kwargs: Any) -> Iterable["_models.
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.CachedImagesListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -316,7 +315,7 @@ def list_capabilities(self, location: str, **kwargs: Any) -> Iterable["_models.C
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.CapabilitiesListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_ngroups_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_ngroups_operations.py
new file mode 100644
index 000000000000..483a06d4ef99
--- /dev/null
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_ngroups_operations.py
@@ -0,0 +1,1415 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# 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.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+import sys
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
+import urllib.parse
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
+ map_error,
+)
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.polling import LROPoller, NoPolling, PollingMethod
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.arm_polling import ARMPolling
+
+from .. import models as _models
+from .._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_get_request(resource_group_name: str, ngroups_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "ngroupsName": _SERIALIZER.url(
+ "ngroups_name",
+ ngroups_name,
+ "str",
+ max_length=63,
+ min_length=1,
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_create_or_update_request(
+ resource_group_name: str, ngroups_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "ngroupsName": _SERIALIZER.url(
+ "ngroups_name",
+ ngroups_name,
+ "str",
+ max_length=63,
+ min_length=1,
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_update_request(
+ resource_group_name: str, ngroups_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "ngroupsName": _SERIALIZER.url(
+ "ngroups_name",
+ ngroups_name,
+ "str",
+ max_length=63,
+ min_length=1,
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_delete_request(
+ resource_group_name: str, ngroups_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "ngroupsName": _SERIALIZER.url(
+ "ngroups_name",
+ ngroups_name,
+ "str",
+ max_length=63,
+ min_length=1,
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_start_request(
+ resource_group_name: str, ngroups_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}/start",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "ngroupsName": _SERIALIZER.url(
+ "ngroups_name",
+ ngroups_name,
+ "str",
+ max_length=63,
+ min_length=1,
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_stop_request(resource_group_name: str, ngroups_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}/stop",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "ngroupsName": _SERIALIZER.url(
+ "ngroups_name",
+ ngroups_name,
+ "str",
+ max_length=63,
+ min_length=1,
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_restart_request(
+ resource_group_name: str, ngroups_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups/{ngroupsName}/restart",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "ngroupsName": _SERIALIZER.url(
+ "ngroups_name",
+ ngroups_name,
+ "str",
+ max_length=63,
+ min_length=1,
+ pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$",
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/ngroups",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/ngroups")
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class NGroupsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.containerinstance.ContainerInstanceManagementClient`'s
+ :attr:`ngroups` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def get(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> _models.NGroup:
+ """NGroups GET REST API.
+
+ Get the properties of the specified NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :return: NGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.containerinstance.models.NGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.NGroup] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("NGroup", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ def _create_or_update_initial(
+ self, resource_group_name: str, ngroups_name: str, n_group: Union[_models.NGroup, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(n_group, (IOBase, bytes)):
+ _content = n_group
+ else:
+ _json = self._serialize.body(n_group, "NGroup")
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ ngroups_name: str,
+ n_group: _models.NGroup,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.NGroup]:
+ """NGroup PUT REST API.
+
+ Create or update a NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Required.
+ :type n_group: ~azure.mgmt.containerinstance.models.NGroup
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either NGroup or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ ngroups_name: str,
+ n_group: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.NGroup]:
+ """NGroup PUT REST API.
+
+ Create or update a NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Required.
+ :type n_group: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either NGroup or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_create_or_update(
+ self, resource_group_name: str, ngroups_name: str, n_group: Union[_models.NGroup, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.NGroup]:
+ """NGroup PUT REST API.
+
+ Create or update a NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Is either a NGroup type or a IO[bytes] type. Required.
+ :type n_group: ~azure.mgmt.containerinstance.models.NGroup or IO[bytes]
+ :return: An instance of LROPoller that returns either NGroup or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.NGroup] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ n_group=n_group,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = self._deserialize("NGroup", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.NGroup].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.NGroup](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ def _update_initial(
+ self, resource_group_name: str, ngroups_name: str, n_group: Union[_models.NGroup, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(n_group, (IOBase, bytes)):
+ _content = n_group
+ else:
+ _json = self._serialize.body(n_group, "NGroup")
+
+ _request = build_update_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 200:
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ if response.status_code == 202:
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_update(
+ self,
+ resource_group_name: str,
+ ngroups_name: str,
+ n_group: _models.NGroup,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.NGroup]:
+ """NGroups PATCH REST API.
+
+ Update a specified NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Required.
+ :type n_group: ~azure.mgmt.containerinstance.models.NGroup
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either NGroup or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_update(
+ self,
+ resource_group_name: str,
+ ngroups_name: str,
+ n_group: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.NGroup]:
+ """NGroups PATCH REST API.
+
+ Update a specified NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Required.
+ :type n_group: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either NGroup or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_update(
+ self, resource_group_name: str, ngroups_name: str, n_group: Union[_models.NGroup, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.NGroup]:
+ """NGroups PATCH REST API.
+
+ Update a specified NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :param n_group: The NGroup object. Is either a NGroup type or a IO[bytes] type. Required.
+ :type n_group: ~azure.mgmt.containerinstance.models.NGroup or IO[bytes]
+ :return: An instance of LROPoller that returns either NGroup or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.NGroup] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._update_initial(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ n_group=n_group,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = self._deserialize("NGroup", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.NGroup].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.NGroup](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ def _delete_initial(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_delete_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_delete(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> LROPoller[None]:
+ """NGroups Delete REST API.
+
+ Deletes the NGroups resource.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_initial(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ def _start_initial(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_start_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_start(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> LROPoller[None]:
+ """Starts all container groups in the specified NGroups resource.
+
+ Starts all container groups in the specified NGroups resource. Compute resources will be
+ allocated and billing will start.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._start_initial(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def stop( # pylint: disable=inconsistent-return-statements
+ self, resource_group_name: str, ngroups_name: str, **kwargs: Any
+ ) -> None:
+ """Stops all container groups in the specified NGroups resource.
+
+ Stops all container groups in the specified NGroups resource. Compute resources will be
+ deallocated and billing will stop.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_stop_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ def _restart_initial(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_restart_request(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_restart(self, resource_group_name: str, ngroups_name: str, **kwargs: Any) -> LROPoller[None]:
+ """Restarts all container groups in the specified NGroups resource.
+
+ Restarts all container groups in the specified NGroups resource in place. If container image
+ has updates, new image will be downloaded.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param ngroups_name: The NGroups name. Required.
+ :type ngroups_name: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._restart_initial(
+ resource_group_name=resource_group_name,
+ ngroups_name=ngroups_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NGroup"]:
+ """GET NGroups under a resource group REST API.
+
+ Gets a list of all NGroups resources under a resource group.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :return: An iterator like instance of either NGroup or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.NGroupsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_by_resource_group_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("NGroupsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def list(self, **kwargs: Any) -> Iterable["_models.NGroup"]:
+ """List NGroups in a subscription.
+
+ Gets a list of all NGroups resources under a subscription.
+
+ :return: An iterator like instance of either NGroup or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerinstance.models.NGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.NGroupsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_request(
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("NGroupsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py
index 3b750f69232c..12cb23670246 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from azure.core.exceptions import (
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -43,7 +42,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -91,7 +90,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_subnet_service_association_link_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_subnet_service_association_link_operations.py
index eccbeed67ad0..f0ad130be293 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_subnet_service_association_link_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_subnet_service_association_link_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterator, Optional, Type, TypeVar, Union, cast
+from typing import Any, Callable, Dict, Iterator, Optional, TypeVar, Union, cast
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -33,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,7 +46,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -97,7 +96,7 @@ def __init__(self, *args, **kwargs):
def _delete_initial(
self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/cached_images_list.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/cached_images_list.py
index f111cbec9718..f7593640d997 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/cached_images_list.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/cached_images_list.py
@@ -37,6 +37,6 @@ def main():
print(item)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/CachedImagesList.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/CachedImagesList.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/capabilities_list.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/capabilities_list.py
index c62ac513402f..2344ad63b6e3 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/capabilities_list.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/capabilities_list.py
@@ -37,6 +37,6 @@ def main():
print(item)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/CapabilitiesList.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/CapabilitiesList.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_attach.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_attach.py
index b7a778451025..8a291719c31b 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_attach.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_attach.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerAttach.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerAttach.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_exec.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_exec.py
index 8bde95f563ef..070b02cba06e 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_exec.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_exec.py
@@ -39,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerExec.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerExec.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_create_confidential.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_create_confidential.py
index 8595e0e0f8cc..d671f57b84db 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_create_confidential.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_create_confidential.py
@@ -62,6 +62,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupCreateConfidential.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupCreateConfidential.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_create_or_update_standby_pool.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_create_or_update_standby_pool.py
deleted file mode 100644
index 9995a99cedea..000000000000
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_create_or_update_standby_pool.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# 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.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.containerinstance import ContainerInstanceManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-containerinstance
-# USAGE
- python container_group_create_or_update_standby_pool.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = ContainerInstanceManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="00000000-0000-0000-0000-000000000000",
- )
-
- response = client.container_groups.begin_create_or_update(
- resource_group_name="demo",
- container_group_name="demo1",
- container_group={
- "location": "west us",
- "properties": {
- "containerGroupProfile": {
- "id": "/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroupProfiles/democgp",
- "revision": 1,
- },
- "containers": [{"name": "demo1", "properties": {"configMap": {"keyValuePairs": {"Newkey": "value"}}}}],
- "standbyPoolProfile": {
- "id": "/subscriptions/subid/resourceGroups/demo/providers/Microsoft.StandbyPool/standbyContainerGroupPools/demopool"
- },
- },
- },
- ).result()
- print(response)
-
-
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupCreateOrUpdateStandbyPool.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_encryption_properties.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_encryption_properties.py
index b912076f1e40..633d99d88f01 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_encryption_properties.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_encryption_properties.py
@@ -69,6 +69,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupEncryptionProperties.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupEncryptionProperties.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_extensions.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_extensions.py
index c2715df00e72..77d377f1a338 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_extensions.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_extensions.py
@@ -77,6 +77,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupExtensions.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupExtensions.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_create_or_update_create_confidential.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_create_or_update_create_confidential.py
deleted file mode 100644
index 7b92f39dad8a..000000000000
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_create_or_update_create_confidential.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# 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.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.containerinstance import ContainerInstanceManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-containerinstance
-# USAGE
- python container_group_profile_create_or_update_create_confidential.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = ContainerInstanceManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="00000000-0000-0000-0000-000000000000",
- )
-
- response = client.container_group_profiles.create_or_update(
- resource_group_name="demo",
- container_group_profile_name="demo1",
- container_group_profile={
- "location": "westeurope",
- "properties": {
- "confidentialComputeProperties": {
- "ccePolicy": "eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19"
- },
- "containers": [
- {
- "name": "accdemo",
- "properties": {
- "command": [],
- "environmentVariables": [],
- "image": "confiimage",
- "ports": [{"port": 8000}],
- "resources": {"requests": {"cpu": 1, "memoryInGB": 1.5}},
- "securityContext": {"capabilities": {"add": ["CAP_NET_ADMIN"]}, "privileged": False},
- },
- }
- ],
- "imageRegistryCredentials": [],
- "ipAddress": {"ports": [{"port": 8000, "protocol": "TCP"}], "type": "Public"},
- "osType": "Linux",
- "sku": "Confidential",
- },
- "zones": ["1"],
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfileCreateOrUpdate_CreateConfidential.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_create_or_update_encryption_properties.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_create_or_update_encryption_properties.py
deleted file mode 100644
index ec7389df39d0..000000000000
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_create_or_update_encryption_properties.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# 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.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.containerinstance import ContainerInstanceManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-containerinstance
-# USAGE
- python container_group_profile_create_or_update_encryption_properties.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = ContainerInstanceManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="00000000-0000-0000-0000-000000000000",
- )
-
- response = client.container_group_profiles.create_or_update(
- resource_group_name="demo",
- container_group_profile_name="demo1",
- container_group_profile={
- "location": "eastus2",
- "properties": {
- "containers": [
- {
- "name": "demo1",
- "properties": {
- "command": [],
- "environmentVariables": [],
- "image": "nginx",
- "ports": [{"port": 80}],
- "resources": {"requests": {"cpu": 1, "memoryInGB": 1.5}},
- },
- }
- ],
- "encryptionProperties": {
- "identity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity",
- "keyName": "test-key",
- "keyVersion": "",
- "vaultBaseUrl": "https://testkeyvault.vault.azure.net",
- },
- "imageRegistryCredentials": [],
- "ipAddress": {"ports": [{"port": 80, "protocol": "TCP"}], "type": "Public"},
- "osType": "Linux",
- },
- "zones": ["1"],
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfileCreateOrUpdate_EncryptionProperties.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_create_or_update_extensions.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_create_or_update_extensions.py
deleted file mode 100644
index acf5e175be98..000000000000
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_create_or_update_extensions.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# 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.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.containerinstance import ContainerInstanceManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-containerinstance
-# USAGE
- python container_group_profile_create_or_update_extensions.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = ContainerInstanceManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="00000000-0000-0000-0000-000000000000",
- )
-
- response = client.container_group_profiles.create_or_update(
- resource_group_name="demo",
- container_group_profile_name="demo1",
- container_group_profile={
- "location": "eastus2",
- "properties": {
- "containers": [
- {
- "name": "demo1",
- "properties": {
- "command": [],
- "environmentVariables": [],
- "image": "nginx",
- "ports": [{"port": 80}],
- "resources": {"requests": {"cpu": 1, "memoryInGB": 1.5}},
- },
- }
- ],
- "extensions": [
- {
- "name": "kube-proxy",
- "properties": {
- "extensionType": "kube-proxy",
- "protectedSettings": {"kubeConfig": ""},
- "settings": {"clusterCidr": "10.240.0.0/16", "kubeVersion": "v1.9.10"},
- "version": "1.0",
- },
- },
- {
- "name": "vk-realtime-metrics",
- "properties": {"extensionType": "realtime-metrics", "version": "1.0"},
- },
- ],
- "imageRegistryCredentials": [],
- "ipAddress": {"ports": [{"port": 80, "protocol": "TCP"}], "type": "Private"},
- "osType": "Linux",
- },
- "zones": ["1"],
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfileCreateOrUpdate_Extensions.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_get_by_revision_number.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_get_by_revision_number.py
index c32a0dd2f7df..0347da3ef010 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_get_by_revision_number.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_get_by_revision_number.py
@@ -30,7 +30,7 @@ def main():
subscription_id="00000000-0000-0000-0000-000000000000",
)
- response = client.container_group_profile.get_by_revision_number(
+ response = client.cg_profile.get_by_revision_number(
resource_group_name="demo",
container_group_profile_name="demo1",
revision_number="1",
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfileGetByRevisionNumber.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupProfileGetByRevisionNumber.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_list_all_revisions.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_list_all_revisions.py
index af8ac8248b1e..0dc3d0d11efa 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_list_all_revisions.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profile_list_all_revisions.py
@@ -30,7 +30,7 @@ def main():
subscription_id="00000000-0000-0000-0000-000000000000",
)
- response = client.container_group_profile.list_all_revisions(
+ response = client.cg_profile.list_all_revisions(
resource_group_name="demo",
container_group_profile_name="demo1",
)
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfileListAllRevisions.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupProfileListAllRevisions.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_create_or_update.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_create_or_update.py
deleted file mode 100644
index 79a9668b4f80..000000000000
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_create_or_update.py
+++ /dev/null
@@ -1,92 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# 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.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.containerinstance import ContainerInstanceManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-containerinstance
-# USAGE
- python container_group_profiles_create_or_update.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = ContainerInstanceManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="00000000-0000-0000-0000-000000000000",
- )
-
- response = client.container_group_profiles.create_or_update(
- resource_group_name="demo",
- container_group_profile_name="demo1",
- container_group_profile={
- "location": "west us",
- "properties": {
- "containers": [
- {
- "name": "demo1",
- "properties": {
- "command": [],
- "environmentVariables": [],
- "image": "nginx",
- "ports": [{"port": 80}],
- "resources": {"requests": {"cpu": 1, "gpu": {"count": 1, "sku": "K80"}, "memoryInGB": 1.5}},
- "volumeMounts": [
- {"mountPath": "/mnt/volume1", "name": "volume1", "readOnly": False},
- {"mountPath": "/mnt/volume2", "name": "volume2", "readOnly": False},
- {"mountPath": "/mnt/volume3", "name": "volume3", "readOnly": True},
- ],
- },
- }
- ],
- "diagnostics": {
- "logAnalytics": {
- "logType": "ContainerInsights",
- "metadata": {"pod-uuid": "test-metadata-value"},
- "workspaceId": "workspaceid",
- "workspaceKey": "workspaceKey",
- "workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace",
- }
- },
- "imageRegistryCredentials": [],
- "ipAddress": {"ports": [{"port": 80, "protocol": "TCP"}], "type": "Public"},
- "osType": "Linux",
- "volumes": [
- {
- "azureFile": {
- "shareName": "shareName",
- "storageAccountKey": "accountKey",
- "storageAccountName": "accountName",
- },
- "name": "volume1",
- },
- {"emptyDir": {}, "name": "volume2"},
- {
- "name": "volume3",
- "secret": {"secretKey1": "SecretValue1InBase64", "secretKey2": "SecretValue2InBase64"},
- },
- ],
- },
- "zones": ["1"],
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfilesCreateOrUpdate.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_delete.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_delete.py
index 6d6b02fbfe75..ce387d15c701 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_delete.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_delete.py
@@ -30,12 +30,12 @@ def main():
subscription_id="00000000-0000-0000-0000-000000000000",
)
- client.container_group_profiles.delete(
+ client.cg_profile.begin_delete(
resource_group_name="demo",
container_group_profile_name="demo1",
- )
+ ).result()
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfilesDelete.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupProfilesDelete.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_get.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_get.py
index 32106f87ab66..2325ae6fdc2a 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_get.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_get.py
@@ -30,13 +30,13 @@ def main():
subscription_id="00000000-0000-0000-0000-000000000000",
)
- response = client.container_group_profiles.get(
+ response = client.cg_profile.get(
resource_group_name="demo",
container_group_profile_name="demo1",
)
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfilesGet.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupProfilesGet.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_get_priority.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_get_priority.py
index 42cd14fffda8..286848eaa465 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_get_priority.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_get_priority.py
@@ -30,13 +30,13 @@ def main():
subscription_id="00000000-0000-0000-0000-000000000000",
)
- response = client.container_group_profiles.get(
+ response = client.cg_profile.get(
resource_group_name="demo",
container_group_profile_name="demo1",
)
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfilesGetPriority.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupProfilesGetPriority.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_list.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_list.py
index 4206aaef6772..aa78ee81ae6d 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_list.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_list.py
@@ -30,11 +30,11 @@ def main():
subscription_id="00000000-0000-0000-0000-000000000000",
)
- response = client.container_group_profiles.list()
+ response = client.cg_profiles.list_by_subscription()
for item in response:
print(item)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfilesList.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupProfilesList.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_list_by_resource_group.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_list_by_resource_group.py
index 888588bd2c92..421df2bc6e23 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_list_by_resource_group.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_list_by_resource_group.py
@@ -30,13 +30,13 @@ def main():
subscription_id="00000000-0000-0000-0000-000000000000",
)
- response = client.container_group_profiles.list_by_resource_group(
+ response = client.cg_profiles.list_by_resource_group(
resource_group_name="demo",
)
for item in response:
print(item)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfilesListByResourceGroup.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupProfilesListByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_patch.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_patch.py
index ba009fb17d70..6eb3056facec 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_patch.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_profiles_patch.py
@@ -30,7 +30,7 @@ def main():
subscription_id="00000000-0000-0000-0000-000000000000",
)
- response = client.container_group_profiles.patch(
+ response = client.cg_profile.update(
resource_group_name="demoResource",
container_group_profile_name="demo1",
properties={"tags": {"tag1key": "tag1Value", "tag2key": "tag2Value"}},
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupProfilesPatch.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupProfilesPatch.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_usage.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_usage.py
index 9acf3f8bac12..c11316eb20ba 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_usage.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_group_usage.py
@@ -37,6 +37,6 @@ def main():
print(item)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupUsage.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupUsage.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_create_or_update.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_create_or_update.py
index 9f0f1547cc1c..8b764db29c1d 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_create_or_update.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_create_or_update.py
@@ -107,6 +107,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsCreateOrUpdate.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsCreateOrUpdate.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_create_or_update_secret_reference.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_create_or_update_secret_reference.py
new file mode 100644
index 000000000000..1fba1bf47d3b
--- /dev/null
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_create_or_update_secret_reference.py
@@ -0,0 +1,141 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# 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.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.containerinstance import ContainerInstanceManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-containerinstance
+# USAGE
+ python container_groups_create_or_update_secret_reference.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = ContainerInstanceManagementClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="00000000-0000-0000-0000-000000000000",
+ )
+
+ response = client.container_groups.begin_create_or_update(
+ resource_group_name="demo",
+ container_group_name="demo1",
+ container_group={
+ "identity": {
+ "type": "UserAssigned",
+ "userAssignedIdentities": {
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name": {}
+ },
+ },
+ "location": "west us",
+ "properties": {
+ "containers": [
+ {
+ "name": "demo1",
+ "properties": {
+ "command": [],
+ "environmentVariables": [{"name": "envSecret", "secureValueReference": "envSecretRef"}],
+ "image": "privateRegistryImage",
+ "ports": [{"port": 80}],
+ "resources": {"requests": {"cpu": 1, "gpu": {"count": 1, "sku": "K80"}, "memoryInGB": 1.5}},
+ "volumeMounts": [
+ {"mountPath": "/mnt/volume1", "name": "volume1", "readOnly": False},
+ {"mountPath": "/mnt/volume2", "name": "volume2", "readOnly": False},
+ {"mountPath": "/mnt/volume3", "name": "volume3", "readOnly": True},
+ ],
+ },
+ }
+ ],
+ "diagnostics": {
+ "logAnalytics": {
+ "logType": "ContainerInsights",
+ "metadata": {"test-key": "test-metadata-value"},
+ "workspaceId": "workspaceid",
+ "workspaceKey": "workspaceKey",
+ "workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace",
+ }
+ },
+ "dnsConfig": {
+ "nameServers": ["1.1.1.1"],
+ "options": "ndots:2",
+ "searchDomains": "cluster.local svc.cluster.local",
+ },
+ "imageRegistryCredentials": [
+ {
+ "passwordReference": "privateRegistryKeyRef",
+ "server": "demoregistry.azurecr.io",
+ "username": "registryUserName",
+ }
+ ],
+ "ipAddress": {
+ "autoGeneratedDomainNameLabelScope": "Unsecure",
+ "dnsNameLabel": "dnsnamelabel1",
+ "ports": [{"port": 80, "protocol": "TCP"}],
+ "type": "Public",
+ },
+ "osType": "Linux",
+ "secretReferences": [
+ {
+ "identity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name",
+ "name": "envSecretRef",
+ "secretReferenceUri": "https://keyvaultname.vault.azure.net/secrets/envSecret",
+ },
+ {
+ "identity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name",
+ "name": "accountKeyRef",
+ "secretReferenceUri": "https://keyvaultname.vault.azure.net/secrets/accountKey",
+ },
+ {
+ "identity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name",
+ "name": "volumeSecretRef",
+ "secretReferenceUri": "https://keyvaultname.vault.azure.net/secrets/volumeSecret",
+ },
+ {
+ "identity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name",
+ "name": "privateRegistryKeyRef",
+ "secretReferenceUri": "https://keyvaultname.vault.azure.net/secrets/privateRegistryKey",
+ },
+ ],
+ "subnetIds": [
+ {
+ "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"
+ }
+ ],
+ "volumes": [
+ {
+ "azureFile": {
+ "shareName": "shareName",
+ "storageAccountKeyReference": "accountKeyRef",
+ "storageAccountName": "accountName",
+ },
+ "name": "volume1",
+ },
+ {"emptyDir": {}, "name": "volume2"},
+ {
+ "name": "volume3",
+ "secret": {"secretKey1": "SecretValue1InBase64"},
+ "secretReference": {"secretKey2": "volumeSecretRef"},
+ },
+ ],
+ },
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsCreateOrUpdateSecretReference.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_create_priority.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_create_priority.py
index 7afd66c684c9..93c2a93fe751 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_create_priority.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_create_priority.py
@@ -56,6 +56,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsCreatePriority.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsCreatePriority.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_delete.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_delete.py
index 15f8c832302c..df1fcbea253c 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_delete.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_delete.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsDelete.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsDelete.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_failed.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_failed.py
index 56c75cb1046c..cf363b53b09f 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_failed.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_failed.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsGet_Failed.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsGet_Failed.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_priority.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_priority.py
index 7bbcc1a466bc..1972cd09227a 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_priority.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_priority.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsGetPriority.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsGetPriority.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_succeeded.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_succeeded.py
index b534f3bb1227..3bddf50ddefb 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_succeeded.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_get_succeeded.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsGet_Succeeded.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsGet_Succeeded.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_list.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_list.py
index 546844ad6e15..f3ca27033ba3 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_list.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsList.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_list_by_resource_group.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_list_by_resource_group.py
index ef1b0431b9d7..f7f12fe95b52 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_list_by_resource_group.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_list_by_resource_group.py
@@ -37,6 +37,6 @@ def main():
print(item)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsListByResourceGroup.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsListByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_profile_create_or_update_create_priority.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_profile_create_or_update_create_priority.py
deleted file mode 100644
index d913940cd4a1..000000000000
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_profile_create_or_update_create_priority.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# 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.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.containerinstance import ContainerInstanceManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-containerinstance
-# USAGE
- python container_groups_profile_create_or_update_create_priority.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = ContainerInstanceManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="00000000-0000-0000-0000-000000000000",
- )
-
- response = client.container_group_profiles.create_or_update(
- resource_group_name="demo",
- container_group_profile_name="demo1",
- container_group_profile={
- "location": "eastus",
- "properties": {
- "containers": [
- {
- "name": "test-container-001",
- "properties": {
- "command": ["/bin/sh", "-c", "sleep 10"],
- "image": "alpine:latest",
- "resources": {"requests": {"cpu": 1, "memoryInGB": 1}},
- },
- }
- ],
- "osType": "Linux",
- "priority": "Spot",
- "restartPolicy": "Never",
- "sku": "Standard",
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsProfileCreateOrUpdate_CreatePriority.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_restart.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_restart.py
index 978ab25144b5..4b47e4d93cd3 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_restart.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_restart.py
@@ -36,6 +36,6 @@ def main():
).result()
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsRestart.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsRestart.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_start.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_start.py
index d40773c08b2b..94727d576a9b 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_start.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_start.py
@@ -36,6 +36,6 @@ def main():
).result()
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsStart.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsStart.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_stop.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_stop.py
index 5b5969ca0aac..f9ae422cc936 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_stop.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_groups_stop.py
@@ -36,6 +36,6 @@ def main():
)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerGroupsStop.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerGroupsStop.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_list_logs.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_list_logs.py
index 855578377701..bc50616e91bf 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_list_logs.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/container_list_logs.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/ContainerListLogs.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/ContainerListLogs.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/operations_list.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/operations_list.py
index a02cb7e8094c..cc6ad63f22e8 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/operations_list.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/operations_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/OperationsList.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/OperationsList.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/subnet_service_association_link_delete.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/subnet_service_association_link_delete.py
index 3f588b61c869..4ebabe16597e 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/subnet_service_association_link_delete.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_samples/subnet_service_association_link_delete.py
@@ -37,6 +37,6 @@ def main():
).result()
-# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-05-01-preview/examples/SubnetServiceAssociationLinkDelete.json
+# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2024-11-01-preview/examples/SubnetServiceAssociationLinkDelete.json
if __name__ == "__main__":
main()
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/conftest.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/conftest.py
index e965bd77cfd7..5ea11ac61dff 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/conftest.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/conftest.py
@@ -18,7 +18,7 @@
load_dotenv()
-# aovid record sensitive identity information in recordings
+# For security, please avoid record sensitive identity information in recordings
@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
containerinstancemanagement_subscription_id = os.environ.get(
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profile_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profile_operations.py
new file mode 100644
index 000000000000..56dbfd495d51
--- /dev/null
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profile_operations.py
@@ -0,0 +1,304 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# 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.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.containerinstance import ContainerInstanceManagementClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestContainerInstanceManagementCGProfileOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(ContainerInstanceManagementClient)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_cg_profile_create_or_update(self, resource_group):
+ response = self.client.cg_profile.create_or_update(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ container_group_profile={
+ "confidentialComputeProperties": {"ccePolicy": "str"},
+ "containers": [
+ {
+ "image": "str",
+ "name": "str",
+ "resources": {
+ "requests": {"cpu": 0.0, "memoryInGB": 0.0, "gpu": {"count": 0, "sku": "str"}},
+ "limits": {"cpu": 0.0, "gpu": {"count": 0, "sku": "str"}, "memoryInGB": 0.0},
+ },
+ "command": ["str"],
+ "environmentVariables": [
+ {"name": "str", "secureValue": "str", "secureValueReference": "str", "value": "str"}
+ ],
+ "instanceView": {
+ "currentState": {
+ "detailStatus": "str",
+ "exitCode": 0,
+ "finishTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "state": "str",
+ },
+ "events": [
+ {
+ "count": 0,
+ "firstTimestamp": "2020-02-20 00:00:00",
+ "lastTimestamp": "2020-02-20 00:00:00",
+ "message": "str",
+ "name": "str",
+ "type": "str",
+ }
+ ],
+ "previousState": {
+ "detailStatus": "str",
+ "exitCode": 0,
+ "finishTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "state": "str",
+ },
+ "restartCount": 0,
+ },
+ "livenessProbe": {
+ "exec": {"command": ["str"]},
+ "failureThreshold": 0,
+ "httpGet": {
+ "port": 0,
+ "httpHeaders": [{"name": "str", "value": "str"}],
+ "path": "str",
+ "scheme": "str",
+ },
+ "initialDelaySeconds": 0,
+ "periodSeconds": 0,
+ "successThreshold": 0,
+ "timeoutSeconds": 0,
+ },
+ "ports": [{"port": 0, "protocol": "str"}],
+ "readinessProbe": {
+ "exec": {"command": ["str"]},
+ "failureThreshold": 0,
+ "httpGet": {
+ "port": 0,
+ "httpHeaders": [{"name": "str", "value": "str"}],
+ "path": "str",
+ "scheme": "str",
+ },
+ "initialDelaySeconds": 0,
+ "periodSeconds": 0,
+ "successThreshold": 0,
+ "timeoutSeconds": 0,
+ },
+ "securityContext": {
+ "allowPrivilegeEscalation": bool,
+ "capabilities": {"add": ["str"], "drop": ["str"]},
+ "privileged": bool,
+ "runAsGroup": 0,
+ "runAsUser": 0,
+ "seccompProfile": "str",
+ },
+ "volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}],
+ }
+ ],
+ "diagnostics": {
+ "logAnalytics": {
+ "workspaceId": "str",
+ "workspaceKey": "str",
+ "logType": "str",
+ "metadata": {"str": "str"},
+ "workspaceResourceId": "str",
+ }
+ },
+ "encryptionProperties": {
+ "keyName": "str",
+ "keyVersion": "str",
+ "vaultBaseUrl": "str",
+ "identity": "str",
+ },
+ "extensions": [
+ {"name": "str", "extensionType": "str", "protectedSettings": {}, "settings": {}, "version": "str"}
+ ],
+ "id": "str",
+ "imageRegistryCredentials": [
+ {
+ "server": "str",
+ "identity": "str",
+ "identityUrl": "str",
+ "password": "str",
+ "passwordReference": "str",
+ "username": "str",
+ }
+ ],
+ "initContainers": [
+ {
+ "name": "str",
+ "command": ["str"],
+ "environmentVariables": [
+ {"name": "str", "secureValue": "str", "secureValueReference": "str", "value": "str"}
+ ],
+ "image": "str",
+ "instanceView": {
+ "currentState": {
+ "detailStatus": "str",
+ "exitCode": 0,
+ "finishTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "state": "str",
+ },
+ "events": [
+ {
+ "count": 0,
+ "firstTimestamp": "2020-02-20 00:00:00",
+ "lastTimestamp": "2020-02-20 00:00:00",
+ "message": "str",
+ "name": "str",
+ "type": "str",
+ }
+ ],
+ "previousState": {
+ "detailStatus": "str",
+ "exitCode": 0,
+ "finishTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "state": "str",
+ },
+ "restartCount": 0,
+ },
+ "securityContext": {
+ "allowPrivilegeEscalation": bool,
+ "capabilities": {"add": ["str"], "drop": ["str"]},
+ "privileged": bool,
+ "runAsGroup": 0,
+ "runAsUser": 0,
+ "seccompProfile": "str",
+ },
+ "volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}],
+ }
+ ],
+ "ipAddress": {
+ "ports": [{"port": 0, "protocol": "str"}],
+ "type": "str",
+ "autoGeneratedDomainNameLabelScope": "Unsecure",
+ "dnsNameLabel": "str",
+ "fqdn": "str",
+ "ip": "str",
+ },
+ "location": "str",
+ "name": "str",
+ "osType": "str",
+ "priority": "str",
+ "registeredRevisions": [0],
+ "restartPolicy": "str",
+ "revision": 0,
+ "securityContext": {
+ "allowPrivilegeEscalation": bool,
+ "capabilities": {"add": ["str"], "drop": ["str"]},
+ "privileged": bool,
+ "runAsGroup": 0,
+ "runAsUser": 0,
+ "seccompProfile": "str",
+ },
+ "shutdownGracePeriod": "2020-02-20 00:00:00",
+ "sku": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tags": {"str": "str"},
+ "timeToLive": "2020-02-20 00:00:00",
+ "type": "str",
+ "useKrypton": bool,
+ "volumes": [
+ {
+ "name": "str",
+ "azureFile": {
+ "shareName": "str",
+ "storageAccountName": "str",
+ "readOnly": bool,
+ "storageAccountKey": "str",
+ "storageAccountKeyReference": "str",
+ },
+ "emptyDir": {},
+ "gitRepo": {"repository": "str", "directory": "str", "revision": "str"},
+ "secret": {"str": "str"},
+ "secretReference": {"str": "str"},
+ }
+ ],
+ "zones": ["str"],
+ },
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_cg_profile_update(self, resource_group):
+ response = self.client.cg_profile.update(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ properties={"tags": {"str": "str"}},
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_cg_profile_get(self, resource_group):
+ response = self.client.cg_profile.get(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_cg_profile_begin_delete(self, resource_group):
+ response = self.client.cg_profile.begin_delete(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ api_version="2024-11-01-preview",
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_cg_profile_list_all_revisions(self, resource_group):
+ response = self.client.cg_profile.list_all_revisions(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ api_version="2024-11-01-preview",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_cg_profile_get_by_revision_number(self, resource_group):
+ response = self.client.cg_profile.get_by_revision_number(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ revision_number="str",
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profile_operations_async.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profile_operations_async.py
new file mode 100644
index 000000000000..a049db3f2b7f
--- /dev/null
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profile_operations_async.py
@@ -0,0 +1,307 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# 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.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.containerinstance.aio import ContainerInstanceManagementClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestContainerInstanceManagementCGProfileOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(ContainerInstanceManagementClient, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_cg_profile_create_or_update(self, resource_group):
+ response = await self.client.cg_profile.create_or_update(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ container_group_profile={
+ "confidentialComputeProperties": {"ccePolicy": "str"},
+ "containers": [
+ {
+ "image": "str",
+ "name": "str",
+ "resources": {
+ "requests": {"cpu": 0.0, "memoryInGB": 0.0, "gpu": {"count": 0, "sku": "str"}},
+ "limits": {"cpu": 0.0, "gpu": {"count": 0, "sku": "str"}, "memoryInGB": 0.0},
+ },
+ "command": ["str"],
+ "environmentVariables": [
+ {"name": "str", "secureValue": "str", "secureValueReference": "str", "value": "str"}
+ ],
+ "instanceView": {
+ "currentState": {
+ "detailStatus": "str",
+ "exitCode": 0,
+ "finishTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "state": "str",
+ },
+ "events": [
+ {
+ "count": 0,
+ "firstTimestamp": "2020-02-20 00:00:00",
+ "lastTimestamp": "2020-02-20 00:00:00",
+ "message": "str",
+ "name": "str",
+ "type": "str",
+ }
+ ],
+ "previousState": {
+ "detailStatus": "str",
+ "exitCode": 0,
+ "finishTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "state": "str",
+ },
+ "restartCount": 0,
+ },
+ "livenessProbe": {
+ "exec": {"command": ["str"]},
+ "failureThreshold": 0,
+ "httpGet": {
+ "port": 0,
+ "httpHeaders": [{"name": "str", "value": "str"}],
+ "path": "str",
+ "scheme": "str",
+ },
+ "initialDelaySeconds": 0,
+ "periodSeconds": 0,
+ "successThreshold": 0,
+ "timeoutSeconds": 0,
+ },
+ "ports": [{"port": 0, "protocol": "str"}],
+ "readinessProbe": {
+ "exec": {"command": ["str"]},
+ "failureThreshold": 0,
+ "httpGet": {
+ "port": 0,
+ "httpHeaders": [{"name": "str", "value": "str"}],
+ "path": "str",
+ "scheme": "str",
+ },
+ "initialDelaySeconds": 0,
+ "periodSeconds": 0,
+ "successThreshold": 0,
+ "timeoutSeconds": 0,
+ },
+ "securityContext": {
+ "allowPrivilegeEscalation": bool,
+ "capabilities": {"add": ["str"], "drop": ["str"]},
+ "privileged": bool,
+ "runAsGroup": 0,
+ "runAsUser": 0,
+ "seccompProfile": "str",
+ },
+ "volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}],
+ }
+ ],
+ "diagnostics": {
+ "logAnalytics": {
+ "workspaceId": "str",
+ "workspaceKey": "str",
+ "logType": "str",
+ "metadata": {"str": "str"},
+ "workspaceResourceId": "str",
+ }
+ },
+ "encryptionProperties": {
+ "keyName": "str",
+ "keyVersion": "str",
+ "vaultBaseUrl": "str",
+ "identity": "str",
+ },
+ "extensions": [
+ {"name": "str", "extensionType": "str", "protectedSettings": {}, "settings": {}, "version": "str"}
+ ],
+ "id": "str",
+ "imageRegistryCredentials": [
+ {
+ "server": "str",
+ "identity": "str",
+ "identityUrl": "str",
+ "password": "str",
+ "passwordReference": "str",
+ "username": "str",
+ }
+ ],
+ "initContainers": [
+ {
+ "name": "str",
+ "command": ["str"],
+ "environmentVariables": [
+ {"name": "str", "secureValue": "str", "secureValueReference": "str", "value": "str"}
+ ],
+ "image": "str",
+ "instanceView": {
+ "currentState": {
+ "detailStatus": "str",
+ "exitCode": 0,
+ "finishTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "state": "str",
+ },
+ "events": [
+ {
+ "count": 0,
+ "firstTimestamp": "2020-02-20 00:00:00",
+ "lastTimestamp": "2020-02-20 00:00:00",
+ "message": "str",
+ "name": "str",
+ "type": "str",
+ }
+ ],
+ "previousState": {
+ "detailStatus": "str",
+ "exitCode": 0,
+ "finishTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "state": "str",
+ },
+ "restartCount": 0,
+ },
+ "securityContext": {
+ "allowPrivilegeEscalation": bool,
+ "capabilities": {"add": ["str"], "drop": ["str"]},
+ "privileged": bool,
+ "runAsGroup": 0,
+ "runAsUser": 0,
+ "seccompProfile": "str",
+ },
+ "volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}],
+ }
+ ],
+ "ipAddress": {
+ "ports": [{"port": 0, "protocol": "str"}],
+ "type": "str",
+ "autoGeneratedDomainNameLabelScope": "Unsecure",
+ "dnsNameLabel": "str",
+ "fqdn": "str",
+ "ip": "str",
+ },
+ "location": "str",
+ "name": "str",
+ "osType": "str",
+ "priority": "str",
+ "registeredRevisions": [0],
+ "restartPolicy": "str",
+ "revision": 0,
+ "securityContext": {
+ "allowPrivilegeEscalation": bool,
+ "capabilities": {"add": ["str"], "drop": ["str"]},
+ "privileged": bool,
+ "runAsGroup": 0,
+ "runAsUser": 0,
+ "seccompProfile": "str",
+ },
+ "shutdownGracePeriod": "2020-02-20 00:00:00",
+ "sku": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tags": {"str": "str"},
+ "timeToLive": "2020-02-20 00:00:00",
+ "type": "str",
+ "useKrypton": bool,
+ "volumes": [
+ {
+ "name": "str",
+ "azureFile": {
+ "shareName": "str",
+ "storageAccountName": "str",
+ "readOnly": bool,
+ "storageAccountKey": "str",
+ "storageAccountKeyReference": "str",
+ },
+ "emptyDir": {},
+ "gitRepo": {"repository": "str", "directory": "str", "revision": "str"},
+ "secret": {"str": "str"},
+ "secretReference": {"str": "str"},
+ }
+ ],
+ "zones": ["str"],
+ },
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_cg_profile_update(self, resource_group):
+ response = await self.client.cg_profile.update(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ properties={"tags": {"str": "str"}},
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_cg_profile_get(self, resource_group):
+ response = await self.client.cg_profile.get(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_cg_profile_begin_delete(self, resource_group):
+ response = await (
+ await self.client.cg_profile.begin_delete(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ api_version="2024-11-01-preview",
+ )
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_cg_profile_list_all_revisions(self, resource_group):
+ response = self.client.cg_profile.list_all_revisions(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ api_version="2024-11-01-preview",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_cg_profile_get_by_revision_number(self, resource_group):
+ response = await self.client.cg_profile.get_by_revision_number(
+ resource_group_name=resource_group.name,
+ container_group_profile_name="str",
+ revision_number="str",
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profiles_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profiles_operations.py
new file mode 100644
index 000000000000..9a57ad2d8a39
--- /dev/null
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profiles_operations.py
@@ -0,0 +1,40 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# 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.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.containerinstance import ContainerInstanceManagementClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestContainerInstanceManagementCGProfilesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(ContainerInstanceManagementClient)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_cg_profiles_list_by_subscription(self, resource_group):
+ response = self.client.cg_profiles.list_by_subscription(
+ api_version="2024-11-01-preview",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_cg_profiles_list_by_resource_group(self, resource_group):
+ response = self.client.cg_profiles.list_by_resource_group(
+ resource_group_name=resource_group.name,
+ api_version="2024-11-01-preview",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profiles_operations_async.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profiles_operations_async.py
new file mode 100644
index 000000000000..ee269509f055
--- /dev/null
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_cg_profiles_operations_async.py
@@ -0,0 +1,41 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# 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.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.containerinstance.aio import ContainerInstanceManagementClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestContainerInstanceManagementCGProfilesOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(ContainerInstanceManagementClient, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_cg_profiles_list_by_subscription(self, resource_group):
+ response = self.client.cg_profiles.list_by_subscription(
+ api_version="2024-11-01-preview",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_cg_profiles_list_by_resource_group(self, resource_group):
+ response = self.client.cg_profiles.list_by_resource_group(
+ resource_group_name=resource_group.name,
+ api_version="2024-11-01-preview",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_container_groups_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_container_groups_operations.py
index 5aa36a394fc9..31be1be5082a 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_container_groups_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_container_groups_operations.py
@@ -20,9 +20,9 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_container_groups_list(self, resource_group):
response = self.client.container_groups.list(
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -30,10 +30,10 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_container_groups_list_by_resource_group(self, resource_group):
response = self.client.container_groups.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -41,11 +41,11 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_container_groups_get(self, resource_group):
response = self.client.container_groups.get(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
@@ -53,18 +53,23 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update(self, resource_group):
+ def test_container_groups_begin_create_or_update(self, resource_group):
response = self.client.container_groups.begin_create_or_update(
resource_group_name=resource_group.name,
container_group_name="str",
container_group={
"containers": [
{
+ "image": "str",
"name": "str",
+ "resources": {
+ "requests": {"cpu": 0.0, "memoryInGB": 0.0, "gpu": {"count": 0, "sku": "str"}},
+ "limits": {"cpu": 0.0, "gpu": {"count": 0, "sku": "str"}, "memoryInGB": 0.0},
+ },
"command": ["str"],
- "configMap": {"keyValuePairs": {"str": "str"}},
- "environmentVariables": [{"name": "str", "secureValue": "str", "value": "str"}],
- "image": "str",
+ "environmentVariables": [
+ {"name": "str", "secureValue": "str", "secureValueReference": "str", "value": "str"}
+ ],
"instanceView": {
"currentState": {
"detailStatus": "str",
@@ -121,10 +126,6 @@ def test_begin_create_or_update(self, resource_group):
"successThreshold": 0,
"timeoutSeconds": 0,
},
- "resources": {
- "requests": {"cpu": 0.0, "memoryInGB": 0.0, "gpu": {"count": 0, "sku": "str"}},
- "limits": {"cpu": 0.0, "gpu": {"count": 0, "sku": "str"}, "memoryInGB": 0.0},
- },
"securityContext": {
"allowPrivilegeEscalation": bool,
"capabilities": {"add": ["str"], "drop": ["str"]},
@@ -136,8 +137,8 @@ def test_begin_create_or_update(self, resource_group):
"volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}],
}
],
+ "osType": "str",
"confidentialComputeProperties": {"ccePolicy": "str"},
- "containerGroupProfile": {"id": "str", "revision": 0},
"diagnostics": {
"logAnalytics": {
"workspaceId": "str",
@@ -164,14 +165,24 @@ def test_begin_create_or_update(self, resource_group):
"type": "str",
"userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
},
+ "identityAcls": {"acls": [{"access": "str", "identity": "str"}], "defaultAccess": "str"},
"imageRegistryCredentials": [
- {"server": "str", "identity": "str", "identityUrl": "str", "password": "str", "username": "str"}
+ {
+ "server": "str",
+ "identity": "str",
+ "identityUrl": "str",
+ "password": "str",
+ "passwordReference": "str",
+ "username": "str",
+ }
],
"initContainers": [
{
"name": "str",
"command": ["str"],
- "environmentVariables": [{"name": "str", "secureValue": "str", "value": "str"}],
+ "environmentVariables": [
+ {"name": "str", "secureValue": "str", "secureValueReference": "str", "value": "str"}
+ ],
"image": "str",
"instanceView": {
"currentState": {
@@ -232,15 +243,13 @@ def test_begin_create_or_update(self, resource_group):
"fqdn": "str",
"ip": "str",
},
- "isCreatedFromStandbyPool": bool,
"location": "str",
"name": "str",
- "osType": "str",
"priority": "str",
"provisioningState": "str",
"restartPolicy": "str",
+ "secretReferences": [{"identity": "str", "name": "str", "secretReferenceUri": "str"}],
"sku": "str",
- "standbyPoolProfile": {"failContainerGroupCreateOnReuseFailure": bool, "id": "str"},
"subnetIds": [{"id": "str", "name": "str"}],
"tags": {"str": "str"},
"type": "str",
@@ -252,15 +261,17 @@ def test_begin_create_or_update(self, resource_group):
"storageAccountName": "str",
"readOnly": bool,
"storageAccountKey": "str",
+ "storageAccountKeyReference": "str",
},
"emptyDir": {},
"gitRepo": {"repository": "str", "directory": "str", "revision": "str"},
"secret": {"str": "str"},
+ "secretReference": {"str": "str"},
}
],
"zones": ["str"],
},
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
@@ -268,7 +279,7 @@ def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_container_groups_update(self, resource_group):
response = self.client.container_groups.update(
resource_group_name=resource_group.name,
container_group_name="str",
@@ -280,7 +291,7 @@ def test_update(self, resource_group):
"type": "str",
"zones": ["str"],
},
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
@@ -288,11 +299,11 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete(self, resource_group):
+ def test_container_groups_begin_delete(self, resource_group):
response = self.client.container_groups.begin_delete(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
@@ -300,11 +311,11 @@ def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_restart(self, resource_group):
+ def test_container_groups_begin_restart(self, resource_group):
response = self.client.container_groups.begin_restart(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
@@ -312,11 +323,11 @@ def test_begin_restart(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_stop(self, resource_group):
+ def test_container_groups_stop(self, resource_group):
response = self.client.container_groups.stop(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
@@ -324,11 +335,11 @@ def test_stop(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_start(self, resource_group):
+ def test_container_groups_begin_start(self, resource_group):
response = self.client.container_groups.begin_start(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
@@ -336,11 +347,11 @@ def test_begin_start(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_outbound_network_dependencies_endpoints(self, resource_group):
+ def test_container_groups_get_outbound_network_dependencies_endpoints(self, resource_group):
response = self.client.container_groups.get_outbound_network_dependencies_endpoints(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_container_groups_operations_async.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_container_groups_operations_async.py
index 483ef447d8b1..5011abdd5b7b 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_container_groups_operations_async.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_container_groups_operations_async.py
@@ -21,9 +21,9 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_container_groups_list(self, resource_group):
response = self.client.container_groups.list(
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -31,10 +31,10 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_container_groups_list_by_resource_group(self, resource_group):
response = self.client.container_groups.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -42,11 +42,11 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_container_groups_get(self, resource_group):
response = await self.client.container_groups.get(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
@@ -54,7 +54,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update(self, resource_group):
+ async def test_container_groups_begin_create_or_update(self, resource_group):
response = await (
await self.client.container_groups.begin_create_or_update(
resource_group_name=resource_group.name,
@@ -62,11 +62,16 @@ async def test_begin_create_or_update(self, resource_group):
container_group={
"containers": [
{
+ "image": "str",
"name": "str",
+ "resources": {
+ "requests": {"cpu": 0.0, "memoryInGB": 0.0, "gpu": {"count": 0, "sku": "str"}},
+ "limits": {"cpu": 0.0, "gpu": {"count": 0, "sku": "str"}, "memoryInGB": 0.0},
+ },
"command": ["str"],
- "configMap": {"keyValuePairs": {"str": "str"}},
- "environmentVariables": [{"name": "str", "secureValue": "str", "value": "str"}],
- "image": "str",
+ "environmentVariables": [
+ {"name": "str", "secureValue": "str", "secureValueReference": "str", "value": "str"}
+ ],
"instanceView": {
"currentState": {
"detailStatus": "str",
@@ -123,10 +128,6 @@ async def test_begin_create_or_update(self, resource_group):
"successThreshold": 0,
"timeoutSeconds": 0,
},
- "resources": {
- "requests": {"cpu": 0.0, "memoryInGB": 0.0, "gpu": {"count": 0, "sku": "str"}},
- "limits": {"cpu": 0.0, "gpu": {"count": 0, "sku": "str"}, "memoryInGB": 0.0},
- },
"securityContext": {
"allowPrivilegeEscalation": bool,
"capabilities": {"add": ["str"], "drop": ["str"]},
@@ -138,8 +139,8 @@ async def test_begin_create_or_update(self, resource_group):
"volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}],
}
],
+ "osType": "str",
"confidentialComputeProperties": {"ccePolicy": "str"},
- "containerGroupProfile": {"id": "str", "revision": 0},
"diagnostics": {
"logAnalytics": {
"workspaceId": "str",
@@ -172,14 +173,24 @@ async def test_begin_create_or_update(self, resource_group):
"type": "str",
"userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
},
+ "identityAcls": {"acls": [{"access": "str", "identity": "str"}], "defaultAccess": "str"},
"imageRegistryCredentials": [
- {"server": "str", "identity": "str", "identityUrl": "str", "password": "str", "username": "str"}
+ {
+ "server": "str",
+ "identity": "str",
+ "identityUrl": "str",
+ "password": "str",
+ "passwordReference": "str",
+ "username": "str",
+ }
],
"initContainers": [
{
"name": "str",
"command": ["str"],
- "environmentVariables": [{"name": "str", "secureValue": "str", "value": "str"}],
+ "environmentVariables": [
+ {"name": "str", "secureValue": "str", "secureValueReference": "str", "value": "str"}
+ ],
"image": "str",
"instanceView": {
"currentState": {
@@ -240,15 +251,13 @@ async def test_begin_create_or_update(self, resource_group):
"fqdn": "str",
"ip": "str",
},
- "isCreatedFromStandbyPool": bool,
"location": "str",
"name": "str",
- "osType": "str",
"priority": "str",
"provisioningState": "str",
"restartPolicy": "str",
+ "secretReferences": [{"identity": "str", "name": "str", "secretReferenceUri": "str"}],
"sku": "str",
- "standbyPoolProfile": {"failContainerGroupCreateOnReuseFailure": bool, "id": "str"},
"subnetIds": [{"id": "str", "name": "str"}],
"tags": {"str": "str"},
"type": "str",
@@ -260,15 +269,17 @@ async def test_begin_create_or_update(self, resource_group):
"storageAccountName": "str",
"readOnly": bool,
"storageAccountKey": "str",
+ "storageAccountKeyReference": "str",
},
"emptyDir": {},
"gitRepo": {"repository": "str", "directory": "str", "revision": "str"},
"secret": {"str": "str"},
+ "secretReference": {"str": "str"},
}
],
"zones": ["str"],
},
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
).result() # call '.result()' to poll until service return final result
@@ -277,7 +288,7 @@ async def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_container_groups_update(self, resource_group):
response = await self.client.container_groups.update(
resource_group_name=resource_group.name,
container_group_name="str",
@@ -289,7 +300,7 @@ async def test_update(self, resource_group):
"type": "str",
"zones": ["str"],
},
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
@@ -297,12 +308,12 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete(self, resource_group):
+ async def test_container_groups_begin_delete(self, resource_group):
response = await (
await self.client.container_groups.begin_delete(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
).result() # call '.result()' to poll until service return final result
@@ -311,12 +322,12 @@ async def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_restart(self, resource_group):
+ async def test_container_groups_begin_restart(self, resource_group):
response = await (
await self.client.container_groups.begin_restart(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
).result() # call '.result()' to poll until service return final result
@@ -325,11 +336,11 @@ async def test_begin_restart(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_stop(self, resource_group):
+ async def test_container_groups_stop(self, resource_group):
response = await self.client.container_groups.stop(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
@@ -337,12 +348,12 @@ async def test_stop(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_start(self, resource_group):
+ async def test_container_groups_begin_start(self, resource_group):
response = await (
await self.client.container_groups.begin_start(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
).result() # call '.result()' to poll until service return final result
@@ -351,11 +362,11 @@ async def test_begin_start(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_outbound_network_dependencies_endpoints(self, resource_group):
+ async def test_container_groups_get_outbound_network_dependencies_endpoints(self, resource_group):
response = await self.client.container_groups.get_outbound_network_dependencies_endpoints(
resource_group_name=resource_group.name,
container_group_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_containers_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_containers_operations.py
index 7d98e5b3708d..939193b933fc 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_containers_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_containers_operations.py
@@ -20,12 +20,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_logs(self, resource_group):
+ def test_containers_list_logs(self, resource_group):
response = self.client.containers.list_logs(
resource_group_name=resource_group.name,
container_group_name="str",
container_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
@@ -33,13 +33,13 @@ def test_list_logs(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_execute_command(self, resource_group):
+ def test_containers_execute_command(self, resource_group):
response = self.client.containers.execute_command(
resource_group_name=resource_group.name,
container_group_name="str",
container_name="str",
container_exec_request={"command": "str", "terminalSize": {"cols": 0, "rows": 0}},
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
@@ -47,12 +47,12 @@ def test_execute_command(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_attach(self, resource_group):
+ def test_containers_attach(self, resource_group):
response = self.client.containers.attach(
resource_group_name=resource_group.name,
container_group_name="str",
container_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_containers_operations_async.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_containers_operations_async.py
index 7953336c2ad3..bf9c6e5024d2 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_containers_operations_async.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_containers_operations_async.py
@@ -21,12 +21,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_logs(self, resource_group):
+ async def test_containers_list_logs(self, resource_group):
response = await self.client.containers.list_logs(
resource_group_name=resource_group.name,
container_group_name="str",
container_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
@@ -34,13 +34,13 @@ async def test_list_logs(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_execute_command(self, resource_group):
+ async def test_containers_execute_command(self, resource_group):
response = await self.client.containers.execute_command(
resource_group_name=resource_group.name,
container_group_name="str",
container_name="str",
container_exec_request={"command": "str", "terminalSize": {"cols": 0, "rows": 0}},
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
@@ -48,12 +48,12 @@ async def test_execute_command(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_attach(self, resource_group):
+ async def test_containers_attach(self, resource_group):
response = await self.client.containers.attach(
resource_group_name=resource_group.name,
container_group_name="str",
container_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
# please add some check logic here by yourself
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_location_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_location_operations.py
index 67413abe1b7e..4ab8aa594d82 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_location_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_location_operations.py
@@ -20,10 +20,10 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_usage(self, resource_group):
+ def test_location_list_usage(self, resource_group):
response = self.client.location.list_usage(
location="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -31,10 +31,10 @@ def test_list_usage(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_cached_images(self, resource_group):
+ def test_location_list_cached_images(self, resource_group):
response = self.client.location.list_cached_images(
location="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -42,10 +42,10 @@ def test_list_cached_images(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_capabilities(self, resource_group):
+ def test_location_list_capabilities(self, resource_group):
response = self.client.location.list_capabilities(
location="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_location_operations_async.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_location_operations_async.py
index ab4c08275d34..f36d61bdaca6 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_location_operations_async.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_location_operations_async.py
@@ -21,10 +21,10 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_usage(self, resource_group):
+ async def test_location_list_usage(self, resource_group):
response = self.client.location.list_usage(
location="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -32,10 +32,10 @@ async def test_list_usage(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_cached_images(self, resource_group):
+ async def test_location_list_cached_images(self, resource_group):
response = self.client.location.list_cached_images(
location="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -43,10 +43,10 @@ async def test_list_cached_images(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_capabilities(self, resource_group):
+ async def test_location_list_capabilities(self, resource_group):
response = self.client.location.list_capabilities(
location="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_ngroups_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_ngroups_operations.py
new file mode 100644
index 000000000000..54fd668a091b
--- /dev/null
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_ngroups_operations.py
@@ -0,0 +1,286 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# 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.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.containerinstance import ContainerInstanceManagementClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestContainerInstanceManagementNGroupsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(ContainerInstanceManagementClient)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_ngroups_get(self, resource_group):
+ response = self.client.ngroups.get(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_ngroups_begin_create_or_update(self, resource_group):
+ response = self.client.ngroups.begin_create_or_update(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ n_group={
+ "containerGroupProfiles": [
+ {
+ "containerGroupProperties": {
+ "containers": [
+ {
+ "name": "str",
+ "properties": {
+ "volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}]
+ },
+ }
+ ],
+ "subnetIds": [{"id": "str", "name": "str"}],
+ "volumes": [
+ {
+ "name": "str",
+ "azureFile": {
+ "shareName": "str",
+ "storageAccountName": "str",
+ "readOnly": bool,
+ "storageAccountKey": "str",
+ "storageAccountKeyReference": "str",
+ },
+ }
+ ],
+ },
+ "networkProfile": {
+ "applicationGateway": {"backendAddressPools": [{"resource": "str"}], "resource": "str"},
+ "loadBalancer": {"backendAddressPools": [{"resource": "str"}]},
+ },
+ "resource": {"id": "str"},
+ "revision": 0,
+ "storageProfile": {
+ "fileShares": [
+ {
+ "name": "str",
+ "properties": {"shareAccessTier": "TransactionOptimized", "shareAccessType": "str"},
+ "resourceGroupName": "str",
+ "storageAccountName": "str",
+ }
+ ]
+ },
+ }
+ ],
+ "elasticProfile": {
+ "containerGroupNamingPolicy": {"guidNamingPolicy": {"prefix": "str"}},
+ "desiredCount": 0,
+ "maintainDesiredCount": bool,
+ },
+ "id": "str",
+ "identity": {
+ "principalId": "str",
+ "tenantId": "str",
+ "type": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
+ "location": "str",
+ "name": "str",
+ "placementProfile": {"faultDomainCount": 0},
+ "provisioningState": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tags": {"str": "str"},
+ "type": "str",
+ "updateProfile": {
+ "rollingUpdateProfile": {
+ "inPlaceUpdate": bool,
+ "maxBatchPercent": 0,
+ "maxUnhealthyPercent": 0,
+ "pauseTimeBetweenBatches": "str",
+ },
+ "updateMode": "str",
+ },
+ "zones": ["str"],
+ },
+ api_version="2024-11-01-preview",
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_ngroups_begin_update(self, resource_group):
+ response = self.client.ngroups.begin_update(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ n_group={
+ "containerGroupProfiles": [
+ {
+ "containerGroupProperties": {
+ "containers": [
+ {
+ "name": "str",
+ "properties": {
+ "volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}]
+ },
+ }
+ ],
+ "subnetIds": [{"id": "str", "name": "str"}],
+ "volumes": [
+ {
+ "name": "str",
+ "azureFile": {
+ "shareName": "str",
+ "storageAccountName": "str",
+ "readOnly": bool,
+ "storageAccountKey": "str",
+ "storageAccountKeyReference": "str",
+ },
+ }
+ ],
+ },
+ "networkProfile": {
+ "applicationGateway": {"backendAddressPools": [{"resource": "str"}], "resource": "str"},
+ "loadBalancer": {"backendAddressPools": [{"resource": "str"}]},
+ },
+ "resource": {"id": "str"},
+ "revision": 0,
+ "storageProfile": {
+ "fileShares": [
+ {
+ "name": "str",
+ "properties": {"shareAccessTier": "TransactionOptimized", "shareAccessType": "str"},
+ "resourceGroupName": "str",
+ "storageAccountName": "str",
+ }
+ ]
+ },
+ }
+ ],
+ "elasticProfile": {
+ "containerGroupNamingPolicy": {"guidNamingPolicy": {"prefix": "str"}},
+ "desiredCount": 0,
+ "maintainDesiredCount": bool,
+ },
+ "id": "str",
+ "identity": {
+ "principalId": "str",
+ "tenantId": "str",
+ "type": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
+ "location": "str",
+ "name": "str",
+ "placementProfile": {"faultDomainCount": 0},
+ "provisioningState": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tags": {"str": "str"},
+ "type": "str",
+ "updateProfile": {
+ "rollingUpdateProfile": {
+ "inPlaceUpdate": bool,
+ "maxBatchPercent": 0,
+ "maxUnhealthyPercent": 0,
+ "pauseTimeBetweenBatches": "str",
+ },
+ "updateMode": "str",
+ },
+ "zones": ["str"],
+ },
+ api_version="2024-11-01-preview",
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_ngroups_begin_delete(self, resource_group):
+ response = self.client.ngroups.begin_delete(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ api_version="2024-11-01-preview",
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_ngroups_begin_start(self, resource_group):
+ response = self.client.ngroups.begin_start(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ api_version="2024-11-01-preview",
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_ngroups_stop(self, resource_group):
+ response = self.client.ngroups.stop(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_ngroups_begin_restart(self, resource_group):
+ response = self.client.ngroups.begin_restart(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ api_version="2024-11-01-preview",
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_ngroups_list_by_resource_group(self, resource_group):
+ response = self.client.ngroups.list_by_resource_group(
+ resource_group_name=resource_group.name,
+ api_version="2024-11-01-preview",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_ngroups_list(self, resource_group):
+ response = self.client.ngroups.list(
+ api_version="2024-11-01-preview",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_ngroups_operations_async.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_ngroups_operations_async.py
new file mode 100644
index 000000000000..567667a4ca94
--- /dev/null
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_ngroups_operations_async.py
@@ -0,0 +1,303 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# 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.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.containerinstance.aio import ContainerInstanceManagementClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestContainerInstanceManagementNGroupsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(ContainerInstanceManagementClient, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_ngroups_get(self, resource_group):
+ response = await self.client.ngroups.get(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_ngroups_begin_create_or_update(self, resource_group):
+ response = await (
+ await self.client.ngroups.begin_create_or_update(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ n_group={
+ "containerGroupProfiles": [
+ {
+ "containerGroupProperties": {
+ "containers": [
+ {
+ "name": "str",
+ "properties": {
+ "volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}]
+ },
+ }
+ ],
+ "subnetIds": [{"id": "str", "name": "str"}],
+ "volumes": [
+ {
+ "name": "str",
+ "azureFile": {
+ "shareName": "str",
+ "storageAccountName": "str",
+ "readOnly": bool,
+ "storageAccountKey": "str",
+ "storageAccountKeyReference": "str",
+ },
+ }
+ ],
+ },
+ "networkProfile": {
+ "applicationGateway": {"backendAddressPools": [{"resource": "str"}], "resource": "str"},
+ "loadBalancer": {"backendAddressPools": [{"resource": "str"}]},
+ },
+ "resource": {"id": "str"},
+ "revision": 0,
+ "storageProfile": {
+ "fileShares": [
+ {
+ "name": "str",
+ "properties": {
+ "shareAccessTier": "TransactionOptimized",
+ "shareAccessType": "str",
+ },
+ "resourceGroupName": "str",
+ "storageAccountName": "str",
+ }
+ ]
+ },
+ }
+ ],
+ "elasticProfile": {
+ "containerGroupNamingPolicy": {"guidNamingPolicy": {"prefix": "str"}},
+ "desiredCount": 0,
+ "maintainDesiredCount": bool,
+ },
+ "id": "str",
+ "identity": {
+ "principalId": "str",
+ "tenantId": "str",
+ "type": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
+ "location": "str",
+ "name": "str",
+ "placementProfile": {"faultDomainCount": 0},
+ "provisioningState": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tags": {"str": "str"},
+ "type": "str",
+ "updateProfile": {
+ "rollingUpdateProfile": {
+ "inPlaceUpdate": bool,
+ "maxBatchPercent": 0,
+ "maxUnhealthyPercent": 0,
+ "pauseTimeBetweenBatches": "str",
+ },
+ "updateMode": "str",
+ },
+ "zones": ["str"],
+ },
+ api_version="2024-11-01-preview",
+ )
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_ngroups_begin_update(self, resource_group):
+ response = await (
+ await self.client.ngroups.begin_update(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ n_group={
+ "containerGroupProfiles": [
+ {
+ "containerGroupProperties": {
+ "containers": [
+ {
+ "name": "str",
+ "properties": {
+ "volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}]
+ },
+ }
+ ],
+ "subnetIds": [{"id": "str", "name": "str"}],
+ "volumes": [
+ {
+ "name": "str",
+ "azureFile": {
+ "shareName": "str",
+ "storageAccountName": "str",
+ "readOnly": bool,
+ "storageAccountKey": "str",
+ "storageAccountKeyReference": "str",
+ },
+ }
+ ],
+ },
+ "networkProfile": {
+ "applicationGateway": {"backendAddressPools": [{"resource": "str"}], "resource": "str"},
+ "loadBalancer": {"backendAddressPools": [{"resource": "str"}]},
+ },
+ "resource": {"id": "str"},
+ "revision": 0,
+ "storageProfile": {
+ "fileShares": [
+ {
+ "name": "str",
+ "properties": {
+ "shareAccessTier": "TransactionOptimized",
+ "shareAccessType": "str",
+ },
+ "resourceGroupName": "str",
+ "storageAccountName": "str",
+ }
+ ]
+ },
+ }
+ ],
+ "elasticProfile": {
+ "containerGroupNamingPolicy": {"guidNamingPolicy": {"prefix": "str"}},
+ "desiredCount": 0,
+ "maintainDesiredCount": bool,
+ },
+ "id": "str",
+ "identity": {
+ "principalId": "str",
+ "tenantId": "str",
+ "type": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
+ "location": "str",
+ "name": "str",
+ "placementProfile": {"faultDomainCount": 0},
+ "provisioningState": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tags": {"str": "str"},
+ "type": "str",
+ "updateProfile": {
+ "rollingUpdateProfile": {
+ "inPlaceUpdate": bool,
+ "maxBatchPercent": 0,
+ "maxUnhealthyPercent": 0,
+ "pauseTimeBetweenBatches": "str",
+ },
+ "updateMode": "str",
+ },
+ "zones": ["str"],
+ },
+ api_version="2024-11-01-preview",
+ )
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_ngroups_begin_delete(self, resource_group):
+ response = await (
+ await self.client.ngroups.begin_delete(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ api_version="2024-11-01-preview",
+ )
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_ngroups_begin_start(self, resource_group):
+ response = await (
+ await self.client.ngroups.begin_start(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ api_version="2024-11-01-preview",
+ )
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_ngroups_stop(self, resource_group):
+ response = await self.client.ngroups.stop(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ api_version="2024-11-01-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_ngroups_begin_restart(self, resource_group):
+ response = await (
+ await self.client.ngroups.begin_restart(
+ resource_group_name=resource_group.name,
+ ngroups_name="str",
+ api_version="2024-11-01-preview",
+ )
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_ngroups_list_by_resource_group(self, resource_group):
+ response = self.client.ngroups.list_by_resource_group(
+ resource_group_name=resource_group.name,
+ api_version="2024-11-01-preview",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_ngroups_list(self, resource_group):
+ response = self.client.ngroups.list(
+ api_version="2024-11-01-preview",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_operations.py
index cf615891fc51..28b0ad310761 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_operations.py
@@ -20,9 +20,9 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_operations_list(self, resource_group):
response = self.client.operations.list(
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_operations_async.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_operations_async.py
index 07bc78bc7caa..7e48cacac06f 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_operations_async.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_operations_async.py
@@ -21,9 +21,9 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_operations_list(self, resource_group):
response = self.client.operations.list(
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_subnet_service_association_link_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_subnet_service_association_link_operations.py
index 1a5d0c197c99..ab3e7782310d 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_subnet_service_association_link_operations.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_subnet_service_association_link_operations.py
@@ -20,12 +20,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete(self, resource_group):
+ def test_subnet_service_association_link_begin_delete(self, resource_group):
response = self.client.subnet_service_association_link.begin_delete(
resource_group_name=resource_group.name,
virtual_network_name="str",
subnet_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_subnet_service_association_link_operations_async.py b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_subnet_service_association_link_operations_async.py
index 6f689761a71c..4f4b95b7096c 100644
--- a/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_subnet_service_association_link_operations_async.py
+++ b/sdk/containerinstance/azure-mgmt-containerinstance/generated_tests/test_container_instance_management_subnet_service_association_link_operations_async.py
@@ -21,13 +21,13 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete(self, resource_group):
+ async def test_subnet_service_association_link_begin_delete(self, resource_group):
response = await (
await self.client.subnet_service_association_link.begin_delete(
resource_group_name=resource_group.name,
virtual_network_name="str",
subnet_name="str",
- api_version="2024-05-01-preview",
+ api_version="2024-11-01-preview",
)
).result() # call '.result()' to poll until service return final result