Elevate as owner on savings plan order based on billing permissions.
POST https://management.azure.com/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/elevate?api-version=2022-11-01
URI Parameters
Name |
In |
Required |
Type |
Description |
savingsPlanOrderId
|
path |
True
|
string
|
Order ID of the savings plan
|
api-version
|
query |
True
|
string
|
The api-version to be used by the service
|
Responses
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
SavingsPlanOrderElevate
Sample request
POST https://management.azure.com/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/elevate?api-version=2022-11-01
/**
* Samples for SavingsPlanOrder Elevate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
* SavingsPlanOrderElevate.json
*/
/**
* Sample code: SavingsPlanOrderElevate.
*
* @param manager Entry point to BillingBenefitsManager.
*/
public static void
savingsPlanOrderElevate(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
manager.savingsPlanOrders().elevateWithResponse("20000000-0000-0000-0000-000000000000",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.billingbenefits import BillingBenefitsRP
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-billingbenefits
# USAGE
python savings_plan_order_elevate.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BillingBenefitsRP(
credential=DefaultAzureCredential(),
)
response = client.savings_plan_order.elevate(
savings_plan_order_id="20000000-0000-0000-0000-000000000000",
)
print(response)
# x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderElevate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbillingbenefits_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderElevate.json
func ExampleSavingsPlanOrderClient_Elevate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSavingsPlanOrderClient().Elevate(ctx, "20000000-0000-0000-0000-000000000000", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RoleAssignmentEntity = armbillingbenefits.RoleAssignmentEntity{
// Name: to.Ptr("70000000-0000-0000-0000-000000000005"),
// ID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000009/providers/Microsoft.Authorization/roleAssignments/70000000-0000-0000-0000-000000000005"),
// Properties: &armbillingbenefits.RoleAssignmentEntityProperties{
// PrincipalID: to.Ptr("50000000-0000-0000-0000-000000000000"),
// RoleDefinitionID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000009/providers/Microsoft.Authorization/roleDefinitions/30000000-0000-0000-0000-000000000008"),
// Scope: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000009"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BillingBenefitsRP } = require("@azure/arm-billingbenefits");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Elevate as owner on savings plan order based on billing permissions.
*
* @summary Elevate as owner on savings plan order based on billing permissions.
* x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderElevate.json
*/
async function savingsPlanOrderElevate() {
const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new BillingBenefitsRP(credential);
const result = await client.savingsPlanOrder.elevate(savingsPlanOrderId);
console.log(result);
}
savingsPlanOrderElevate().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"roleDefinitionId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000009/providers/Microsoft.Authorization/roleDefinitions/30000000-0000-0000-0000-000000000008",
"principalId": "50000000-0000-0000-0000-000000000000",
"scope": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000009"
},
"id": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000009/providers/Microsoft.Authorization/roleAssignments/70000000-0000-0000-0000-000000000005",
"name": "70000000-0000-0000-0000-000000000005"
}
Definitions
ErrorAdditionalInfo
The resource management error additional info.
Name |
Type |
Description |
info
|
object
|
The additional info.
|
type
|
string
|
The additional info type.
|
ErrorDetail
The error detail.
Name |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
code
|
string
|
The error code.
|
details
|
ErrorDetail[]
|
The error details.
|
message
|
string
|
The error message.
|
target
|
string
|
The error target.
|
ErrorResponse
Error response
Name |
Type |
Description |
error
|
ErrorDetail
|
The error object.
|
RoleAssignmentEntity
Role assignment entity
Name |
Type |
Description |
id
|
string
|
Role assignment entity id
|
name
|
string
|
Role assignment entity name
|
properties.principalId
|
string
|
Principal Id
|
properties.roleDefinitionId
|
string
|
Role definition id
|
properties.scope
|
string
|
Scope of the role assignment entity
|