diff --git a/src/Informatica/HISTORY.rst b/src/Informatica/HISTORY.rst new file mode 100644 index 0000000000..abbff5a61a --- /dev/null +++ b/src/Informatica/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +1.0.0b1 +++++++ +* Initial release. \ No newline at end of file diff --git a/src/Informatica/README.md b/src/Informatica/README.md new file mode 100644 index 0000000000..590406090c --- /dev/null +++ b/src/Informatica/README.md @@ -0,0 +1,5 @@ +# Azure CLI Informatica Extension # +This is an extension to Azure CLI to manage Informatica resources. + +## How to use ## +Please add commands usage here. \ No newline at end of file diff --git a/src/Informatica/azext_informatica/__init__.py b/src/Informatica/azext_informatica/__init__.py new file mode 100644 index 0000000000..726d143e17 --- /dev/null +++ b/src/Informatica/azext_informatica/__init__.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_informatica._help import helps # pylint: disable=unused-import + + +class InformaticaCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + custom_command_type = CliCommandType( + operations_tmpl='azext_informatica.custom#{}') + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_command_type) + + def load_command_table(self, args): + from azext_informatica.commands import load_command_table + from azure.cli.core.aaz import load_aaz_command_table + try: + from . import aaz + except ImportError: + aaz = None + if aaz: + load_aaz_command_table( + loader=self, + aaz_pkg_name=aaz.__name__, + args=args + ) + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_informatica._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = InformaticaCommandsLoader diff --git a/src/Informatica/azext_informatica/_help.py b/src/Informatica/azext_informatica/_help.py new file mode 100644 index 0000000000..126d5d0071 --- /dev/null +++ b/src/Informatica/azext_informatica/_help.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +from knack.help_files import helps # pylint: disable=unused-import diff --git a/src/Informatica/azext_informatica/_params.py b/src/Informatica/azext_informatica/_params.py new file mode 100644 index 0000000000..cfcec717c9 --- /dev/null +++ b/src/Informatica/azext_informatica/_params.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + + +def load_arguments(self, _): # pylint: disable=unused-argument + pass diff --git a/src/Informatica/azext_informatica/aaz/__init__.py b/src/Informatica/azext_informatica/aaz/__init__.py new file mode 100644 index 0000000000..5757aea317 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/Informatica/azext_informatica/aaz/latest/__init__.py b/src/Informatica/azext_informatica/aaz/latest/__init__.py new file mode 100644 index 0000000000..f6acc11aa4 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/__init__.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/__cmd_group.py b/src/Informatica/azext_informatica/aaz/latest/informatica/__cmd_group.py new file mode 100644 index 0000000000..35eaf44b7f --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "informatica", +) +class __CMDGroup(AAZCommandGroup): + """Manage Informatica + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/__init__.py b/src/Informatica/azext_informatica/aaz/latest/informatica/__init__.py new file mode 100644 index 0000000000..5a9d61963d --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/__init__.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/__cmd_group.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/__cmd_group.py new file mode 100644 index 0000000000..f3c253e1ca --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "informatica data-management", +) +class __CMDGroup(AAZCommandGroup): + """Manage Informatica + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/__init__.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/__init__.py new file mode 100644 index 0000000000..5a9d61963d --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/__init__.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/__cmd_group.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/__cmd_group.py new file mode 100644 index 0000000000..9645879ba0 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "informatica data-management organization", +) +class __CMDGroup(AAZCommandGroup): + """Manage Informatica organization + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/__init__.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/__init__.py new file mode 100644 index 0000000000..16481d887f --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/__init__.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._get_all_serverless_runtime import * +from ._get_serverless_metadatum import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_create.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_create.py new file mode 100644 index 0000000000..8ce5e7acdf --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_create.py @@ -0,0 +1,587 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization create", +) +class Create(AAZCommand): + """Create a InformaticaOrganizationResource + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}", "2024-05-08"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["-n", "--name", "--organization-name"], + help="Name of the Organizations resource", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.company_details = AAZObjectArg( + options=["--company-details"], + arg_group="Properties", + help="Company details.", + ) + _args_schema.informatica_properties = AAZObjectArg( + options=["--informatica-properties"], + arg_group="Properties", + help="Informatica Organization properties.", + ) + _args_schema.link_organization = AAZObjectArg( + options=["--link-organization"], + arg_group="Properties", + help="Link Organization", + ) + _args_schema.marketplace_details = AAZObjectArg( + options=["--marketplace-details"], + arg_group="Properties", + help="Marketplace details.", + ) + _args_schema.user_details = AAZObjectArg( + options=["--user-details"], + arg_group="Properties", + help="User details", + ) + + company_details = cls._args_schema.company_details + company_details.business = AAZStrArg( + options=["business"], + help="Business phone number", + ) + company_details.company_name = AAZStrArg( + options=["company-name"], + help="company Name", + ) + company_details.country = AAZStrArg( + options=["country"], + help="Country name", + ) + company_details.domain = AAZStrArg( + options=["domain"], + help="Domain name", + ) + company_details.number_of_employees = AAZIntArg( + options=["number-of-employees"], + help="Number Of Employees", + ) + company_details.office_address = AAZStrArg( + options=["office-address"], + help="Office Address", + ) + + informatica_properties = cls._args_schema.informatica_properties + informatica_properties.informatica_region = AAZStrArg( + options=["informatica-region"], + help="Informatica organization region", + ) + informatica_properties.organization_id = AAZStrArg( + options=["organization-id"], + help="Organization id", + ) + informatica_properties.organization_name = AAZStrArg( + options=["organization-name"], + help="Organization name", + ) + informatica_properties.single_sign_on_url = AAZStrArg( + options=["single-sign-on-url"], + help="Single sing on URL for informatica organization", + ) + + link_organization = cls._args_schema.link_organization + link_organization.token = AAZStrArg( + options=["token"], + help="Link organization token", + ) + + marketplace_details = cls._args_schema.marketplace_details + marketplace_details.marketplace_subscription_id = AAZStrArg( + options=["marketplace-subscription-id"], + help="Marketplace Subscription Id", + ) + marketplace_details.offer_details = AAZObjectArg( + options=["offer-details"], + help="Marketplace offer details.", + required=True, + ) + + offer_details = cls._args_schema.marketplace_details.offer_details + offer_details.offer_id = AAZStrArg( + options=["offer-id"], + help="Id of the product offering.", + required=True, + fmt=AAZStrArgFormat( + max_length=250, + ), + ) + offer_details.plan_id = AAZStrArg( + options=["plan-id"], + help="Id of the product offer plan.", + required=True, + fmt=AAZStrArgFormat( + max_length=250, + ), + ) + offer_details.plan_name = AAZStrArg( + options=["plan-name"], + help="Name of the product offer plan.", + required=True, + fmt=AAZStrArgFormat( + max_length=250, + ), + ) + offer_details.publisher_id = AAZStrArg( + options=["publisher-id"], + help="Id of the product publisher.", + required=True, + fmt=AAZStrArgFormat( + max_length=250, + ), + ) + offer_details.term_id = AAZStrArg( + options=["term-id"], + help="Offer plan term id.", + required=True, + fmt=AAZStrArgFormat( + max_length=250, + ), + ) + offer_details.term_unit = AAZStrArg( + options=["term-unit"], + help="Offer plan term unit.", + fmt=AAZStrArgFormat( + max_length=50, + ), + ) + + user_details = cls._args_schema.user_details + user_details.email_address = AAZStrArg( + options=["email-address"], + help="User email address.", + fmt=AAZStrArgFormat( + pattern="^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$", + ), + ) + user_details.first_name = AAZStrArg( + options=["first-name"], + help="User first name.", + fmt=AAZStrArgFormat( + max_length=50, + ), + ) + user_details.last_name = AAZStrArg( + options=["last-name"], + help="User last name.", + fmt=AAZStrArgFormat( + max_length=50, + ), + ) + user_details.phone_number = AAZStrArg( + options=["phone-number"], + help="Phone number of the user used by for contacting them if needed", + fmt=AAZStrArgFormat( + max_length=40, + ), + ) + user_details.upn = AAZStrArg( + options=["upn"], + help="UPN of user", + ) + + # define Arg Group "Resource" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Resource", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Resource", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.OrganizationsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class OrganizationsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("companyDetails", AAZObjectType, ".company_details") + properties.set_prop("informaticaProperties", AAZObjectType, ".informatica_properties") + properties.set_prop("linkOrganization", AAZObjectType, ".link_organization") + properties.set_prop("marketplaceDetails", AAZObjectType, ".marketplace_details") + properties.set_prop("userDetails", AAZObjectType, ".user_details") + + company_details = _builder.get(".properties.companyDetails") + if company_details is not None: + company_details.set_prop("business", AAZStrType, ".business") + company_details.set_prop("companyName", AAZStrType, ".company_name") + company_details.set_prop("country", AAZStrType, ".country") + company_details.set_prop("domain", AAZStrType, ".domain") + company_details.set_prop("numberOfEmployees", AAZIntType, ".number_of_employees") + company_details.set_prop("officeAddress", AAZStrType, ".office_address") + + informatica_properties = _builder.get(".properties.informaticaProperties") + if informatica_properties is not None: + informatica_properties.set_prop("informaticaRegion", AAZStrType, ".informatica_region") + informatica_properties.set_prop("organizationId", AAZStrType, ".organization_id") + informatica_properties.set_prop("organizationName", AAZStrType, ".organization_name") + informatica_properties.set_prop("singleSignOnUrl", AAZStrType, ".single_sign_on_url") + + link_organization = _builder.get(".properties.linkOrganization") + if link_organization is not None: + link_organization.set_prop("token", AAZStrType, ".token") + + marketplace_details = _builder.get(".properties.marketplaceDetails") + if marketplace_details is not None: + marketplace_details.set_prop("marketplaceSubscriptionId", AAZStrType, ".marketplace_subscription_id") + marketplace_details.set_prop("offerDetails", AAZObjectType, ".offer_details", typ_kwargs={"flags": {"required": True}}) + + offer_details = _builder.get(".properties.marketplaceDetails.offerDetails") + if offer_details is not None: + offer_details.set_prop("offerId", AAZStrType, ".offer_id", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("planId", AAZStrType, ".plan_id", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("planName", AAZStrType, ".plan_name", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("publisherId", AAZStrType, ".publisher_id", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("termId", AAZStrType, ".term_id", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("termUnit", AAZStrType, ".term_unit") + + user_details = _builder.get(".properties.userDetails") + if user_details is not None: + user_details.set_prop("emailAddress", AAZStrType, ".email_address") + user_details.set_prop("firstName", AAZStrType, ".first_name") + user_details.set_prop("lastName", AAZStrType, ".last_name") + user_details.set_prop("phoneNumber", AAZStrType, ".phone_number") + user_details.set_prop("upn", AAZStrType, ".upn") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.company_details = AAZObjectType( + serialized_name="companyDetails", + ) + properties.informatica_properties = AAZObjectType( + serialized_name="informaticaProperties", + ) + properties.link_organization = AAZObjectType( + serialized_name="linkOrganization", + ) + properties.marketplace_details = AAZObjectType( + serialized_name="marketplaceDetails", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_details = AAZObjectType( + serialized_name="userDetails", + ) + + company_details = cls._schema_on_200_201.properties.company_details + company_details.business = AAZStrType() + company_details.company_name = AAZStrType( + serialized_name="companyName", + ) + company_details.country = AAZStrType() + company_details.domain = AAZStrType() + company_details.number_of_employees = AAZIntType( + serialized_name="numberOfEmployees", + ) + company_details.office_address = AAZStrType( + serialized_name="officeAddress", + ) + + informatica_properties = cls._schema_on_200_201.properties.informatica_properties + informatica_properties.informatica_region = AAZStrType( + serialized_name="informaticaRegion", + ) + informatica_properties.organization_id = AAZStrType( + serialized_name="organizationId", + ) + informatica_properties.organization_name = AAZStrType( + serialized_name="organizationName", + ) + informatica_properties.single_sign_on_url = AAZStrType( + serialized_name="singleSignOnUrl", + ) + + link_organization = cls._schema_on_200_201.properties.link_organization + link_organization.token = AAZStrType() + + marketplace_details = cls._schema_on_200_201.properties.marketplace_details + marketplace_details.marketplace_subscription_id = AAZStrType( + serialized_name="marketplaceSubscriptionId", + ) + marketplace_details.offer_details = AAZObjectType( + serialized_name="offerDetails", + flags={"required": True}, + ) + + offer_details = cls._schema_on_200_201.properties.marketplace_details.offer_details + offer_details.offer_id = AAZStrType( + serialized_name="offerId", + flags={"required": True}, + ) + offer_details.plan_id = AAZStrType( + serialized_name="planId", + flags={"required": True}, + ) + offer_details.plan_name = AAZStrType( + serialized_name="planName", + flags={"required": True}, + ) + offer_details.publisher_id = AAZStrType( + serialized_name="publisherId", + flags={"required": True}, + ) + offer_details.term_id = AAZStrType( + serialized_name="termId", + flags={"required": True}, + ) + offer_details.term_unit = AAZStrType( + serialized_name="termUnit", + ) + + user_details = cls._schema_on_200_201.properties.user_details + user_details.email_address = AAZStrType( + serialized_name="emailAddress", + ) + user_details.first_name = AAZStrType( + serialized_name="firstName", + ) + user_details.last_name = AAZStrType( + serialized_name="lastName", + ) + user_details.phone_number = AAZStrType( + serialized_name="phoneNumber", + ) + user_details.upn = AAZStrType() + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_delete.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_delete.py new file mode 100644 index 0000000000..5ff7f8320e --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_delete.py @@ -0,0 +1,163 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a InformaticaOrganizationResource + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}", "2024-05-08"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["-n", "--name", "--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.OrganizationsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class OrganizationsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + def on_204(self, session): + pass + + def on_200_201(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_get_all_serverless_runtime.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_get_all_serverless_runtime.py new file mode 100644 index 0000000000..0390d87264 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_get_all_serverless_runtime.py @@ -0,0 +1,248 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization get-all-serverless-runtime", +) +class GetAllServerlessRuntime(AAZCommand): + """Gets all serverless runtime resources in a given informatica organization resource. + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}/getallserverlessruntimes", "2024-05-08"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.OrganizationsGetAllServerlessRuntimes(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class OrganizationsGetAllServerlessRuntimes(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/getAllServerlessRuntimes", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.informatica_runtime_resources = AAZListType( + serialized_name="informaticaRuntimeResources", + flags={"required": True}, + ) + + informatica_runtime_resources = cls._schema_on_200.informatica_runtime_resources + informatica_runtime_resources.Element = AAZObjectType() + + _element = cls._schema_on_200.informatica_runtime_resources.Element + _element.created_by = AAZStrType( + serialized_name="createdBy", + flags={"required": True}, + ) + _element.created_time = AAZStrType( + serialized_name="createdTime", + flags={"required": True}, + ) + _element.description = AAZStrType() + _element.id = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"required": True}, + ) + _element.serverless_config_properties = AAZObjectType( + serialized_name="serverlessConfigProperties", + flags={"required": True}, + ) + _element.status = AAZStrType( + flags={"required": True}, + ) + _element.status_localized = AAZStrType( + serialized_name="statusLocalized", + flags={"required": True}, + ) + _element.status_message = AAZStrType( + serialized_name="statusMessage", + flags={"required": True}, + ) + _element.type = AAZStrType( + flags={"required": True}, + ) + _element.updated_by = AAZStrType( + serialized_name="updatedBy", + flags={"required": True}, + ) + _element.updated_time = AAZStrType( + serialized_name="updatedTime", + flags={"required": True}, + ) + + serverless_config_properties = cls._schema_on_200.informatica_runtime_resources.Element.serverless_config_properties + serverless_config_properties.advanced_custom_properties = AAZStrType( + serialized_name="advancedCustomProperties", + ) + serverless_config_properties.application_type = AAZStrType( + serialized_name="applicationType", + ) + serverless_config_properties.compute_units = AAZStrType( + serialized_name="computeUnits", + ) + serverless_config_properties.execution_timeout = AAZStrType( + serialized_name="executionTimeout", + ) + serverless_config_properties.platform = AAZStrType() + serverless_config_properties.region = AAZStrType() + serverless_config_properties.resource_group_name = AAZStrType( + serialized_name="resourceGroupName", + ) + serverless_config_properties.serverless_arm_resource_id = AAZStrType( + serialized_name="serverlessArmResourceId", + ) + serverless_config_properties.subnet = AAZStrType() + serverless_config_properties.subscription_id = AAZStrType( + serialized_name="subscriptionId", + ) + serverless_config_properties.supplementary_file_location = AAZStrType( + serialized_name="supplementaryFileLocation", + ) + serverless_config_properties.tags = AAZStrType() + serverless_config_properties.tenant_id = AAZStrType( + serialized_name="tenantId", + ) + serverless_config_properties.vnet = AAZStrType() + + return cls._schema_on_200 + + +class _GetAllServerlessRuntimeHelper: + """Helper class for GetAllServerlessRuntime""" + + +__all__ = ["GetAllServerlessRuntime"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_get_serverless_metadatum.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_get_serverless_metadatum.py new file mode 100644 index 0000000000..0713da6fc0 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_get_serverless_metadatum.py @@ -0,0 +1,278 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization get-serverless-metadatum", +) +class GetServerlessMetadatum(AAZCommand): + """Gets Metadata of the serverless runtime environment. + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}/getserverlessmetadata", "2024-05-08"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.OrganizationsGetServerlessMetadata(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class OrganizationsGetServerlessMetadata(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/getServerlessMetadata", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.serverless_config_properties = AAZObjectType( + serialized_name="serverlessConfigProperties", + ) + _schema_on_200.serverless_runtime_config_properties = AAZObjectType( + serialized_name="serverlessRuntimeConfigProperties", + ) + _schema_on_200.type = AAZStrType() + + serverless_config_properties = cls._schema_on_200.serverless_config_properties + serverless_config_properties.application_types = AAZListType( + serialized_name="applicationTypes", + ) + serverless_config_properties.compute_units = AAZListType( + serialized_name="computeUnits", + ) + serverless_config_properties.execution_timeout = AAZStrType( + serialized_name="executionTimeout", + ) + serverless_config_properties.platform = AAZStrType() + serverless_config_properties.regions = AAZListType() + + application_types = cls._schema_on_200.serverless_config_properties.application_types + application_types.Element = AAZObjectType() + + _element = cls._schema_on_200.serverless_config_properties.application_types.Element + _element.name = AAZStrType() + _element.value = AAZStrType() + + compute_units = cls._schema_on_200.serverless_config_properties.compute_units + compute_units.Element = AAZObjectType() + + _element = cls._schema_on_200.serverless_config_properties.compute_units.Element + _element.name = AAZStrType() + _element.value = AAZListType() + + value = cls._schema_on_200.serverless_config_properties.compute_units.Element.value + value.Element = AAZStrType() + + regions = cls._schema_on_200.serverless_config_properties.regions + regions.Element = AAZObjectType() + + _element = cls._schema_on_200.serverless_config_properties.regions.Element + _element.id = AAZStrType() + _element.name = AAZStrType() + + serverless_runtime_config_properties = cls._schema_on_200.serverless_runtime_config_properties + serverless_runtime_config_properties.cdi_config_props = AAZListType( + serialized_name="cdiConfigProps", + ) + serverless_runtime_config_properties.cdie_config_props = AAZListType( + serialized_name="cdieConfigProps", + ) + + cdi_config_props = cls._schema_on_200.serverless_runtime_config_properties.cdi_config_props + cdi_config_props.Element = AAZObjectType() + _GetServerlessMetadatumHelper._build_schema_cdi_config_props_read(cdi_config_props.Element) + + cdie_config_props = cls._schema_on_200.serverless_runtime_config_properties.cdie_config_props + cdie_config_props.Element = AAZObjectType() + _GetServerlessMetadatumHelper._build_schema_cdi_config_props_read(cdie_config_props.Element) + + return cls._schema_on_200 + + +class _GetServerlessMetadatumHelper: + """Helper class for GetServerlessMetadatum""" + + _schema_cdi_config_props_read = None + + @classmethod + def _build_schema_cdi_config_props_read(cls, _schema): + if cls._schema_cdi_config_props_read is not None: + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + return + + cls._schema_cdi_config_props_read = _schema_cdi_config_props_read = AAZObjectType() + + cdi_config_props_read = _schema_cdi_config_props_read + cdi_config_props_read.application_configs = AAZListType( + serialized_name="applicationConfigs", + flags={"required": True}, + ) + cdi_config_props_read.engine_name = AAZStrType( + serialized_name="engineName", + flags={"required": True}, + ) + cdi_config_props_read.engine_version = AAZStrType( + serialized_name="engineVersion", + flags={"required": True}, + ) + + application_configs = _schema_cdi_config_props_read.application_configs + application_configs.Element = AAZObjectType() + + _element = _schema_cdi_config_props_read.application_configs.Element + _element.customized = AAZStrType( + flags={"required": True}, + ) + _element.default_value = AAZStrType( + serialized_name="defaultValue", + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"required": True}, + ) + _element.platform = AAZStrType( + flags={"required": True}, + ) + _element.type = AAZStrType( + flags={"required": True}, + ) + _element.value = AAZStrType( + flags={"required": True}, + ) + + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + + +__all__ = ["GetServerlessMetadatum"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_list.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_list.py new file mode 100644 index 0000000000..2784d31075 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_list.py @@ -0,0 +1,543 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization list", +) +class List(AAZCommand): + """List InformaticaOrganizationResource resources by subscription ID + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/informatica.datamanagement/organizations", "2024-05-08"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations", "2024-05-08"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + if condition_0: + self.OrganizationsListByResourceGroup(ctx=self.ctx)() + if condition_1: + self.OrganizationsListBySubscription(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class OrganizationsListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.company_details = AAZObjectType( + serialized_name="companyDetails", + ) + properties.informatica_properties = AAZObjectType( + serialized_name="informaticaProperties", + ) + properties.link_organization = AAZObjectType( + serialized_name="linkOrganization", + ) + properties.marketplace_details = AAZObjectType( + serialized_name="marketplaceDetails", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_details = AAZObjectType( + serialized_name="userDetails", + ) + + company_details = cls._schema_on_200.value.Element.properties.company_details + company_details.business = AAZStrType() + company_details.company_name = AAZStrType( + serialized_name="companyName", + ) + company_details.country = AAZStrType() + company_details.domain = AAZStrType() + company_details.number_of_employees = AAZIntType( + serialized_name="numberOfEmployees", + ) + company_details.office_address = AAZStrType( + serialized_name="officeAddress", + ) + + informatica_properties = cls._schema_on_200.value.Element.properties.informatica_properties + informatica_properties.informatica_region = AAZStrType( + serialized_name="informaticaRegion", + ) + informatica_properties.organization_id = AAZStrType( + serialized_name="organizationId", + ) + informatica_properties.organization_name = AAZStrType( + serialized_name="organizationName", + ) + informatica_properties.single_sign_on_url = AAZStrType( + serialized_name="singleSignOnUrl", + ) + + link_organization = cls._schema_on_200.value.Element.properties.link_organization + link_organization.token = AAZStrType() + + marketplace_details = cls._schema_on_200.value.Element.properties.marketplace_details + marketplace_details.marketplace_subscription_id = AAZStrType( + serialized_name="marketplaceSubscriptionId", + ) + marketplace_details.offer_details = AAZObjectType( + serialized_name="offerDetails", + flags={"required": True}, + ) + + offer_details = cls._schema_on_200.value.Element.properties.marketplace_details.offer_details + offer_details.offer_id = AAZStrType( + serialized_name="offerId", + flags={"required": True}, + ) + offer_details.plan_id = AAZStrType( + serialized_name="planId", + flags={"required": True}, + ) + offer_details.plan_name = AAZStrType( + serialized_name="planName", + flags={"required": True}, + ) + offer_details.publisher_id = AAZStrType( + serialized_name="publisherId", + flags={"required": True}, + ) + offer_details.term_id = AAZStrType( + serialized_name="termId", + flags={"required": True}, + ) + offer_details.term_unit = AAZStrType( + serialized_name="termUnit", + ) + + user_details = cls._schema_on_200.value.Element.properties.user_details + user_details.email_address = AAZStrType( + serialized_name="emailAddress", + ) + user_details.first_name = AAZStrType( + serialized_name="firstName", + ) + user_details.last_name = AAZStrType( + serialized_name="lastName", + ) + user_details.phone_number = AAZStrType( + serialized_name="phoneNumber", + ) + user_details.upn = AAZStrType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class OrganizationsListBySubscription(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Informatica.DataManagement/organizations", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.company_details = AAZObjectType( + serialized_name="companyDetails", + ) + properties.informatica_properties = AAZObjectType( + serialized_name="informaticaProperties", + ) + properties.link_organization = AAZObjectType( + serialized_name="linkOrganization", + ) + properties.marketplace_details = AAZObjectType( + serialized_name="marketplaceDetails", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_details = AAZObjectType( + serialized_name="userDetails", + ) + + company_details = cls._schema_on_200.value.Element.properties.company_details + company_details.business = AAZStrType() + company_details.company_name = AAZStrType( + serialized_name="companyName", + ) + company_details.country = AAZStrType() + company_details.domain = AAZStrType() + company_details.number_of_employees = AAZIntType( + serialized_name="numberOfEmployees", + ) + company_details.office_address = AAZStrType( + serialized_name="officeAddress", + ) + + informatica_properties = cls._schema_on_200.value.Element.properties.informatica_properties + informatica_properties.informatica_region = AAZStrType( + serialized_name="informaticaRegion", + ) + informatica_properties.organization_id = AAZStrType( + serialized_name="organizationId", + ) + informatica_properties.organization_name = AAZStrType( + serialized_name="organizationName", + ) + informatica_properties.single_sign_on_url = AAZStrType( + serialized_name="singleSignOnUrl", + ) + + link_organization = cls._schema_on_200.value.Element.properties.link_organization + link_organization.token = AAZStrType() + + marketplace_details = cls._schema_on_200.value.Element.properties.marketplace_details + marketplace_details.marketplace_subscription_id = AAZStrType( + serialized_name="marketplaceSubscriptionId", + ) + marketplace_details.offer_details = AAZObjectType( + serialized_name="offerDetails", + flags={"required": True}, + ) + + offer_details = cls._schema_on_200.value.Element.properties.marketplace_details.offer_details + offer_details.offer_id = AAZStrType( + serialized_name="offerId", + flags={"required": True}, + ) + offer_details.plan_id = AAZStrType( + serialized_name="planId", + flags={"required": True}, + ) + offer_details.plan_name = AAZStrType( + serialized_name="planName", + flags={"required": True}, + ) + offer_details.publisher_id = AAZStrType( + serialized_name="publisherId", + flags={"required": True}, + ) + offer_details.term_id = AAZStrType( + serialized_name="termId", + flags={"required": True}, + ) + offer_details.term_unit = AAZStrType( + serialized_name="termUnit", + ) + + user_details = cls._schema_on_200.value.Element.properties.user_details + user_details.email_address = AAZStrType( + serialized_name="emailAddress", + ) + user_details.first_name = AAZStrType( + serialized_name="firstName", + ) + user_details.last_name = AAZStrType( + serialized_name="lastName", + ) + user_details.phone_number = AAZStrType( + serialized_name="phoneNumber", + ) + user_details.upn = AAZStrType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_show.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_show.py new file mode 100644 index 0000000000..b3bc8fadab --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_show.py @@ -0,0 +1,308 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization show", +) +class Show(AAZCommand): + """Get a InformaticaOrganizationResource + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}", "2024-05-08"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["-n", "--name", "--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.OrganizationsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class OrganizationsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.company_details = AAZObjectType( + serialized_name="companyDetails", + ) + properties.informatica_properties = AAZObjectType( + serialized_name="informaticaProperties", + ) + properties.link_organization = AAZObjectType( + serialized_name="linkOrganization", + ) + properties.marketplace_details = AAZObjectType( + serialized_name="marketplaceDetails", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_details = AAZObjectType( + serialized_name="userDetails", + ) + + company_details = cls._schema_on_200.properties.company_details + company_details.business = AAZStrType() + company_details.company_name = AAZStrType( + serialized_name="companyName", + ) + company_details.country = AAZStrType() + company_details.domain = AAZStrType() + company_details.number_of_employees = AAZIntType( + serialized_name="numberOfEmployees", + ) + company_details.office_address = AAZStrType( + serialized_name="officeAddress", + ) + + informatica_properties = cls._schema_on_200.properties.informatica_properties + informatica_properties.informatica_region = AAZStrType( + serialized_name="informaticaRegion", + ) + informatica_properties.organization_id = AAZStrType( + serialized_name="organizationId", + ) + informatica_properties.organization_name = AAZStrType( + serialized_name="organizationName", + ) + informatica_properties.single_sign_on_url = AAZStrType( + serialized_name="singleSignOnUrl", + ) + + link_organization = cls._schema_on_200.properties.link_organization + link_organization.token = AAZStrType() + + marketplace_details = cls._schema_on_200.properties.marketplace_details + marketplace_details.marketplace_subscription_id = AAZStrType( + serialized_name="marketplaceSubscriptionId", + ) + marketplace_details.offer_details = AAZObjectType( + serialized_name="offerDetails", + flags={"required": True}, + ) + + offer_details = cls._schema_on_200.properties.marketplace_details.offer_details + offer_details.offer_id = AAZStrType( + serialized_name="offerId", + flags={"required": True}, + ) + offer_details.plan_id = AAZStrType( + serialized_name="planId", + flags={"required": True}, + ) + offer_details.plan_name = AAZStrType( + serialized_name="planName", + flags={"required": True}, + ) + offer_details.publisher_id = AAZStrType( + serialized_name="publisherId", + flags={"required": True}, + ) + offer_details.term_id = AAZStrType( + serialized_name="termId", + flags={"required": True}, + ) + offer_details.term_unit = AAZStrType( + serialized_name="termUnit", + ) + + user_details = cls._schema_on_200.properties.user_details + user_details.email_address = AAZStrType( + serialized_name="emailAddress", + ) + user_details.first_name = AAZStrType( + serialized_name="firstName", + ) + user_details.last_name = AAZStrType( + serialized_name="lastName", + ) + user_details.phone_number = AAZStrType( + serialized_name="phoneNumber", + ) + user_details.upn = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_update.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_update.py new file mode 100644 index 0000000000..add0b28824 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_update.py @@ -0,0 +1,743 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization update", +) +class Update(AAZCommand): + """Update a InformaticaOrganizationResource + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}", "2024-05-08"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["-n", "--name", "--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.company_details = AAZObjectArg( + options=["--company-details"], + arg_group="Properties", + help="Company details.", + nullable=True, + ) + _args_schema.informatica_properties = AAZObjectArg( + options=["--informatica-properties"], + arg_group="Properties", + help="Informatica Organization properties.", + nullable=True, + ) + _args_schema.link_organization = AAZObjectArg( + options=["--link-organization"], + arg_group="Properties", + help="Link Organization", + nullable=True, + ) + _args_schema.marketplace_details = AAZObjectArg( + options=["--marketplace-details"], + arg_group="Properties", + help="Marketplace details.", + nullable=True, + ) + _args_schema.user_details = AAZObjectArg( + options=["--user-details"], + arg_group="Properties", + help="User details", + nullable=True, + ) + + company_details = cls._args_schema.company_details + company_details.business = AAZStrArg( + options=["business"], + help="Business phone number", + nullable=True, + ) + company_details.company_name = AAZStrArg( + options=["company-name"], + help="company Name", + nullable=True, + ) + company_details.country = AAZStrArg( + options=["country"], + help="Country name", + nullable=True, + ) + company_details.domain = AAZStrArg( + options=["domain"], + help="Domain name", + nullable=True, + ) + company_details.number_of_employees = AAZIntArg( + options=["number-of-employees"], + help="Number Of Employees", + nullable=True, + ) + company_details.office_address = AAZStrArg( + options=["office-address"], + help="Office Address", + nullable=True, + ) + + informatica_properties = cls._args_schema.informatica_properties + informatica_properties.informatica_region = AAZStrArg( + options=["informatica-region"], + help="Informatica organization region", + nullable=True, + ) + informatica_properties.organization_id = AAZStrArg( + options=["organization-id"], + help="Organization id", + nullable=True, + ) + informatica_properties.organization_name = AAZStrArg( + options=["organization-name"], + help="Organization name", + nullable=True, + ) + informatica_properties.single_sign_on_url = AAZStrArg( + options=["single-sign-on-url"], + help="Single sing on URL for informatica organization", + nullable=True, + ) + + link_organization = cls._args_schema.link_organization + link_organization.token = AAZStrArg( + options=["token"], + help="Link organization token", + nullable=True, + ) + + marketplace_details = cls._args_schema.marketplace_details + marketplace_details.marketplace_subscription_id = AAZStrArg( + options=["marketplace-subscription-id"], + help="Marketplace Subscription Id", + nullable=True, + ) + marketplace_details.offer_details = AAZObjectArg( + options=["offer-details"], + help="Marketplace offer details.", + ) + + offer_details = cls._args_schema.marketplace_details.offer_details + offer_details.offer_id = AAZStrArg( + options=["offer-id"], + help="Id of the product offering.", + fmt=AAZStrArgFormat( + max_length=250, + ), + ) + offer_details.plan_id = AAZStrArg( + options=["plan-id"], + help="Id of the product offer plan.", + fmt=AAZStrArgFormat( + max_length=250, + ), + ) + offer_details.plan_name = AAZStrArg( + options=["plan-name"], + help="Name of the product offer plan.", + fmt=AAZStrArgFormat( + max_length=250, + ), + ) + offer_details.publisher_id = AAZStrArg( + options=["publisher-id"], + help="Id of the product publisher.", + fmt=AAZStrArgFormat( + max_length=250, + ), + ) + offer_details.term_id = AAZStrArg( + options=["term-id"], + help="Offer plan term id.", + fmt=AAZStrArgFormat( + max_length=250, + ), + ) + offer_details.term_unit = AAZStrArg( + options=["term-unit"], + help="Offer plan term unit.", + nullable=True, + fmt=AAZStrArgFormat( + max_length=50, + ), + ) + + user_details = cls._args_schema.user_details + user_details.email_address = AAZStrArg( + options=["email-address"], + help="User email address.", + nullable=True, + fmt=AAZStrArgFormat( + pattern="^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$", + ), + ) + user_details.first_name = AAZStrArg( + options=["first-name"], + help="User first name.", + nullable=True, + fmt=AAZStrArgFormat( + max_length=50, + ), + ) + user_details.last_name = AAZStrArg( + options=["last-name"], + help="User last name.", + nullable=True, + fmt=AAZStrArgFormat( + max_length=50, + ), + ) + user_details.phone_number = AAZStrArg( + options=["phone-number"], + help="Phone number of the user used by for contacting them if needed", + nullable=True, + fmt=AAZStrArgFormat( + max_length=40, + ), + ) + user_details.upn = AAZStrArg( + options=["upn"], + help="UPN of user", + nullable=True, + ) + + # define Arg Group "Resource" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Resource", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.OrganizationsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.OrganizationsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class OrganizationsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_informatica_organization_resource_read(cls._schema_on_200) + + return cls._schema_on_200 + + class OrganizationsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_informatica_organization_resource_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("companyDetails", AAZObjectType, ".company_details") + properties.set_prop("informaticaProperties", AAZObjectType, ".informatica_properties") + properties.set_prop("linkOrganization", AAZObjectType, ".link_organization") + properties.set_prop("marketplaceDetails", AAZObjectType, ".marketplace_details") + properties.set_prop("userDetails", AAZObjectType, ".user_details") + + company_details = _builder.get(".properties.companyDetails") + if company_details is not None: + company_details.set_prop("business", AAZStrType, ".business") + company_details.set_prop("companyName", AAZStrType, ".company_name") + company_details.set_prop("country", AAZStrType, ".country") + company_details.set_prop("domain", AAZStrType, ".domain") + company_details.set_prop("numberOfEmployees", AAZIntType, ".number_of_employees") + company_details.set_prop("officeAddress", AAZStrType, ".office_address") + + informatica_properties = _builder.get(".properties.informaticaProperties") + if informatica_properties is not None: + informatica_properties.set_prop("informaticaRegion", AAZStrType, ".informatica_region") + informatica_properties.set_prop("organizationId", AAZStrType, ".organization_id") + informatica_properties.set_prop("organizationName", AAZStrType, ".organization_name") + informatica_properties.set_prop("singleSignOnUrl", AAZStrType, ".single_sign_on_url") + + link_organization = _builder.get(".properties.linkOrganization") + if link_organization is not None: + link_organization.set_prop("token", AAZStrType, ".token") + + marketplace_details = _builder.get(".properties.marketplaceDetails") + if marketplace_details is not None: + marketplace_details.set_prop("marketplaceSubscriptionId", AAZStrType, ".marketplace_subscription_id") + marketplace_details.set_prop("offerDetails", AAZObjectType, ".offer_details", typ_kwargs={"flags": {"required": True}}) + + offer_details = _builder.get(".properties.marketplaceDetails.offerDetails") + if offer_details is not None: + offer_details.set_prop("offerId", AAZStrType, ".offer_id", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("planId", AAZStrType, ".plan_id", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("planName", AAZStrType, ".plan_name", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("publisherId", AAZStrType, ".publisher_id", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("termId", AAZStrType, ".term_id", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("termUnit", AAZStrType, ".term_unit") + + user_details = _builder.get(".properties.userDetails") + if user_details is not None: + user_details.set_prop("emailAddress", AAZStrType, ".email_address") + user_details.set_prop("firstName", AAZStrType, ".first_name") + user_details.set_prop("lastName", AAZStrType, ".last_name") + user_details.set_prop("phoneNumber", AAZStrType, ".phone_number") + user_details.set_prop("upn", AAZStrType, ".upn") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_informatica_organization_resource_read = None + + @classmethod + def _build_schema_informatica_organization_resource_read(cls, _schema): + if cls._schema_informatica_organization_resource_read is not None: + _schema.id = cls._schema_informatica_organization_resource_read.id + _schema.location = cls._schema_informatica_organization_resource_read.location + _schema.name = cls._schema_informatica_organization_resource_read.name + _schema.properties = cls._schema_informatica_organization_resource_read.properties + _schema.system_data = cls._schema_informatica_organization_resource_read.system_data + _schema.tags = cls._schema_informatica_organization_resource_read.tags + _schema.type = cls._schema_informatica_organization_resource_read.type + return + + cls._schema_informatica_organization_resource_read = _schema_informatica_organization_resource_read = AAZObjectType() + + informatica_organization_resource_read = _schema_informatica_organization_resource_read + informatica_organization_resource_read.id = AAZStrType( + flags={"read_only": True}, + ) + informatica_organization_resource_read.location = AAZStrType( + flags={"required": True}, + ) + informatica_organization_resource_read.name = AAZStrType( + flags={"read_only": True}, + ) + informatica_organization_resource_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + informatica_organization_resource_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + informatica_organization_resource_read.tags = AAZDictType() + informatica_organization_resource_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_informatica_organization_resource_read.properties + properties.company_details = AAZObjectType( + serialized_name="companyDetails", + ) + properties.informatica_properties = AAZObjectType( + serialized_name="informaticaProperties", + ) + properties.link_organization = AAZObjectType( + serialized_name="linkOrganization", + ) + properties.marketplace_details = AAZObjectType( + serialized_name="marketplaceDetails", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_details = AAZObjectType( + serialized_name="userDetails", + ) + + company_details = _schema_informatica_organization_resource_read.properties.company_details + company_details.business = AAZStrType() + company_details.company_name = AAZStrType( + serialized_name="companyName", + ) + company_details.country = AAZStrType() + company_details.domain = AAZStrType() + company_details.number_of_employees = AAZIntType( + serialized_name="numberOfEmployees", + ) + company_details.office_address = AAZStrType( + serialized_name="officeAddress", + ) + + informatica_properties = _schema_informatica_organization_resource_read.properties.informatica_properties + informatica_properties.informatica_region = AAZStrType( + serialized_name="informaticaRegion", + ) + informatica_properties.organization_id = AAZStrType( + serialized_name="organizationId", + ) + informatica_properties.organization_name = AAZStrType( + serialized_name="organizationName", + ) + informatica_properties.single_sign_on_url = AAZStrType( + serialized_name="singleSignOnUrl", + ) + + link_organization = _schema_informatica_organization_resource_read.properties.link_organization + link_organization.token = AAZStrType() + + marketplace_details = _schema_informatica_organization_resource_read.properties.marketplace_details + marketplace_details.marketplace_subscription_id = AAZStrType( + serialized_name="marketplaceSubscriptionId", + ) + marketplace_details.offer_details = AAZObjectType( + serialized_name="offerDetails", + flags={"required": True}, + ) + + offer_details = _schema_informatica_organization_resource_read.properties.marketplace_details.offer_details + offer_details.offer_id = AAZStrType( + serialized_name="offerId", + flags={"required": True}, + ) + offer_details.plan_id = AAZStrType( + serialized_name="planId", + flags={"required": True}, + ) + offer_details.plan_name = AAZStrType( + serialized_name="planName", + flags={"required": True}, + ) + offer_details.publisher_id = AAZStrType( + serialized_name="publisherId", + flags={"required": True}, + ) + offer_details.term_id = AAZStrType( + serialized_name="termId", + flags={"required": True}, + ) + offer_details.term_unit = AAZStrType( + serialized_name="termUnit", + ) + + user_details = _schema_informatica_organization_resource_read.properties.user_details + user_details.email_address = AAZStrType( + serialized_name="emailAddress", + ) + user_details.first_name = AAZStrType( + serialized_name="firstName", + ) + user_details.last_name = AAZStrType( + serialized_name="lastName", + ) + user_details.phone_number = AAZStrType( + serialized_name="phoneNumber", + ) + user_details.upn = AAZStrType() + + system_data = _schema_informatica_organization_resource_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_informatica_organization_resource_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_informatica_organization_resource_read.id + _schema.location = cls._schema_informatica_organization_resource_read.location + _schema.name = cls._schema_informatica_organization_resource_read.name + _schema.properties = cls._schema_informatica_organization_resource_read.properties + _schema.system_data = cls._schema_informatica_organization_resource_read.system_data + _schema.tags = cls._schema_informatica_organization_resource_read.tags + _schema.type = cls._schema_informatica_organization_resource_read.type + + +__all__ = ["Update"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_wait.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_wait.py new file mode 100644 index 0000000000..8a9c91def7 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/_wait.py @@ -0,0 +1,307 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}", "2024-05-08"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["-n", "--name", "--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.OrganizationsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class OrganizationsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.company_details = AAZObjectType( + serialized_name="companyDetails", + ) + properties.informatica_properties = AAZObjectType( + serialized_name="informaticaProperties", + ) + properties.link_organization = AAZObjectType( + serialized_name="linkOrganization", + ) + properties.marketplace_details = AAZObjectType( + serialized_name="marketplaceDetails", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_details = AAZObjectType( + serialized_name="userDetails", + ) + + company_details = cls._schema_on_200.properties.company_details + company_details.business = AAZStrType() + company_details.company_name = AAZStrType( + serialized_name="companyName", + ) + company_details.country = AAZStrType() + company_details.domain = AAZStrType() + company_details.number_of_employees = AAZIntType( + serialized_name="numberOfEmployees", + ) + company_details.office_address = AAZStrType( + serialized_name="officeAddress", + ) + + informatica_properties = cls._schema_on_200.properties.informatica_properties + informatica_properties.informatica_region = AAZStrType( + serialized_name="informaticaRegion", + ) + informatica_properties.organization_id = AAZStrType( + serialized_name="organizationId", + ) + informatica_properties.organization_name = AAZStrType( + serialized_name="organizationName", + ) + informatica_properties.single_sign_on_url = AAZStrType( + serialized_name="singleSignOnUrl", + ) + + link_organization = cls._schema_on_200.properties.link_organization + link_organization.token = AAZStrType() + + marketplace_details = cls._schema_on_200.properties.marketplace_details + marketplace_details.marketplace_subscription_id = AAZStrType( + serialized_name="marketplaceSubscriptionId", + ) + marketplace_details.offer_details = AAZObjectType( + serialized_name="offerDetails", + flags={"required": True}, + ) + + offer_details = cls._schema_on_200.properties.marketplace_details.offer_details + offer_details.offer_id = AAZStrType( + serialized_name="offerId", + flags={"required": True}, + ) + offer_details.plan_id = AAZStrType( + serialized_name="planId", + flags={"required": True}, + ) + offer_details.plan_name = AAZStrType( + serialized_name="planName", + flags={"required": True}, + ) + offer_details.publisher_id = AAZStrType( + serialized_name="publisherId", + flags={"required": True}, + ) + offer_details.term_id = AAZStrType( + serialized_name="termId", + flags={"required": True}, + ) + offer_details.term_unit = AAZStrType( + serialized_name="termUnit", + ) + + user_details = cls._schema_on_200.properties.user_details + user_details.email_address = AAZStrType( + serialized_name="emailAddress", + ) + user_details.first_name = AAZStrType( + serialized_name="firstName", + ) + user_details.last_name = AAZStrType( + serialized_name="lastName", + ) + user_details.phone_number = AAZStrType( + serialized_name="phoneNumber", + ) + user_details.upn = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/__cmd_group.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/__cmd_group.py new file mode 100644 index 0000000000..60f38659c3 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "informatica data-management organization serverless-runtime", +) +class __CMDGroup(AAZCommandGroup): + """Manage Informatica serverless-runtime + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/__init__.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/__init__.py new file mode 100644 index 0000000000..7d46011676 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/__init__.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._check_dependency import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._start_failed_serverless_runtime import * +from ._update import * +from ._wait import * diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_check_dependency.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_check_dependency.py new file mode 100644 index 0000000000..6038db441f --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_check_dependency.py @@ -0,0 +1,212 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization serverless-runtime check-dependency", +) +class CheckDependency(AAZCommand): + """Checks all dependencies for a serverless runtime resource + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}/serverlessruntimes/{}/checkdependencies", "2024-05-08"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.serverless_runtime_name = AAZStrArg( + options=["--serverless-runtime-name"], + help="Name of the Serverless Runtime resource", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ServerlessRuntimesCheckDependencies(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ServerlessRuntimesCheckDependencies(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/serverlessRuntimes/{serverlessRuntimeName}/checkDependencies", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serverlessRuntimeName", self.ctx.args.serverless_runtime_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.count = AAZIntType( + flags={"required": True}, + ) + _schema_on_200.id = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.references = AAZListType( + flags={"required": True}, + ) + + references = cls._schema_on_200.references + references.Element = AAZObjectType() + + _element = cls._schema_on_200.references.Element + _element.app_context_id = AAZStrType( + serialized_name="appContextId", + flags={"required": True}, + ) + _element.description = AAZStrType( + flags={"required": True}, + ) + _element.document_type = AAZStrType( + serialized_name="documentType", + flags={"required": True}, + ) + _element.id = AAZStrType( + flags={"required": True}, + ) + _element.last_updated_time = AAZStrType( + serialized_name="lastUpdatedTime", + flags={"required": True}, + ) + _element.path = AAZStrType( + flags={"required": True}, + ) + + return cls._schema_on_200 + + +class _CheckDependencyHelper: + """Helper class for CheckDependency""" + + +__all__ = ["CheckDependency"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_create.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_create.py new file mode 100644 index 0000000000..ac3923c050 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_create.py @@ -0,0 +1,679 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization serverless-runtime create", +) +class Create(AAZCommand): + """Create a InformaticaServerlessRuntimeResource + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}/serverlessruntimes/{}", "2024-05-08"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["--organization-name"], + help="Name of the Organizations resource", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.serverless_runtime_name = AAZStrArg( + options=["-n", "--name", "--serverless-runtime-name"], + help="Name of the Serverless Runtime resource", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.advanced_custom_properties = AAZListArg( + options=["--advanced-custom-properties"], + arg_group="Properties", + help="String KV pairs indicating Advanced custom properties.", + ) + _args_schema.application_type = AAZStrArg( + options=["--application-type"], + arg_group="Properties", + help="Application type of the Serverless Runtime environment.", + enum={"CDI": "CDI", "CDIE": "CDIE"}, + ) + _args_schema.compute_units = AAZStrArg( + options=["--compute-units"], + arg_group="Properties", + help="Compute units of the serverless runtime.", + ) + _args_schema.description = AAZStrArg( + options=["--description"], + arg_group="Properties", + help="description of the serverless runtime.", + ) + _args_schema.execution_timeout = AAZStrArg( + options=["--execution-timeout"], + arg_group="Properties", + help="Serverless Execution timeout", + ) + _args_schema.platform = AAZStrArg( + options=["--platform"], + arg_group="Properties", + help="Platform type of the Serverless Runtime.", + enum={"AZURE": "AZURE"}, + ) + _args_schema.serverless_account_location = AAZStrArg( + options=["--serverless-account-location"], + arg_group="Properties", + help="Serverless account creation location", + ) + _args_schema.serverless_runtime_config = AAZObjectArg( + options=["--serverless-runtime-config"], + arg_group="Properties", + help="Serverless config properties", + ) + _args_schema.serverless_runtime_network_profile = AAZObjectArg( + options=["--serverless-runtime-network-profile"], + arg_group="Properties", + help="Informatica Serverless Network profile properties.", + ) + _args_schema.serverless_runtime_tags = AAZListArg( + options=["--serverless-runtime-tags"], + arg_group="Properties", + help="Serverless Runtime Tags", + ) + _args_schema.serverless_runtime_user_context_properties = AAZObjectArg( + options=["--serverless-runtime-user-context-properties"], + arg_group="Properties", + help="Serverless runtime user context properties", + ) + _args_schema.supplementary_file_location = AAZStrArg( + options=["--supplementary-file-location"], + arg_group="Properties", + help="Supplementary file location.", + ) + + advanced_custom_properties = cls._args_schema.advanced_custom_properties + advanced_custom_properties.Element = AAZObjectArg() + + _element = cls._args_schema.advanced_custom_properties.Element + _element.key = AAZStrArg( + options=["key"], + help="advanced custom properties key", + ) + _element.value = AAZStrArg( + options=["value"], + help="advanced custom properties value", + ) + + serverless_runtime_config = cls._args_schema.serverless_runtime_config + serverless_runtime_config.cdi_config_props = AAZListArg( + options=["cdi-config-props"], + help="The List of Informatica Serverless Runtime CDI Config Properties.", + ) + serverless_runtime_config.cdie_config_props = AAZListArg( + options=["cdie-config-props"], + help="The List of Informatica Serverless Runtime CDIE Config Properties.", + ) + + cdi_config_props = cls._args_schema.serverless_runtime_config.cdi_config_props + cdi_config_props.Element = AAZObjectArg() + cls._build_args_cdi_config_props_create(cdi_config_props.Element) + + cdie_config_props = cls._args_schema.serverless_runtime_config.cdie_config_props + cdie_config_props.Element = AAZObjectArg() + cls._build_args_cdi_config_props_create(cdie_config_props.Element) + + serverless_runtime_network_profile = cls._args_schema.serverless_runtime_network_profile + serverless_runtime_network_profile.network_interface_configuration = AAZObjectArg( + options=["network-interface-configuration"], + help="Network Interface Configuration Profile", + required=True, + ) + + network_interface_configuration = cls._args_schema.serverless_runtime_network_profile.network_interface_configuration + network_interface_configuration.subnet_id = AAZResourceIdArg( + options=["subnet-id"], + help="Virtual network subnet resource id", + required=True, + ) + network_interface_configuration.vnet_id = AAZResourceIdArg( + options=["vnet-id"], + help="Virtual network resource id", + required=True, + ) + network_interface_configuration.vnet_resource_guid = AAZStrArg( + options=["vnet-resource-guid"], + help="Virtual network resource guid", + ) + + serverless_runtime_tags = cls._args_schema.serverless_runtime_tags + serverless_runtime_tags.Element = AAZObjectArg() + + _element = cls._args_schema.serverless_runtime_tags.Element + _element.name = AAZStrArg( + options=["name"], + help="The name (also known as the key) of the tag.", + ) + _element.value = AAZStrArg( + options=["value"], + help="The value of the tag.", + ) + + serverless_runtime_user_context_properties = cls._args_schema.serverless_runtime_user_context_properties + serverless_runtime_user_context_properties.user_context_token = AAZStrArg( + options=["user-context-token"], + help="User context token for OBO flow.", + required=True, + ) + return cls._args_schema + + _args_cdi_config_props_create = None + + @classmethod + def _build_args_cdi_config_props_create(cls, _schema): + if cls._args_cdi_config_props_create is not None: + _schema.application_configs = cls._args_cdi_config_props_create.application_configs + _schema.engine_name = cls._args_cdi_config_props_create.engine_name + _schema.engine_version = cls._args_cdi_config_props_create.engine_version + return + + cls._args_cdi_config_props_create = AAZObjectArg() + + cdi_config_props_create = cls._args_cdi_config_props_create + cdi_config_props_create.application_configs = AAZListArg( + options=["application-configs"], + help="ApplicationConfigs of the CDI or CDIE.", + required=True, + ) + cdi_config_props_create.engine_name = AAZStrArg( + options=["engine-name"], + help="EngineName of the application config.", + required=True, + ) + cdi_config_props_create.engine_version = AAZStrArg( + options=["engine-version"], + help="EngineVersion of the application config.", + required=True, + ) + + application_configs = cls._args_cdi_config_props_create.application_configs + application_configs.Element = AAZObjectArg() + + _element = cls._args_cdi_config_props_create.application_configs.Element + _element.customized = AAZStrArg( + options=["customized"], + help="Customized value of the application config.", + required=True, + ) + _element.default_value = AAZStrArg( + options=["default-value"], + help="Default value of the application config.", + required=True, + ) + _element.name = AAZStrArg( + options=["name"], + help="Name of the application config.", + required=True, + ) + _element.platform = AAZStrArg( + options=["platform"], + help="Platform type of the application config.", + required=True, + ) + _element.type = AAZStrArg( + options=["type"], + help="Type of the application config.", + required=True, + ) + _element.value = AAZStrArg( + options=["value"], + help="Value of the application config.", + required=True, + ) + + _schema.application_configs = cls._args_cdi_config_props_create.application_configs + _schema.engine_name = cls._args_cdi_config_props_create.engine_name + _schema.engine_version = cls._args_cdi_config_props_create.engine_version + + def _execute_operations(self): + self.pre_operations() + yield self.ServerlessRuntimesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ServerlessRuntimesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/serverlessRuntimes/{serverlessRuntimeName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serverlessRuntimeName", self.ctx.args.serverless_runtime_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("advancedCustomProperties", AAZListType, ".advanced_custom_properties") + properties.set_prop("applicationType", AAZStrType, ".application_type") + properties.set_prop("computeUnits", AAZStrType, ".compute_units") + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("executionTimeout", AAZStrType, ".execution_timeout") + properties.set_prop("platform", AAZStrType, ".platform") + properties.set_prop("serverlessAccountLocation", AAZStrType, ".serverless_account_location", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("serverlessRuntimeConfig", AAZObjectType, ".serverless_runtime_config") + properties.set_prop("serverlessRuntimeNetworkProfile", AAZObjectType, ".serverless_runtime_network_profile") + properties.set_prop("serverlessRuntimeTags", AAZListType, ".serverless_runtime_tags") + properties.set_prop("serverlessRuntimeUserContextProperties", AAZObjectType, ".serverless_runtime_user_context_properties") + properties.set_prop("supplementaryFileLocation", AAZStrType, ".supplementary_file_location") + + advanced_custom_properties = _builder.get(".properties.advancedCustomProperties") + if advanced_custom_properties is not None: + advanced_custom_properties.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.advancedCustomProperties[]") + if _elements is not None: + _elements.set_prop("key", AAZStrType, ".key") + _elements.set_prop("value", AAZStrType, ".value") + + serverless_runtime_config = _builder.get(".properties.serverlessRuntimeConfig") + if serverless_runtime_config is not None: + serverless_runtime_config.set_prop("cdiConfigProps", AAZListType, ".cdi_config_props") + serverless_runtime_config.set_prop("cdieConfigProps", AAZListType, ".cdie_config_props") + + cdi_config_props = _builder.get(".properties.serverlessRuntimeConfig.cdiConfigProps") + if cdi_config_props is not None: + _CreateHelper._build_schema_cdi_config_props_create(cdi_config_props.set_elements(AAZObjectType, ".")) + + cdie_config_props = _builder.get(".properties.serverlessRuntimeConfig.cdieConfigProps") + if cdie_config_props is not None: + _CreateHelper._build_schema_cdi_config_props_create(cdie_config_props.set_elements(AAZObjectType, ".")) + + serverless_runtime_network_profile = _builder.get(".properties.serverlessRuntimeNetworkProfile") + if serverless_runtime_network_profile is not None: + serverless_runtime_network_profile.set_prop("networkInterfaceConfiguration", AAZObjectType, ".network_interface_configuration", typ_kwargs={"flags": {"required": True}}) + + network_interface_configuration = _builder.get(".properties.serverlessRuntimeNetworkProfile.networkInterfaceConfiguration") + if network_interface_configuration is not None: + network_interface_configuration.set_prop("subnetId", AAZStrType, ".subnet_id", typ_kwargs={"flags": {"required": True}}) + network_interface_configuration.set_prop("vnetId", AAZStrType, ".vnet_id", typ_kwargs={"flags": {"required": True}}) + network_interface_configuration.set_prop("vnetResourceGuid", AAZStrType, ".vnet_resource_guid") + + serverless_runtime_tags = _builder.get(".properties.serverlessRuntimeTags") + if serverless_runtime_tags is not None: + serverless_runtime_tags.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.serverlessRuntimeTags[]") + if _elements is not None: + _elements.set_prop("name", AAZStrType, ".name") + _elements.set_prop("value", AAZStrType, ".value") + + serverless_runtime_user_context_properties = _builder.get(".properties.serverlessRuntimeUserContextProperties") + if serverless_runtime_user_context_properties is not None: + serverless_runtime_user_context_properties.set_prop("userContextToken", AAZStrType, ".user_context_token", typ_kwargs={"flags": {"required": True}}) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.advanced_custom_properties = AAZListType( + serialized_name="advancedCustomProperties", + ) + properties.application_type = AAZStrType( + serialized_name="applicationType", + ) + properties.compute_units = AAZStrType( + serialized_name="computeUnits", + ) + properties.description = AAZStrType() + properties.execution_timeout = AAZStrType( + serialized_name="executionTimeout", + ) + properties.platform = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.serverless_account_location = AAZStrType( + serialized_name="serverlessAccountLocation", + flags={"required": True}, + ) + properties.serverless_runtime_config = AAZObjectType( + serialized_name="serverlessRuntimeConfig", + ) + properties.serverless_runtime_network_profile = AAZObjectType( + serialized_name="serverlessRuntimeNetworkProfile", + ) + properties.serverless_runtime_tags = AAZListType( + serialized_name="serverlessRuntimeTags", + ) + properties.serverless_runtime_user_context_properties = AAZObjectType( + serialized_name="serverlessRuntimeUserContextProperties", + ) + properties.supplementary_file_location = AAZStrType( + serialized_name="supplementaryFileLocation", + ) + + advanced_custom_properties = cls._schema_on_200_201.properties.advanced_custom_properties + advanced_custom_properties.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.advanced_custom_properties.Element + _element.key = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_config = cls._schema_on_200_201.properties.serverless_runtime_config + serverless_runtime_config.cdi_config_props = AAZListType( + serialized_name="cdiConfigProps", + ) + serverless_runtime_config.cdie_config_props = AAZListType( + serialized_name="cdieConfigProps", + ) + + cdi_config_props = cls._schema_on_200_201.properties.serverless_runtime_config.cdi_config_props + cdi_config_props.Element = AAZObjectType() + _CreateHelper._build_schema_cdi_config_props_read(cdi_config_props.Element) + + cdie_config_props = cls._schema_on_200_201.properties.serverless_runtime_config.cdie_config_props + cdie_config_props.Element = AAZObjectType() + _CreateHelper._build_schema_cdi_config_props_read(cdie_config_props.Element) + + serverless_runtime_network_profile = cls._schema_on_200_201.properties.serverless_runtime_network_profile + serverless_runtime_network_profile.network_interface_configuration = AAZObjectType( + serialized_name="networkInterfaceConfiguration", + flags={"required": True}, + ) + + network_interface_configuration = cls._schema_on_200_201.properties.serverless_runtime_network_profile.network_interface_configuration + network_interface_configuration.subnet_id = AAZStrType( + serialized_name="subnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_id = AAZStrType( + serialized_name="vnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_resource_guid = AAZStrType( + serialized_name="vnetResourceGuid", + ) + + serverless_runtime_tags = cls._schema_on_200_201.properties.serverless_runtime_tags + serverless_runtime_tags.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.serverless_runtime_tags.Element + _element.name = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_user_context_properties = cls._schema_on_200_201.properties.serverless_runtime_user_context_properties + serverless_runtime_user_context_properties.user_context_token = AAZStrType( + serialized_name="userContextToken", + flags={"required": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + @classmethod + def _build_schema_cdi_config_props_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("applicationConfigs", AAZListType, ".application_configs", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("engineName", AAZStrType, ".engine_name", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("engineVersion", AAZStrType, ".engine_version", typ_kwargs={"flags": {"required": True}}) + + application_configs = _builder.get(".applicationConfigs") + if application_configs is not None: + application_configs.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".applicationConfigs[]") + if _elements is not None: + _elements.set_prop("customized", AAZStrType, ".customized", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("defaultValue", AAZStrType, ".default_value", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("platform", AAZStrType, ".platform", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) + + _schema_cdi_config_props_read = None + + @classmethod + def _build_schema_cdi_config_props_read(cls, _schema): + if cls._schema_cdi_config_props_read is not None: + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + return + + cls._schema_cdi_config_props_read = _schema_cdi_config_props_read = AAZObjectType() + + cdi_config_props_read = _schema_cdi_config_props_read + cdi_config_props_read.application_configs = AAZListType( + serialized_name="applicationConfigs", + flags={"required": True}, + ) + cdi_config_props_read.engine_name = AAZStrType( + serialized_name="engineName", + flags={"required": True}, + ) + cdi_config_props_read.engine_version = AAZStrType( + serialized_name="engineVersion", + flags={"required": True}, + ) + + application_configs = _schema_cdi_config_props_read.application_configs + application_configs.Element = AAZObjectType() + + _element = _schema_cdi_config_props_read.application_configs.Element + _element.customized = AAZStrType( + flags={"required": True}, + ) + _element.default_value = AAZStrType( + serialized_name="defaultValue", + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"required": True}, + ) + _element.platform = AAZStrType( + flags={"required": True}, + ) + _element.type = AAZStrType( + flags={"required": True}, + ) + _element.value = AAZStrType( + flags={"required": True}, + ) + + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + + +__all__ = ["Create"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_delete.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_delete.py new file mode 100644 index 0000000000..ce1473ee62 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_delete.py @@ -0,0 +1,176 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization serverless-runtime delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a InformaticaServerlessRuntimeResource + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}/serverlessruntimes/{}", "2024-05-08"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.serverless_runtime_name = AAZStrArg( + options=["-n", "--name", "--serverless-runtime-name"], + help="Name of the Serverless Runtime resource", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.ServerlessRuntimesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ServerlessRuntimesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/serverlessRuntimes/{serverlessRuntimeName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serverlessRuntimeName", self.ctx.args.serverless_runtime_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + def on_204(self, session): + pass + + def on_200_201(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_list.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_list.py new file mode 100644 index 0000000000..2edf0ee70d --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_list.py @@ -0,0 +1,360 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization serverless-runtime list", +) +class List(AAZCommand): + """List InformaticaServerlessRuntimeResource resources by InformaticaOrganizationResource + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}/serverlessruntimes", "2024-05-08"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["--organization-name"], + help="Name of the Organizations resource", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ServerlessRuntimesListByInformaticaOrganizationResource(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class ServerlessRuntimesListByInformaticaOrganizationResource(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/serverlessRuntimes", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.advanced_custom_properties = AAZListType( + serialized_name="advancedCustomProperties", + ) + properties.application_type = AAZStrType( + serialized_name="applicationType", + ) + properties.compute_units = AAZStrType( + serialized_name="computeUnits", + ) + properties.description = AAZStrType() + properties.execution_timeout = AAZStrType( + serialized_name="executionTimeout", + ) + properties.platform = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.serverless_account_location = AAZStrType( + serialized_name="serverlessAccountLocation", + flags={"required": True}, + ) + properties.serverless_runtime_config = AAZObjectType( + serialized_name="serverlessRuntimeConfig", + ) + properties.serverless_runtime_network_profile = AAZObjectType( + serialized_name="serverlessRuntimeNetworkProfile", + ) + properties.serverless_runtime_tags = AAZListType( + serialized_name="serverlessRuntimeTags", + ) + properties.serverless_runtime_user_context_properties = AAZObjectType( + serialized_name="serverlessRuntimeUserContextProperties", + ) + properties.supplementary_file_location = AAZStrType( + serialized_name="supplementaryFileLocation", + ) + + advanced_custom_properties = cls._schema_on_200.value.Element.properties.advanced_custom_properties + advanced_custom_properties.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.advanced_custom_properties.Element + _element.key = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_config = cls._schema_on_200.value.Element.properties.serverless_runtime_config + serverless_runtime_config.cdi_config_props = AAZListType( + serialized_name="cdiConfigProps", + ) + serverless_runtime_config.cdie_config_props = AAZListType( + serialized_name="cdieConfigProps", + ) + + cdi_config_props = cls._schema_on_200.value.Element.properties.serverless_runtime_config.cdi_config_props + cdi_config_props.Element = AAZObjectType() + _ListHelper._build_schema_cdi_config_props_read(cdi_config_props.Element) + + cdie_config_props = cls._schema_on_200.value.Element.properties.serverless_runtime_config.cdie_config_props + cdie_config_props.Element = AAZObjectType() + _ListHelper._build_schema_cdi_config_props_read(cdie_config_props.Element) + + serverless_runtime_network_profile = cls._schema_on_200.value.Element.properties.serverless_runtime_network_profile + serverless_runtime_network_profile.network_interface_configuration = AAZObjectType( + serialized_name="networkInterfaceConfiguration", + flags={"required": True}, + ) + + network_interface_configuration = cls._schema_on_200.value.Element.properties.serverless_runtime_network_profile.network_interface_configuration + network_interface_configuration.subnet_id = AAZStrType( + serialized_name="subnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_id = AAZStrType( + serialized_name="vnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_resource_guid = AAZStrType( + serialized_name="vnetResourceGuid", + ) + + serverless_runtime_tags = cls._schema_on_200.value.Element.properties.serverless_runtime_tags + serverless_runtime_tags.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.serverless_runtime_tags.Element + _element.name = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_user_context_properties = cls._schema_on_200.value.Element.properties.serverless_runtime_user_context_properties + serverless_runtime_user_context_properties.user_context_token = AAZStrType( + serialized_name="userContextToken", + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_cdi_config_props_read = None + + @classmethod + def _build_schema_cdi_config_props_read(cls, _schema): + if cls._schema_cdi_config_props_read is not None: + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + return + + cls._schema_cdi_config_props_read = _schema_cdi_config_props_read = AAZObjectType() + + cdi_config_props_read = _schema_cdi_config_props_read + cdi_config_props_read.application_configs = AAZListType( + serialized_name="applicationConfigs", + flags={"required": True}, + ) + cdi_config_props_read.engine_name = AAZStrType( + serialized_name="engineName", + flags={"required": True}, + ) + cdi_config_props_read.engine_version = AAZStrType( + serialized_name="engineVersion", + flags={"required": True}, + ) + + application_configs = _schema_cdi_config_props_read.application_configs + application_configs.Element = AAZObjectType() + + _element = _schema_cdi_config_props_read.application_configs.Element + _element.customized = AAZStrType( + flags={"required": True}, + ) + _element.default_value = AAZStrType( + serialized_name="defaultValue", + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"required": True}, + ) + _element.platform = AAZStrType( + flags={"required": True}, + ) + _element.type = AAZStrType( + flags={"required": True}, + ) + _element.value = AAZStrType( + flags={"required": True}, + ) + + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + + +__all__ = ["List"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_show.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_show.py new file mode 100644 index 0000000000..ebcf9d9f25 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_show.py @@ -0,0 +1,361 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization serverless-runtime show", +) +class Show(AAZCommand): + """Get a InformaticaServerlessRuntimeResource + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}/serverlessruntimes/{}", "2024-05-08"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.serverless_runtime_name = AAZStrArg( + options=["-n", "--name", "--serverless-runtime-name"], + help="Name of the Serverless Runtime resource", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ServerlessRuntimesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ServerlessRuntimesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/serverlessRuntimes/{serverlessRuntimeName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serverlessRuntimeName", self.ctx.args.serverless_runtime_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.advanced_custom_properties = AAZListType( + serialized_name="advancedCustomProperties", + ) + properties.application_type = AAZStrType( + serialized_name="applicationType", + ) + properties.compute_units = AAZStrType( + serialized_name="computeUnits", + ) + properties.description = AAZStrType() + properties.execution_timeout = AAZStrType( + serialized_name="executionTimeout", + ) + properties.platform = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.serverless_account_location = AAZStrType( + serialized_name="serverlessAccountLocation", + flags={"required": True}, + ) + properties.serverless_runtime_config = AAZObjectType( + serialized_name="serverlessRuntimeConfig", + ) + properties.serverless_runtime_network_profile = AAZObjectType( + serialized_name="serverlessRuntimeNetworkProfile", + ) + properties.serverless_runtime_tags = AAZListType( + serialized_name="serverlessRuntimeTags", + ) + properties.serverless_runtime_user_context_properties = AAZObjectType( + serialized_name="serverlessRuntimeUserContextProperties", + ) + properties.supplementary_file_location = AAZStrType( + serialized_name="supplementaryFileLocation", + ) + + advanced_custom_properties = cls._schema_on_200.properties.advanced_custom_properties + advanced_custom_properties.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.advanced_custom_properties.Element + _element.key = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_config = cls._schema_on_200.properties.serverless_runtime_config + serverless_runtime_config.cdi_config_props = AAZListType( + serialized_name="cdiConfigProps", + ) + serverless_runtime_config.cdie_config_props = AAZListType( + serialized_name="cdieConfigProps", + ) + + cdi_config_props = cls._schema_on_200.properties.serverless_runtime_config.cdi_config_props + cdi_config_props.Element = AAZObjectType() + _ShowHelper._build_schema_cdi_config_props_read(cdi_config_props.Element) + + cdie_config_props = cls._schema_on_200.properties.serverless_runtime_config.cdie_config_props + cdie_config_props.Element = AAZObjectType() + _ShowHelper._build_schema_cdi_config_props_read(cdie_config_props.Element) + + serverless_runtime_network_profile = cls._schema_on_200.properties.serverless_runtime_network_profile + serverless_runtime_network_profile.network_interface_configuration = AAZObjectType( + serialized_name="networkInterfaceConfiguration", + flags={"required": True}, + ) + + network_interface_configuration = cls._schema_on_200.properties.serverless_runtime_network_profile.network_interface_configuration + network_interface_configuration.subnet_id = AAZStrType( + serialized_name="subnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_id = AAZStrType( + serialized_name="vnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_resource_guid = AAZStrType( + serialized_name="vnetResourceGuid", + ) + + serverless_runtime_tags = cls._schema_on_200.properties.serverless_runtime_tags + serverless_runtime_tags.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.serverless_runtime_tags.Element + _element.name = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_user_context_properties = cls._schema_on_200.properties.serverless_runtime_user_context_properties + serverless_runtime_user_context_properties.user_context_token = AAZStrType( + serialized_name="userContextToken", + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_cdi_config_props_read = None + + @classmethod + def _build_schema_cdi_config_props_read(cls, _schema): + if cls._schema_cdi_config_props_read is not None: + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + return + + cls._schema_cdi_config_props_read = _schema_cdi_config_props_read = AAZObjectType() + + cdi_config_props_read = _schema_cdi_config_props_read + cdi_config_props_read.application_configs = AAZListType( + serialized_name="applicationConfigs", + flags={"required": True}, + ) + cdi_config_props_read.engine_name = AAZStrType( + serialized_name="engineName", + flags={"required": True}, + ) + cdi_config_props_read.engine_version = AAZStrType( + serialized_name="engineVersion", + flags={"required": True}, + ) + + application_configs = _schema_cdi_config_props_read.application_configs + application_configs.Element = AAZObjectType() + + _element = _schema_cdi_config_props_read.application_configs.Element + _element.customized = AAZStrType( + flags={"required": True}, + ) + _element.default_value = AAZStrType( + serialized_name="defaultValue", + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"required": True}, + ) + _element.platform = AAZStrType( + flags={"required": True}, + ) + _element.type = AAZStrType( + flags={"required": True}, + ) + _element.value = AAZStrType( + flags={"required": True}, + ) + + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + + +__all__ = ["Show"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_start_failed_serverless_runtime.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_start_failed_serverless_runtime.py new file mode 100644 index 0000000000..9851ef90fd --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_start_failed_serverless_runtime.py @@ -0,0 +1,146 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization serverless-runtime start-failed-serverless-runtime", +) +class StartFailedServerlessRuntime(AAZCommand): + """Starts a failed runtime resource + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}/serverlessruntimes/{}/startfailedserverlessruntime", "2024-05-08"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.serverless_runtime_name = AAZStrArg( + options=["--serverless-runtime-name"], + help="Name of the Serverless Runtime resource", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ServerlessRuntimesStartFailedServerlessRuntime(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ServerlessRuntimesStartFailedServerlessRuntime(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/serverlessRuntimes/{serverlessRuntimeName}/startFailedServerlessRuntime", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serverlessRuntimeName", self.ctx.args.serverless_runtime_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + def on_204(self, session): + pass + + +class _StartFailedServerlessRuntimeHelper: + """Helper class for StartFailedServerlessRuntime""" + + +__all__ = ["StartFailedServerlessRuntime"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_update.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_update.py new file mode 100644 index 0000000000..70c4882695 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_update.py @@ -0,0 +1,842 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization serverless-runtime update", +) +class Update(AAZCommand): + """Update a InformaticaServerlessRuntimeResource + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}/serverlessruntimes/{}", "2024-05-08"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.serverless_runtime_name = AAZStrArg( + options=["-n", "--name", "--serverless-runtime-name"], + help="Name of the Serverless Runtime resource", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.advanced_custom_properties = AAZListArg( + options=["--advanced-custom-properties"], + arg_group="Properties", + help="String KV pairs indicating Advanced custom properties.", + nullable=True, + ) + _args_schema.application_type = AAZStrArg( + options=["--application-type"], + arg_group="Properties", + help="Application type of the Serverless Runtime environment.", + nullable=True, + enum={"CDI": "CDI", "CDIE": "CDIE"}, + ) + _args_schema.compute_units = AAZStrArg( + options=["--compute-units"], + arg_group="Properties", + help="Compute units of the serverless runtime.", + nullable=True, + ) + _args_schema.description = AAZStrArg( + options=["--description"], + arg_group="Properties", + help="description of the serverless runtime.", + nullable=True, + ) + _args_schema.execution_timeout = AAZStrArg( + options=["--execution-timeout"], + arg_group="Properties", + help="Serverless Execution timeout", + nullable=True, + ) + _args_schema.platform = AAZStrArg( + options=["--platform"], + arg_group="Properties", + help="Platform type of the Serverless Runtime.", + nullable=True, + enum={"AZURE": "AZURE"}, + ) + _args_schema.serverless_account_location = AAZStrArg( + options=["--serverless-account-location"], + arg_group="Properties", + help="Serverless account creation location", + ) + _args_schema.serverless_runtime_config = AAZObjectArg( + options=["--serverless-runtime-config"], + arg_group="Properties", + help="Serverless config properties", + nullable=True, + ) + _args_schema.serverless_runtime_network_profile = AAZObjectArg( + options=["--serverless-runtime-network-profile"], + arg_group="Properties", + help="Informatica Serverless Network profile properties.", + nullable=True, + ) + _args_schema.serverless_runtime_tags = AAZListArg( + options=["--serverless-runtime-tags"], + arg_group="Properties", + help="Serverless Runtime Tags", + nullable=True, + ) + _args_schema.serverless_runtime_user_context_properties = AAZObjectArg( + options=["--serverless-runtime-user-context-properties"], + arg_group="Properties", + help="Serverless runtime user context properties", + nullable=True, + ) + _args_schema.supplementary_file_location = AAZStrArg( + options=["--supplementary-file-location"], + arg_group="Properties", + help="Supplementary file location.", + nullable=True, + ) + + advanced_custom_properties = cls._args_schema.advanced_custom_properties + advanced_custom_properties.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.advanced_custom_properties.Element + _element.key = AAZStrArg( + options=["key"], + help="advanced custom properties key", + nullable=True, + ) + _element.value = AAZStrArg( + options=["value"], + help="advanced custom properties value", + nullable=True, + ) + + serverless_runtime_config = cls._args_schema.serverless_runtime_config + serverless_runtime_config.cdi_config_props = AAZListArg( + options=["cdi-config-props"], + help="The List of Informatica Serverless Runtime CDI Config Properties.", + nullable=True, + ) + serverless_runtime_config.cdie_config_props = AAZListArg( + options=["cdie-config-props"], + help="The List of Informatica Serverless Runtime CDIE Config Properties.", + nullable=True, + ) + + cdi_config_props = cls._args_schema.serverless_runtime_config.cdi_config_props + cdi_config_props.Element = AAZObjectArg( + nullable=True, + ) + cls._build_args_cdi_config_props_update(cdi_config_props.Element) + + cdie_config_props = cls._args_schema.serverless_runtime_config.cdie_config_props + cdie_config_props.Element = AAZObjectArg( + nullable=True, + ) + cls._build_args_cdi_config_props_update(cdie_config_props.Element) + + serverless_runtime_network_profile = cls._args_schema.serverless_runtime_network_profile + serverless_runtime_network_profile.network_interface_configuration = AAZObjectArg( + options=["network-interface-configuration"], + help="Network Interface Configuration Profile", + ) + + network_interface_configuration = cls._args_schema.serverless_runtime_network_profile.network_interface_configuration + network_interface_configuration.subnet_id = AAZResourceIdArg( + options=["subnet-id"], + help="Virtual network subnet resource id", + ) + network_interface_configuration.vnet_id = AAZResourceIdArg( + options=["vnet-id"], + help="Virtual network resource id", + ) + network_interface_configuration.vnet_resource_guid = AAZStrArg( + options=["vnet-resource-guid"], + help="Virtual network resource guid", + nullable=True, + ) + + serverless_runtime_tags = cls._args_schema.serverless_runtime_tags + serverless_runtime_tags.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.serverless_runtime_tags.Element + _element.name = AAZStrArg( + options=["name"], + help="The name (also known as the key) of the tag.", + nullable=True, + ) + _element.value = AAZStrArg( + options=["value"], + help="The value of the tag.", + nullable=True, + ) + + serverless_runtime_user_context_properties = cls._args_schema.serverless_runtime_user_context_properties + serverless_runtime_user_context_properties.user_context_token = AAZStrArg( + options=["user-context-token"], + help="User context token for OBO flow.", + ) + return cls._args_schema + + _args_cdi_config_props_update = None + + @classmethod + def _build_args_cdi_config_props_update(cls, _schema): + if cls._args_cdi_config_props_update is not None: + _schema.application_configs = cls._args_cdi_config_props_update.application_configs + _schema.engine_name = cls._args_cdi_config_props_update.engine_name + _schema.engine_version = cls._args_cdi_config_props_update.engine_version + return + + cls._args_cdi_config_props_update = AAZObjectArg( + nullable=True, + ) + + cdi_config_props_update = cls._args_cdi_config_props_update + cdi_config_props_update.application_configs = AAZListArg( + options=["application-configs"], + help="ApplicationConfigs of the CDI or CDIE.", + ) + cdi_config_props_update.engine_name = AAZStrArg( + options=["engine-name"], + help="EngineName of the application config.", + ) + cdi_config_props_update.engine_version = AAZStrArg( + options=["engine-version"], + help="EngineVersion of the application config.", + ) + + application_configs = cls._args_cdi_config_props_update.application_configs + application_configs.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_cdi_config_props_update.application_configs.Element + _element.customized = AAZStrArg( + options=["customized"], + help="Customized value of the application config.", + ) + _element.default_value = AAZStrArg( + options=["default-value"], + help="Default value of the application config.", + ) + _element.name = AAZStrArg( + options=["name"], + help="Name of the application config.", + ) + _element.platform = AAZStrArg( + options=["platform"], + help="Platform type of the application config.", + ) + _element.type = AAZStrArg( + options=["type"], + help="Type of the application config.", + ) + _element.value = AAZStrArg( + options=["value"], + help="Value of the application config.", + ) + + _schema.application_configs = cls._args_cdi_config_props_update.application_configs + _schema.engine_name = cls._args_cdi_config_props_update.engine_name + _schema.engine_version = cls._args_cdi_config_props_update.engine_version + + def _execute_operations(self): + self.pre_operations() + self.ServerlessRuntimesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.ServerlessRuntimesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ServerlessRuntimesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/serverlessRuntimes/{serverlessRuntimeName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serverlessRuntimeName", self.ctx.args.serverless_runtime_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_informatica_serverless_runtime_resource_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ServerlessRuntimesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/serverlessRuntimes/{serverlessRuntimeName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serverlessRuntimeName", self.ctx.args.serverless_runtime_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_informatica_serverless_runtime_resource_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("advancedCustomProperties", AAZListType, ".advanced_custom_properties") + properties.set_prop("applicationType", AAZStrType, ".application_type") + properties.set_prop("computeUnits", AAZStrType, ".compute_units") + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("executionTimeout", AAZStrType, ".execution_timeout") + properties.set_prop("platform", AAZStrType, ".platform") + properties.set_prop("serverlessAccountLocation", AAZStrType, ".serverless_account_location", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("serverlessRuntimeConfig", AAZObjectType, ".serverless_runtime_config") + properties.set_prop("serverlessRuntimeNetworkProfile", AAZObjectType, ".serverless_runtime_network_profile") + properties.set_prop("serverlessRuntimeTags", AAZListType, ".serverless_runtime_tags") + properties.set_prop("serverlessRuntimeUserContextProperties", AAZObjectType, ".serverless_runtime_user_context_properties") + properties.set_prop("supplementaryFileLocation", AAZStrType, ".supplementary_file_location") + + advanced_custom_properties = _builder.get(".properties.advancedCustomProperties") + if advanced_custom_properties is not None: + advanced_custom_properties.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.advancedCustomProperties[]") + if _elements is not None: + _elements.set_prop("key", AAZStrType, ".key") + _elements.set_prop("value", AAZStrType, ".value") + + serverless_runtime_config = _builder.get(".properties.serverlessRuntimeConfig") + if serverless_runtime_config is not None: + serverless_runtime_config.set_prop("cdiConfigProps", AAZListType, ".cdi_config_props") + serverless_runtime_config.set_prop("cdieConfigProps", AAZListType, ".cdie_config_props") + + cdi_config_props = _builder.get(".properties.serverlessRuntimeConfig.cdiConfigProps") + if cdi_config_props is not None: + _UpdateHelper._build_schema_cdi_config_props_update(cdi_config_props.set_elements(AAZObjectType, ".")) + + cdie_config_props = _builder.get(".properties.serverlessRuntimeConfig.cdieConfigProps") + if cdie_config_props is not None: + _UpdateHelper._build_schema_cdi_config_props_update(cdie_config_props.set_elements(AAZObjectType, ".")) + + serverless_runtime_network_profile = _builder.get(".properties.serverlessRuntimeNetworkProfile") + if serverless_runtime_network_profile is not None: + serverless_runtime_network_profile.set_prop("networkInterfaceConfiguration", AAZObjectType, ".network_interface_configuration", typ_kwargs={"flags": {"required": True}}) + + network_interface_configuration = _builder.get(".properties.serverlessRuntimeNetworkProfile.networkInterfaceConfiguration") + if network_interface_configuration is not None: + network_interface_configuration.set_prop("subnetId", AAZStrType, ".subnet_id", typ_kwargs={"flags": {"required": True}}) + network_interface_configuration.set_prop("vnetId", AAZStrType, ".vnet_id", typ_kwargs={"flags": {"required": True}}) + network_interface_configuration.set_prop("vnetResourceGuid", AAZStrType, ".vnet_resource_guid") + + serverless_runtime_tags = _builder.get(".properties.serverlessRuntimeTags") + if serverless_runtime_tags is not None: + serverless_runtime_tags.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.serverlessRuntimeTags[]") + if _elements is not None: + _elements.set_prop("name", AAZStrType, ".name") + _elements.set_prop("value", AAZStrType, ".value") + + serverless_runtime_user_context_properties = _builder.get(".properties.serverlessRuntimeUserContextProperties") + if serverless_runtime_user_context_properties is not None: + serverless_runtime_user_context_properties.set_prop("userContextToken", AAZStrType, ".user_context_token", typ_kwargs={"flags": {"required": True}}) + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + @classmethod + def _build_schema_cdi_config_props_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("applicationConfigs", AAZListType, ".application_configs", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("engineName", AAZStrType, ".engine_name", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("engineVersion", AAZStrType, ".engine_version", typ_kwargs={"flags": {"required": True}}) + + application_configs = _builder.get(".applicationConfigs") + if application_configs is not None: + application_configs.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".applicationConfigs[]") + if _elements is not None: + _elements.set_prop("customized", AAZStrType, ".customized", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("defaultValue", AAZStrType, ".default_value", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("platform", AAZStrType, ".platform", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) + + _schema_cdi_config_props_read = None + + @classmethod + def _build_schema_cdi_config_props_read(cls, _schema): + if cls._schema_cdi_config_props_read is not None: + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + return + + cls._schema_cdi_config_props_read = _schema_cdi_config_props_read = AAZObjectType() + + cdi_config_props_read = _schema_cdi_config_props_read + cdi_config_props_read.application_configs = AAZListType( + serialized_name="applicationConfigs", + flags={"required": True}, + ) + cdi_config_props_read.engine_name = AAZStrType( + serialized_name="engineName", + flags={"required": True}, + ) + cdi_config_props_read.engine_version = AAZStrType( + serialized_name="engineVersion", + flags={"required": True}, + ) + + application_configs = _schema_cdi_config_props_read.application_configs + application_configs.Element = AAZObjectType() + + _element = _schema_cdi_config_props_read.application_configs.Element + _element.customized = AAZStrType( + flags={"required": True}, + ) + _element.default_value = AAZStrType( + serialized_name="defaultValue", + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"required": True}, + ) + _element.platform = AAZStrType( + flags={"required": True}, + ) + _element.type = AAZStrType( + flags={"required": True}, + ) + _element.value = AAZStrType( + flags={"required": True}, + ) + + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + + _schema_informatica_serverless_runtime_resource_read = None + + @classmethod + def _build_schema_informatica_serverless_runtime_resource_read(cls, _schema): + if cls._schema_informatica_serverless_runtime_resource_read is not None: + _schema.id = cls._schema_informatica_serverless_runtime_resource_read.id + _schema.name = cls._schema_informatica_serverless_runtime_resource_read.name + _schema.properties = cls._schema_informatica_serverless_runtime_resource_read.properties + _schema.system_data = cls._schema_informatica_serverless_runtime_resource_read.system_data + _schema.type = cls._schema_informatica_serverless_runtime_resource_read.type + return + + cls._schema_informatica_serverless_runtime_resource_read = _schema_informatica_serverless_runtime_resource_read = AAZObjectType() + + informatica_serverless_runtime_resource_read = _schema_informatica_serverless_runtime_resource_read + informatica_serverless_runtime_resource_read.id = AAZStrType( + flags={"read_only": True}, + ) + informatica_serverless_runtime_resource_read.name = AAZStrType( + flags={"read_only": True}, + ) + informatica_serverless_runtime_resource_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + informatica_serverless_runtime_resource_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + informatica_serverless_runtime_resource_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_informatica_serverless_runtime_resource_read.properties + properties.advanced_custom_properties = AAZListType( + serialized_name="advancedCustomProperties", + ) + properties.application_type = AAZStrType( + serialized_name="applicationType", + ) + properties.compute_units = AAZStrType( + serialized_name="computeUnits", + ) + properties.description = AAZStrType() + properties.execution_timeout = AAZStrType( + serialized_name="executionTimeout", + ) + properties.platform = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.serverless_account_location = AAZStrType( + serialized_name="serverlessAccountLocation", + flags={"required": True}, + ) + properties.serverless_runtime_config = AAZObjectType( + serialized_name="serverlessRuntimeConfig", + ) + properties.serverless_runtime_network_profile = AAZObjectType( + serialized_name="serverlessRuntimeNetworkProfile", + ) + properties.serverless_runtime_tags = AAZListType( + serialized_name="serverlessRuntimeTags", + ) + properties.serverless_runtime_user_context_properties = AAZObjectType( + serialized_name="serverlessRuntimeUserContextProperties", + ) + properties.supplementary_file_location = AAZStrType( + serialized_name="supplementaryFileLocation", + ) + + advanced_custom_properties = _schema_informatica_serverless_runtime_resource_read.properties.advanced_custom_properties + advanced_custom_properties.Element = AAZObjectType() + + _element = _schema_informatica_serverless_runtime_resource_read.properties.advanced_custom_properties.Element + _element.key = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_config = _schema_informatica_serverless_runtime_resource_read.properties.serverless_runtime_config + serverless_runtime_config.cdi_config_props = AAZListType( + serialized_name="cdiConfigProps", + ) + serverless_runtime_config.cdie_config_props = AAZListType( + serialized_name="cdieConfigProps", + ) + + cdi_config_props = _schema_informatica_serverless_runtime_resource_read.properties.serverless_runtime_config.cdi_config_props + cdi_config_props.Element = AAZObjectType() + cls._build_schema_cdi_config_props_read(cdi_config_props.Element) + + cdie_config_props = _schema_informatica_serverless_runtime_resource_read.properties.serverless_runtime_config.cdie_config_props + cdie_config_props.Element = AAZObjectType() + cls._build_schema_cdi_config_props_read(cdie_config_props.Element) + + serverless_runtime_network_profile = _schema_informatica_serverless_runtime_resource_read.properties.serverless_runtime_network_profile + serverless_runtime_network_profile.network_interface_configuration = AAZObjectType( + serialized_name="networkInterfaceConfiguration", + flags={"required": True}, + ) + + network_interface_configuration = _schema_informatica_serverless_runtime_resource_read.properties.serverless_runtime_network_profile.network_interface_configuration + network_interface_configuration.subnet_id = AAZStrType( + serialized_name="subnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_id = AAZStrType( + serialized_name="vnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_resource_guid = AAZStrType( + serialized_name="vnetResourceGuid", + ) + + serverless_runtime_tags = _schema_informatica_serverless_runtime_resource_read.properties.serverless_runtime_tags + serverless_runtime_tags.Element = AAZObjectType() + + _element = _schema_informatica_serverless_runtime_resource_read.properties.serverless_runtime_tags.Element + _element.name = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_user_context_properties = _schema_informatica_serverless_runtime_resource_read.properties.serverless_runtime_user_context_properties + serverless_runtime_user_context_properties.user_context_token = AAZStrType( + serialized_name="userContextToken", + flags={"required": True}, + ) + + system_data = _schema_informatica_serverless_runtime_resource_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.id = cls._schema_informatica_serverless_runtime_resource_read.id + _schema.name = cls._schema_informatica_serverless_runtime_resource_read.name + _schema.properties = cls._schema_informatica_serverless_runtime_resource_read.properties + _schema.system_data = cls._schema_informatica_serverless_runtime_resource_read.system_data + _schema.type = cls._schema_informatica_serverless_runtime_resource_read.type + + +__all__ = ["Update"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_wait.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_wait.py new file mode 100644 index 0000000000..dbe7d96a7e --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/_wait.py @@ -0,0 +1,360 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization serverless-runtime wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}/serverlessruntimes/{}", "2024-05-08"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.serverless_runtime_name = AAZStrArg( + options=["-n", "--name", "--serverless-runtime-name"], + help="Name of the Serverless Runtime resource", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ServerlessRuntimesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class ServerlessRuntimesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/serverlessRuntimes/{serverlessRuntimeName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serverlessRuntimeName", self.ctx.args.serverless_runtime_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.advanced_custom_properties = AAZListType( + serialized_name="advancedCustomProperties", + ) + properties.application_type = AAZStrType( + serialized_name="applicationType", + ) + properties.compute_units = AAZStrType( + serialized_name="computeUnits", + ) + properties.description = AAZStrType() + properties.execution_timeout = AAZStrType( + serialized_name="executionTimeout", + ) + properties.platform = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.serverless_account_location = AAZStrType( + serialized_name="serverlessAccountLocation", + flags={"required": True}, + ) + properties.serverless_runtime_config = AAZObjectType( + serialized_name="serverlessRuntimeConfig", + ) + properties.serverless_runtime_network_profile = AAZObjectType( + serialized_name="serverlessRuntimeNetworkProfile", + ) + properties.serverless_runtime_tags = AAZListType( + serialized_name="serverlessRuntimeTags", + ) + properties.serverless_runtime_user_context_properties = AAZObjectType( + serialized_name="serverlessRuntimeUserContextProperties", + ) + properties.supplementary_file_location = AAZStrType( + serialized_name="supplementaryFileLocation", + ) + + advanced_custom_properties = cls._schema_on_200.properties.advanced_custom_properties + advanced_custom_properties.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.advanced_custom_properties.Element + _element.key = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_config = cls._schema_on_200.properties.serverless_runtime_config + serverless_runtime_config.cdi_config_props = AAZListType( + serialized_name="cdiConfigProps", + ) + serverless_runtime_config.cdie_config_props = AAZListType( + serialized_name="cdieConfigProps", + ) + + cdi_config_props = cls._schema_on_200.properties.serverless_runtime_config.cdi_config_props + cdi_config_props.Element = AAZObjectType() + _WaitHelper._build_schema_cdi_config_props_read(cdi_config_props.Element) + + cdie_config_props = cls._schema_on_200.properties.serverless_runtime_config.cdie_config_props + cdie_config_props.Element = AAZObjectType() + _WaitHelper._build_schema_cdi_config_props_read(cdie_config_props.Element) + + serverless_runtime_network_profile = cls._schema_on_200.properties.serverless_runtime_network_profile + serverless_runtime_network_profile.network_interface_configuration = AAZObjectType( + serialized_name="networkInterfaceConfiguration", + flags={"required": True}, + ) + + network_interface_configuration = cls._schema_on_200.properties.serverless_runtime_network_profile.network_interface_configuration + network_interface_configuration.subnet_id = AAZStrType( + serialized_name="subnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_id = AAZStrType( + serialized_name="vnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_resource_guid = AAZStrType( + serialized_name="vnetResourceGuid", + ) + + serverless_runtime_tags = cls._schema_on_200.properties.serverless_runtime_tags + serverless_runtime_tags.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.serverless_runtime_tags.Element + _element.name = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_user_context_properties = cls._schema_on_200.properties.serverless_runtime_user_context_properties + serverless_runtime_user_context_properties.user_context_token = AAZStrType( + serialized_name="userContextToken", + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + _schema_cdi_config_props_read = None + + @classmethod + def _build_schema_cdi_config_props_read(cls, _schema): + if cls._schema_cdi_config_props_read is not None: + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + return + + cls._schema_cdi_config_props_read = _schema_cdi_config_props_read = AAZObjectType() + + cdi_config_props_read = _schema_cdi_config_props_read + cdi_config_props_read.application_configs = AAZListType( + serialized_name="applicationConfigs", + flags={"required": True}, + ) + cdi_config_props_read.engine_name = AAZStrType( + serialized_name="engineName", + flags={"required": True}, + ) + cdi_config_props_read.engine_version = AAZStrType( + serialized_name="engineVersion", + flags={"required": True}, + ) + + application_configs = _schema_cdi_config_props_read.application_configs + application_configs.Element = AAZObjectType() + + _element = _schema_cdi_config_props_read.application_configs.Element + _element.customized = AAZStrType( + flags={"required": True}, + ) + _element.default_value = AAZStrType( + serialized_name="defaultValue", + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"required": True}, + ) + _element.platform = AAZStrType( + flags={"required": True}, + ) + _element.type = AAZStrType( + flags={"required": True}, + ) + _element.value = AAZStrType( + flags={"required": True}, + ) + + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + + +__all__ = ["Wait"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/serverless/__cmd_group.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/serverless/__cmd_group.py new file mode 100644 index 0000000000..e52ee89cac --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/serverless/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "informatica data-management organization serverless-runtime serverless", +) +class __CMDGroup(AAZCommandGroup): + """Manage Informatica serverless resource + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/serverless/__init__.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/serverless/__init__.py new file mode 100644 index 0000000000..fb5b4879a7 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/serverless/__init__.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._resource_by_id import * diff --git a/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/serverless/_resource_by_id.py b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/serverless/_resource_by_id.py new file mode 100644 index 0000000000..306e0aec01 --- /dev/null +++ b/src/Informatica/azext_informatica/aaz/latest/informatica/data_management/organization/serverless_runtime/serverless/_resource_by_id.py @@ -0,0 +1,361 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "informatica data-management organization serverless-runtime serverless resource-by-id", +) +class ResourceById(AAZCommand): + """Returns a serverless runtime resource by ID + """ + + _aaz_info = { + "version": "2024-05-08", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/informatica.datamanagement/organizations/{}/serverlessruntimes/{}/serverlessresourcebyid", "2024-05-08"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.organization_name = AAZStrArg( + options=["--organization-name"], + help="Name of the Organizations resource", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.serverless_runtime_name = AAZStrArg( + options=["--serverless-runtime-name"], + help="Name of the Serverless Runtime resource", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9_-]*$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ServerlessRuntimesServerlessResourceById(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ServerlessRuntimesServerlessResourceById(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Informatica.DataManagement/organizations/{organizationName}/serverlessRuntimes/{serverlessRuntimeName}/serverlessResourceById", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "organizationName", self.ctx.args.organization_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serverlessRuntimeName", self.ctx.args.serverless_runtime_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-05-08", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.advanced_custom_properties = AAZListType( + serialized_name="advancedCustomProperties", + ) + properties.application_type = AAZStrType( + serialized_name="applicationType", + ) + properties.compute_units = AAZStrType( + serialized_name="computeUnits", + ) + properties.description = AAZStrType() + properties.execution_timeout = AAZStrType( + serialized_name="executionTimeout", + ) + properties.platform = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.serverless_account_location = AAZStrType( + serialized_name="serverlessAccountLocation", + flags={"required": True}, + ) + properties.serverless_runtime_config = AAZObjectType( + serialized_name="serverlessRuntimeConfig", + ) + properties.serverless_runtime_network_profile = AAZObjectType( + serialized_name="serverlessRuntimeNetworkProfile", + ) + properties.serverless_runtime_tags = AAZListType( + serialized_name="serverlessRuntimeTags", + ) + properties.serverless_runtime_user_context_properties = AAZObjectType( + serialized_name="serverlessRuntimeUserContextProperties", + ) + properties.supplementary_file_location = AAZStrType( + serialized_name="supplementaryFileLocation", + ) + + advanced_custom_properties = cls._schema_on_200.properties.advanced_custom_properties + advanced_custom_properties.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.advanced_custom_properties.Element + _element.key = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_config = cls._schema_on_200.properties.serverless_runtime_config + serverless_runtime_config.cdi_config_props = AAZListType( + serialized_name="cdiConfigProps", + ) + serverless_runtime_config.cdie_config_props = AAZListType( + serialized_name="cdieConfigProps", + ) + + cdi_config_props = cls._schema_on_200.properties.serverless_runtime_config.cdi_config_props + cdi_config_props.Element = AAZObjectType() + _ResourceByIdHelper._build_schema_cdi_config_props_read(cdi_config_props.Element) + + cdie_config_props = cls._schema_on_200.properties.serverless_runtime_config.cdie_config_props + cdie_config_props.Element = AAZObjectType() + _ResourceByIdHelper._build_schema_cdi_config_props_read(cdie_config_props.Element) + + serverless_runtime_network_profile = cls._schema_on_200.properties.serverless_runtime_network_profile + serverless_runtime_network_profile.network_interface_configuration = AAZObjectType( + serialized_name="networkInterfaceConfiguration", + flags={"required": True}, + ) + + network_interface_configuration = cls._schema_on_200.properties.serverless_runtime_network_profile.network_interface_configuration + network_interface_configuration.subnet_id = AAZStrType( + serialized_name="subnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_id = AAZStrType( + serialized_name="vnetId", + flags={"required": True}, + ) + network_interface_configuration.vnet_resource_guid = AAZStrType( + serialized_name="vnetResourceGuid", + ) + + serverless_runtime_tags = cls._schema_on_200.properties.serverless_runtime_tags + serverless_runtime_tags.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.serverless_runtime_tags.Element + _element.name = AAZStrType() + _element.value = AAZStrType() + + serverless_runtime_user_context_properties = cls._schema_on_200.properties.serverless_runtime_user_context_properties + serverless_runtime_user_context_properties.user_context_token = AAZStrType( + serialized_name="userContextToken", + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ResourceByIdHelper: + """Helper class for ResourceById""" + + _schema_cdi_config_props_read = None + + @classmethod + def _build_schema_cdi_config_props_read(cls, _schema): + if cls._schema_cdi_config_props_read is not None: + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + return + + cls._schema_cdi_config_props_read = _schema_cdi_config_props_read = AAZObjectType() + + cdi_config_props_read = _schema_cdi_config_props_read + cdi_config_props_read.application_configs = AAZListType( + serialized_name="applicationConfigs", + flags={"required": True}, + ) + cdi_config_props_read.engine_name = AAZStrType( + serialized_name="engineName", + flags={"required": True}, + ) + cdi_config_props_read.engine_version = AAZStrType( + serialized_name="engineVersion", + flags={"required": True}, + ) + + application_configs = _schema_cdi_config_props_read.application_configs + application_configs.Element = AAZObjectType() + + _element = _schema_cdi_config_props_read.application_configs.Element + _element.customized = AAZStrType( + flags={"required": True}, + ) + _element.default_value = AAZStrType( + serialized_name="defaultValue", + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"required": True}, + ) + _element.platform = AAZStrType( + flags={"required": True}, + ) + _element.type = AAZStrType( + flags={"required": True}, + ) + _element.value = AAZStrType( + flags={"required": True}, + ) + + _schema.application_configs = cls._schema_cdi_config_props_read.application_configs + _schema.engine_name = cls._schema_cdi_config_props_read.engine_name + _schema.engine_version = cls._schema_cdi_config_props_read.engine_version + + +__all__ = ["ResourceById"] diff --git a/src/Informatica/azext_informatica/azext_metadata.json b/src/Informatica/azext_informatica/azext_metadata.json new file mode 100644 index 0000000000..b1e08d1f4b --- /dev/null +++ b/src/Informatica/azext_informatica/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.61.0" +} \ No newline at end of file diff --git a/src/Informatica/azext_informatica/commands.py b/src/Informatica/azext_informatica/commands.py new file mode 100644 index 0000000000..b0d842e499 --- /dev/null +++ b/src/Informatica/azext_informatica/commands.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +# from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): # pylint: disable=unused-argument + pass diff --git a/src/Informatica/azext_informatica/custom.py b/src/Informatica/azext_informatica/custom.py new file mode 100644 index 0000000000..86df1e48ef --- /dev/null +++ b/src/Informatica/azext_informatica/custom.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from knack.log import get_logger + + +logger = get_logger(__name__) diff --git a/src/Informatica/azext_informatica/tests/__init__.py b/src/Informatica/azext_informatica/tests/__init__.py new file mode 100644 index 0000000000..5757aea317 --- /dev/null +++ b/src/Informatica/azext_informatica/tests/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/Informatica/azext_informatica/tests/latest/__init__.py b/src/Informatica/azext_informatica/tests/latest/__init__.py new file mode 100644 index 0000000000..5757aea317 --- /dev/null +++ b/src/Informatica/azext_informatica/tests/latest/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/Informatica/azext_informatica/tests/latest/test_informatica.py b/src/Informatica/azext_informatica/tests/latest/test_informatica.py new file mode 100644 index 0000000000..22f1b88ddc --- /dev/null +++ b/src/Informatica/azext_informatica/tests/latest/test_informatica.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.testsdk import * + + +class InformaticaScenario(ScenarioTest): + # TODO: add tests here + pass diff --git a/src/Informatica/setup.cfg b/src/Informatica/setup.cfg new file mode 100644 index 0000000000..2fdd96e5d3 --- /dev/null +++ b/src/Informatica/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/Informatica/setup.py b/src/Informatica/setup.py new file mode 100644 index 0000000000..20b7a601b4 --- /dev/null +++ b/src/Informatica/setup.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from codecs import open +from setuptools import setup, find_packages + + +# HISTORY.rst entry. +VERSION = '1.0.0b1' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='informatica', + version=VERSION, + description='Microsoft Azure Command-Line Tools Informatica Extension.', + long_description=README + '\n\n' + HISTORY, + license='MIT', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/main/src/informatica', + classifiers=CLASSIFIERS, + packages=find_packages(exclude=["tests"]), + package_data={'azext_informatica': ['azext_metadata.json']}, + install_requires=DEPENDENCIES +)