Skip to content

Commit

Permalink
Adding new bare metal infrastructure api version, 2024-08-01-preview (#…
Browse files Browse the repository at this point in the history
…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
3 people committed Aug 28, 2024
1 parent b74e2cc commit 5addd9f
Show file tree
Hide file tree
Showing 37 changed files with 4,937 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/baremetal-infrastructure/HISTORY.rst
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.
90 changes: 90 additions & 0 deletions src/baremetal-infrastructure/README.md
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
```
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
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
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
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
# --------------------------------------------------------------------------------------------
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

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"]
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 *
Loading

0 comments on commit 5addd9f

Please sign in to comment.