Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/elastic/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
Release History
===============

1.0.0b1
1.0.0b3
++++++
* Bump up `elastic` API version to `2023-02-01-preview`
* Bump up `elastic` API version to `2024-06-15-preview`

0.1.0
++++++
* Initial release.
4 changes: 4 additions & 0 deletions src/elastic/azext_elastic/aaz/latest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"elastic get-organization-api-key",
)
class GetOrganizationApiKey(AAZCommand):
"""Fetch User API Key from internal database, if it was generated and stored while creating the Elasticsearch Organization.
"""Fetch the User API Key from the internal database, if it was generated and stored during the creation of the Elasticsearch Organization.

:example: Get organization api key
az elastic get-organization-api-key --email-id id
"""

_aaz_info = {
"version": "2023-02-01-preview",
"version": "2024-06-15-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/getorganizationapikey", "2023-02-01-preview"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/getorganizationapikey", "2024-06-15-preview"],
]
}

Expand Down Expand Up @@ -110,7 +110,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-02-01-preview",
"api-version", "2024-06-15-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
"elastic elastic-version",
)
class __CMDGroup(AAZCommandGroup):
"""Retrieve a list of all available Elastic versions for a specified region, helping you choose the best version for your deployment.
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -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 ._list import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# --------------------------------------------------------------------------------------------
# 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(
"elastic elastic-version list",
)
class List(AAZCommand):
"""List a list of available versions for a region.

:example: ElasticVersions_List
az elastic elastic-version list --region myregion
"""

_aaz_info = {
"version": "2024-06-15-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/elasticversions", "2024-06-15-preview"],
]
}

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.region = AAZStrArg(
options=["--region"],
help="Region where elastic deployment will take place.",
required=True,
)
return cls._args_schema

def _execute_operations(self):
self.pre_operations()
self.ElasticVersionsList(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 ElasticVersionsList(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/Microsoft.Elastic/elasticVersions",
**self.url_parameters
)

@property
def method(self):
return "GET"

@property
def error_format(self):
return "ODataV4Format"

@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(
"region", self.ctx.args.region,
required=True,
),
**self.serialize_query_param(
"api-version", "2024-06-15-preview",
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()

value = cls._schema_on_200.value
value.Element = AAZObjectType()

_element = cls._schema_on_200.value.Element
_element.properties = AAZObjectType()

properties = cls._schema_on_200.value.Element.properties
properties.version = AAZStrType()

return cls._schema_on_200


class _ListHelper:
"""Helper class for List"""


__all__ = ["List"]
23 changes: 23 additions & 0 deletions src/elastic/azext_elastic/aaz/latest/elastic/get/__cmd_group.py
Original file line number Diff line number Diff line change
@@ -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(
"elastic get",
)
class __CMDGroup(AAZCommandGroup):
"""Manage and retrieve detailed information about your Elastic resources, including configurations and status.
"""
pass


__all__ = ["__CMDGroup"]
11 changes: 11 additions & 0 deletions src/elastic/azext_elastic/aaz/latest/elastic/get/__init__.py
Original file line number Diff line number Diff line change
@@ -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 *
Original file line number Diff line number Diff line change
@@ -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(
"elastic get elastic",
)
class __CMDGroup(AAZCommandGroup):
"""Retrieve detailed information about your Elastic resources, including configurations and status.
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -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 *
Original file line number Diff line number Diff line change
@@ -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(
"elastic get elastic organization-to-azure",
)
class __CMDGroup(AAZCommandGroup):
"""Manage and retrieve information about the Elastic organization linked to your Azure subscription.
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -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 *
Original file line number Diff line number Diff line change
@@ -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(
"elastic get elastic organization-to-azure subscription",
)
class __CMDGroup(AAZCommandGroup):
"""Get detailed information about the Elastic Organization linked to your Azure subscription for the logged-in user.
"""
pass


__all__ = ["__CMDGroup"]
Loading
Loading