Skip to content

Commit

Permalink
Merge pull request Azure#31 from gaoyp830/yunga/t
Browse files Browse the repository at this point in the history
[Reservation] Adding reservations commands to aaz
  • Loading branch information
kairu-ms authored Oct 12, 2022
2 parents 39da6a9 + db10553 commit 12056f9
Show file tree
Hide file tree
Showing 76 changed files with 25,160 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Commands/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
- [orbital](/Commands/orbital/readme.md)
: Azure Orbital Ground Station as-a-Service (GSaaS).

- [reservations](/Commands/reservations/readme.md)
: Azure Reservations

- [sentinel](/Commands/sentinel/readme.md)
: Manage Microsoft Sentinel.

Expand Down
17 changes: 17 additions & 0 deletions Commands/reservations/_calculate-exchange.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# [Command] _reservations calculate-exchange_

Calculates price for exchanging `Reservations` if there are no policy errors.


## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvY2FsY3VsYXRlZXhjaGFuZ2U=/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/calculateexchange 2022-03-01 -->

#### examples

- Calculate exchange
```bash
reservations calculate-exchange --ris-to-exchange "[{reservation-id:/providers/microsoft.capacity/reservationOrders/40000000-aaaa-bbbb-cccc-200000000012/reservations/51000000-aaaa-bbbb-cccc-200000000012,quantity:1},{reservation-id:/providers/microsoft.capacity/reservationOrders/90000000-aaaa-bbbb-cccc-200000000012/reservations/36000000-aaaa-bbbb-cccc-200000000012,quantity:1}]" --ris-to-purchase "[{reserved-resource-type:VirtualMachines,applied-scope-type:Shared,billing-scope:12350000-aaaa-bbbb-cccc-200000000012,display-name:exchangeTest1,quantity:1,sku:Standard_B1s,term:P1Y,billing-plan:Monthly,location:eastus},{reserved-resource-type:VirtualMachines,applied-scope-type:Shared,billing-scope:12350000-aaaa-bbbb-cccc-200000000012,display-name:exchangeTest2,quantity:1,sku:Standard_B1s,term:P1Y,billing-plan:Monthly,location:eastus}]"
```
17 changes: 17 additions & 0 deletions Commands/reservations/_exchange.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# [Command] _reservations exchange_

Returns one or more `Reservations` in exchange for one or more `Reservation` purchases.


## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvZXhjaGFuZ2U=/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/exchange 2022-03-01 -->

#### examples

- Exchange reservations
```bash
reservations exchange --session-id 40000000-aaaa-bbbb-cccc-200000000012
```
16 changes: 16 additions & 0 deletions Commands/reservations/catalog/_show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _reservations catalog show_

Get catalog of available reservation.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jYXBhY2l0eS9jYXRhbG9ncw==/2022-03-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/providers/microsoft.capacity/catalogs 2022-03-01 -->

#### examples

- Get catalog of VM reservation skus
```bash
reservations catalog show --subscription-id 7a802e4f-129c-4574-9b46-638f17b60dd5 --location eastus --reserved-resource-type VirtualMachines
```
8 changes: 8 additions & 0 deletions Commands/reservations/catalog/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# [Group] _reservations catalog_

reservations catalog

## Commands

- [show](/Commands/reservations/catalog/_show.md)
: Get catalog of available reservation.
27 changes: 27 additions & 0 deletions Commands/reservations/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# [Group] _reservations_

Azure Reservations

## Subgroups

- [catalog](/Commands/reservations/catalog/readme.md)
: reservations catalog

- [reservation](/Commands/reservations/reservation/readme.md)
: reservations reservation

- [reservation-order](/Commands/reservations/reservation-order/readme.md)
: reservations reservation-order

- [reservation-order-id](/Commands/reservations/reservation-order-id/readme.md)
: reservations reservation-order-id

## Commands

- [calculate-exchange](/Commands/reservations/_calculate-exchange.md)
: Calculates price for exchanging `Reservations` if there are no policy errors.


- [exchange](/Commands/reservations/_exchange.md)
: Returns one or more `Reservations` in exchange for one or more `Reservation` purchases.

16 changes: 16 additions & 0 deletions Commands/reservations/reservation-order-id/_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _reservations reservation-order-id list_

List applicable `Reservation`s that are applied to this subscription or a resource group under this subscription.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jYXBhY2l0eS9hcHBsaWVkcmVzZXJ2YXRpb25z/2022-03-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/providers/microsoft.capacity/appliedreservations 2022-03-01 -->

#### examples

- See reservation order ids that are applied to subscription.
```bash
reservations reservation-order-id list --subscription-id 50000000-aaaa-bbbb-cccc-100000000002
```
8 changes: 8 additions & 0 deletions Commands/reservations/reservation-order-id/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# [Group] _reservations reservation-order-id_

reservations reservation-order-id

## Commands

- [list](/Commands/reservations/reservation-order-id/_list.md)
: List applicable `Reservation`s that are applied to this subscription or a resource group under this subscription.
17 changes: 17 additions & 0 deletions Commands/reservations/reservation-order/_calculate-refund.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# [Command] _reservations reservation-order calculate-refund_

Calculate price for returning `Reservations` if there are no policy errors.


## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30vY2FsY3VsYXRlcmVmdW5k/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{}/calculaterefund 2022-03-01 -->

#### examples

- Calculate refund
```bash
reservations reservation-order calculate-refund --reservation-order-id 0000000-aaaa-bbbb-cccc-20000000001 --id /providers/microsoft.capacity/reservationOrders/0000000-aaaa-bbbb-cccc-20000000001 --scope Reservation --quantity 1 --reservation-id /providers/microsoft.capacity/reservationOrders/0000000-aaaa-bbbb-cccc-20000000001/reservations/50000000-aaaa-bbbb-cccc-200000000000
```
16 changes: 16 additions & 0 deletions Commands/reservations/reservation-order/_calculate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _reservations reservation-order calculate_

Calculate price for placing a `ReservationOrder`.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvY2FsY3VsYXRlcHJpY2U=/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/calculateprice 2022-03-01 -->

#### examples

- Calculate price
```bash
reservations reservation-order calculate --applied-scope-type Shared --billing-scope 50000000-aaaa-bbbb-cccc-100000000002 --display-name name1 --quantity 1 --reserved-resource-type VirtualMachines --sku Standard_B1s --term P1Y --billing-plan Monthly --location eastus
```
16 changes: 16 additions & 0 deletions Commands/reservations/reservation-order/_change-directory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _reservations reservation-order change-directory_

Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30vY2hhbmdlZGlyZWN0b3J5/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{}/changedirectory 2022-03-01 -->

#### examples

- Change a reservation order to another tenant
```bash
reservations reservation-order change-directory --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000000 --destination-tenant-id 10000000-aaaa-bbbb-cccc-200000000011
```
9 changes: 9 additions & 0 deletions Commands/reservations/reservation-order/_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _reservations reservation-order create_

Create `ReservationOrder` and create resource under the specified URI.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30=/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{} 2022-03-01 -->
16 changes: 16 additions & 0 deletions Commands/reservations/reservation-order/_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _reservations reservation-order list_

List of all the `ReservationOrder`s that the user has access to in the current tenant.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnM=/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders 2022-03-01 -->

#### examples

- List of all the reservation orders that the user has access to in the current tenant.
```bash
reservations reservation-order list
```
21 changes: 21 additions & 0 deletions Commands/reservations/reservation-order/_purchase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# [Command] _reservations reservation-order purchase_

Create `ReservationOrder` and create resource under the specified URI.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30=/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{} 2022-03-01 -->

#### examples

- Purchase a single scope reservation
```bash
reservations reservation-order purchase --reservation-order-id 40000000-aaaa-bbbb-cccc-200000000005 --applied-scope-type Single --billing-scope 50000000-aaaa-bbbb-cccc-200000000005 --reserved-resource-type VirtualMachines --display-name name1 --quantity 1 --sku Standard_B1s --term P1Y --billing-plan Monthly --location eastus --applied-scope 50000000-aaaa-bbbb-cccc-200000000005
```

- Purchase a Single scope with resource group reservation
```bash
reservations reservation-order purchase --reservation-order-id 40000000-aaaa-bbbb-cccc-200000000005 --applied-scope-type Single --billing-scope 50000000-aaaa-bbbb-cccc-200000000005 --reserved-resource-type VirtualMachines --display-name testername1 --quantity 1 --sku Standard_B1s --term P1Y --billing-plan Monthly --location eastus --applied-scope '/subscriptions/50000000-aaaa-bbbb-cccc-200000000005/resourceGroups/rg1' --instance-flexibility Off
```
16 changes: 16 additions & 0 deletions Commands/reservations/reservation-order/_return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _reservations reservation-order return_

Return a reservation.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30vcmV0dXJu/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{}/return 2022-03-01 -->

#### examples

- Return a reservation
```bash
reservations reservation-order return --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000000 --return-reason mockReason --scope Reservation --quantity 1 --reservation-id /providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-200000000000/reservations/30000000-aaaa-bbbb-cccc-200000000011 --session-id 40000000-aaaa-bbbb-cccc-200000000012
```
16 changes: 16 additions & 0 deletions Commands/reservations/reservation-order/_show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _reservations reservation-order show_

Get the details of the `ReservationOrder`.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30=/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{} 2022-03-01 -->

#### examples

- Get the details of a reservation order
```bash
reservations reservation-order show --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000005
```
9 changes: 9 additions & 0 deletions Commands/reservations/reservation-order/_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _reservations reservation-order update_

Update `ReservationOrder` and create resource under the specified URI.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30=/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{} 2022-03-01 -->
38 changes: 38 additions & 0 deletions Commands/reservations/reservation-order/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# [Group] _reservations reservation-order_

reservations reservation-order

## Subgroups

- [reservation](/Commands/reservations/reservation-order/reservation/readme.md)
: reservations reservation-order reservation

## Commands

- [calculate](/Commands/reservations/reservation-order/_calculate.md)
: Calculate price for placing a `ReservationOrder`.

- [calculate-refund](/Commands/reservations/reservation-order/_calculate-refund.md)
: Calculate price for returning `Reservations` if there are no policy errors.


- [change-directory](/Commands/reservations/reservation-order/_change-directory.md)
: Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id

- [create](/Commands/reservations/reservation-order/_create.md)
: Create `ReservationOrder` and create resource under the specified URI.

- [list](/Commands/reservations/reservation-order/_list.md)
: List of all the `ReservationOrder`s that the user has access to in the current tenant.

- [purchase](/Commands/reservations/reservation-order/_purchase.md)
: Create `ReservationOrder` and create resource under the specified URI.

- [return](/Commands/reservations/reservation-order/_return.md)
: Return a reservation.

- [show](/Commands/reservations/reservation-order/_show.md)
: Get the details of the `ReservationOrder`.

- [update](/Commands/reservations/reservation-order/_update.md)
: Update `ReservationOrder` and create resource under the specified URI.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _reservations reservation-order reservation archive_

Archiving a `Reservation` moves it to `Archived` state.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30vcmVzZXJ2YXRpb25zL3t9L2FyY2hpdmU=/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{}/reservations/{}/archive 2022-03-01 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# [Command] _reservations reservation-order reservation available-scope_

Get Available Scopes for `Reservation`.


## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30vcmVzZXJ2YXRpb25zL3t9L2F2YWlsYWJsZXNjb3Blcw==/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{}/reservations/{}/availablescopes 2022-03-01 -->
9 changes: 9 additions & 0 deletions Commands/reservations/reservation-order/reservation/_show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _reservations reservation-order reservation show_

Get specific `Reservation` details.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30vcmVzZXJ2YXRpb25zL3t9/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{}/reservations/{} 2022-03-01 -->
10 changes: 10 additions & 0 deletions Commands/reservations/reservation-order/reservation/_unarchive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# [Command] _reservations reservation-order reservation unarchive_

Unarchiving a `Reservation` moves it to the state it was before archiving.


## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30vcmVzZXJ2YXRpb25zL3t9L3VuYXJjaGl2ZQ==/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{}/reservations/{}/unarchive 2022-03-01 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _reservations reservation-order reservation update_

Update the applied scopes of the `Reservation`.

## Versions

### [2022-03-01](/Resources/mgmt-plane/L3Byb3ZpZGVycy9taWNyb3NvZnQuY2FwYWNpdHkvcmVzZXJ2YXRpb25vcmRlcnMve30vcmVzZXJ2YXRpb25zL3t9/2022-03-01.xml) **Stable**

<!-- mgmt-plane /providers/microsoft.capacity/reservationorders/{}/reservations/{} 2022-03-01 -->
22 changes: 22 additions & 0 deletions Commands/reservations/reservation-order/reservation/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# [Group] _reservations reservation-order reservation_

reservations reservation-order reservation

## Commands

- [archive](/Commands/reservations/reservation-order/reservation/_archive.md)
: Archiving a `Reservation` moves it to `Archived` state.

- [available-scope](/Commands/reservations/reservation-order/reservation/_available-scope.md)
: Get Available Scopes for `Reservation`.


- [show](/Commands/reservations/reservation-order/reservation/_show.md)
: Get specific `Reservation` details.

- [unarchive](/Commands/reservations/reservation-order/reservation/_unarchive.md)
: Unarchiving a `Reservation` moves it to the state it was before archiving.


- [update](/Commands/reservations/reservation-order/reservation/_update.md)
: Update the applied scopes of the `Reservation`.
Loading

0 comments on commit 12056f9

Please sign in to comment.