-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new bare metal infrastructure api version, 2024-08-01-preview (#…
…7904) * Adding new api version * Updating the version * Adding b1 for preview * Correcting setup.py file * Adding tests file * Added tests and updated readme * Adding to service_name.json * Fixing linter errors and updating examples --------- Co-authored-by: Ashwin Jeyaseelan <ashwinjeyaseelan@ashwins-mbp4.mynetworksettings.com> Co-authored-by: Ashwin Jeyaseelan <ashwinjeyaseelan@Ashwins-MacBook-Pro4.local>
- Loading branch information
1 parent
b74e2cc
commit 5addd9f
Showing
37 changed files
with
4,937 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. :changelog: | ||
Release History | ||
=============== | ||
|
||
3.0.0b1 | ||
++++++ | ||
* Release of 2024-08-01 preview version which introduces PUT and DELETE operations for compute and storage instances. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Azure CLI BaremetalInfrastructure Extension # | ||
This is an extension to Azure CLI to manage BaremetalInfrastructure resources. | ||
|
||
# Install | ||
|
||
To install this extension just use the CLI extension add command: | ||
|
||
``` | ||
az extension add baremetal-infrastructure | ||
``` | ||
|
||
# Usage | ||
|
||
To create a BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance create --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME --location $LOCATION --sku $SKU --tags key1=value1 key2=value2 | ||
``` | ||
|
||
To delete a BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance delete --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME | ||
``` | ||
|
||
To list all BareMetal instances for the subscription: | ||
|
||
``` | ||
az baremetalinstance list | ||
``` | ||
|
||
To show details about a specific BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance show --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME | ||
``` | ||
|
||
To add a key-value pair to the Tags field of a specific BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance update --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME --set tags.newKey=value | ||
``` | ||
|
||
To update a key-value pair in the Tags field of a specific BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance update --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME --set tags.key=updatedValue | ||
``` | ||
|
||
To delete a key-value pair from the Tags field of a specific BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance update --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME --remove tags.key | ||
``` | ||
|
||
To delete all key-value pairs in the Tags field of a specific BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance update --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME --set tags={} | ||
``` | ||
|
||
To delete a BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance delete --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME | ||
``` | ||
|
||
To start a specific BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance start --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME | ||
``` | ||
|
||
To restart a specific BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance restart --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME | ||
``` | ||
|
||
To force restart a specific BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance restart --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME --force | ||
``` | ||
|
||
To shutdown a specific BareMetal instance: | ||
|
||
``` | ||
az baremetalinstance shutdown --resource-group $RESOURCE_GROUP --instance-name $BM_INSTANCE_NAME | ||
``` |
42 changes: 42 additions & 0 deletions
42
src/baremetal-infrastructure/azext_baremetal_infrastructure/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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_baremetal_infrastructure._help import helps # pylint: disable=unused-import | ||
|
||
|
||
class BaremetalInfrastructureCommandsLoader(AzCommandsLoader): | ||
|
||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
custom_command_type = CliCommandType( | ||
operations_tmpl='azext_baremetal_infrastructure.custom#{}') | ||
super().__init__(cli_ctx=cli_ctx, | ||
custom_command_type=custom_command_type) | ||
|
||
def load_command_table(self, args): | ||
from azext_baremetal_infrastructure.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_baremetal_infrastructure._params import load_arguments | ||
load_arguments(self, command) | ||
|
||
|
||
COMMAND_LOADER_CLS = BaremetalInfrastructureCommandsLoader |
11 changes: 11 additions & 0 deletions
11
src/baremetal-infrastructure/azext_baremetal_infrastructure/_help.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: disable=line-too-long | ||
# pylint: disable=too-many-lines | ||
|
||
from knack.help_files import helps # pylint: disable=unused-import |
13 changes: 13 additions & 0 deletions
13
src/baremetal-infrastructure/azext_baremetal_infrastructure/_params.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
6 changes: 6 additions & 0 deletions
6
src/baremetal-infrastructure/azext_baremetal_infrastructure/aaz/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
# -------------------------------------------------------------------------------------------- |
10 changes: 10 additions & 0 deletions
10
src/baremetal-infrastructure/azext_baremetal_infrastructure/aaz/latest/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
23 changes: 23 additions & 0 deletions
23
...infrastructure/azext_baremetal_infrastructure/aaz/latest/baremetalinstance/__cmd_group.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( | ||
"baremetalinstance", | ||
) | ||
class __CMDGroup(AAZCommandGroup): | ||
"""Handle Operations for Compute Azure Bare Instances. | ||
""" | ||
pass | ||
|
||
|
||
__all__ = ["__CMDGroup"] |
19 changes: 19 additions & 0 deletions
19
...al-infrastructure/azext_baremetal_infrastructure/aaz/latest/baremetalinstance/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ._list import * | ||
from ._restart import * | ||
from ._show import * | ||
from ._shutdown import * | ||
from ._start import * | ||
from ._update import * |
Oops, something went wrong.