Espace de noms : microsoft.graph.partners.billing
Importante
Les API sous la version /beta
dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
Remarque
Cette API est disponible pour les partenaires fournisseur de solutions Cloud (CSP) uniquement pour accéder à leurs données de rapprochement facturées et non facturées pour un locataire. Pour en savoir plus sur le programme CSP, consultez Fournisseur de solutions Cloud Microsoft.
Exportez les données d’utilisation Azure non facturées pour une période de facturation et une devise spécifiques.
Cette API est disponible dans les déploiements de cloud national suivants.
Service global |
Gouvernement des États-Unis L4 |
Us Government L5 (DOD) |
Chine gérée par 21Vianet |
✅ |
❌ |
❌ |
❌ |
Autorisations
L’une des autorisations suivantes est nécessaire pour appeler cette API. Pour plus d’informations, notamment sur la façon de choisir les autorisations, voir Autorisations.
Type d’autorisation |
Autorisations avec privilèges minimum |
Autorisations privilégiées plus élevées |
Déléguée (compte professionnel ou scolaire) |
PartnerBilling.Read.All |
Non disponible. |
Déléguée (compte Microsoft personnel) |
Non prise en charge. |
Non prise en charge. |
Application |
PartnerBilling.Read.All |
Non disponible. |
Requête HTTP
POST /reports/partners/billing/usage/unbilled/export
Corps de la demande
Dans le corps de la demande, fournissez une représentation JSON des paramètres.
Le tableau suivant présente les paramètres que vous pouvez utiliser avec cette action.
Paramètre |
Type |
Description |
attributeSet |
microsoft.graph.partners.billing.attributeSet |
Attributs qui doivent être exportés. Les valeurs possibles sont full , basic et unknownFutureValue . La valeur par défaut est full . Choisissez full pour une réponse complète ou basic pour un sous-ensemble d’attributs. Optional. |
billingPeriod |
microsoft.graph.partners.billing.billingPeriod |
Période de facturation des données d’exportation. Les valeurs possibles sont current , last et unknownFutureValue . Choisissez current pour la période de facturation actuelle et last pour la dernière période de facturation. Obligatoire. |
currencyCode |
Chaîne |
Code monétaire pour la facturation du partenaire. Obligatoire. |
Réponse
Si elle réussit, cette méthode renvoie un 202 Accepted
code de réponse et un Location
en-tête qui contient l’URL de l’opération de longue durée. Vous pouvez case activée la status de l’opération de longue durée en effectuant une requête GET à cette URL qui retourne l’un des objets suivants dans le corps de la réponse : microsoft.graph.partners.billing.runningOperation, microsoft.graph.partners.billing.exportSuccessOperation ou microsoft.graph.partners.billing.failedOperation.
Exemples
Demande
L’exemple suivant illustre une demande.
POST https://graph.microsoft.com/beta/reports/partners/billing/usage/unbilled/export
Content-Type: application/json
{
"currencyCode": "USD",
"attributeSet": "full",
"billingPeriod": "current"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Reports.Partners.Billing.Usage.Unbilled.MicrosoftGraphPartnersBillingExport;
using Microsoft.Graph.Beta.Models.Partners.Billing;
var requestBody = new ExportPostRequestBody
{
CurrencyCode = "USD",
AttributeSet = AttributeSet.Full,
BillingPeriod = BillingPeriod.Current,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Reports.Partners.Billing.Usage.Unbilled.MicrosoftGraphPartnersBillingExport.PostAsync(requestBody);
mgc-beta reports partners billing usage unbilled microsoft-graph-partners-billing-export post --body '{\
"currencyCode": "USD",\
"attributeSet": "full",\
"billingPeriod": "current"\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphreports "github.com/microsoftgraph/msgraph-beta-sdk-go/reports"
graphmodelspartnersbilling "github.com/microsoftgraph/msgraph-beta-sdk-go/models/partners/billing"
//other-imports
)
requestBody := graphreports.NewExportPostRequestBody()
currencyCode := "USD"
requestBody.SetCurrencyCode(¤cyCode)
attributeSet := graphmodels.FULL_ATTRIBUTESET
requestBody.SetAttributeSet(&attributeSet)
billingPeriod := graphmodels.CURRENT_BILLINGPERIOD
requestBody.SetBillingPeriod(&billingPeriod)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
microsoftGraphPartnersBillingExport, err := graphClient.Reports().Partners().Billing().Usage().Unbilled().MicrosoftGraphPartnersBillingExport().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.reports.partners.billing.usage.unbilled.microsoftgraphpartnersbillingexport.ExportPostRequestBody exportPostRequestBody = new com.microsoft.graph.beta.reports.partners.billing.usage.unbilled.microsoftgraphpartnersbillingexport.ExportPostRequestBody();
exportPostRequestBody.setCurrencyCode("USD");
exportPostRequestBody.setAttributeSet(com.microsoft.graph.beta.models.partners.billing.AttributeSet.Full);
exportPostRequestBody.setBillingPeriod(com.microsoft.graph.beta.models.partners.billing.BillingPeriod.Current);
var result = graphClient.reports().partners().billing().usage().unbilled().microsoftGraphPartnersBillingExport().post(exportPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const operation = {
currencyCode: 'USD',
attributeSet: 'full',
billingPeriod: 'current'
};
await client.api('/reports/partners/billing/usage/unbilled/export')
.version('beta')
.post(operation);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Reports\Partners\Billing\Usage\Unbilled\MicrosoftGraphPartnersBillingExport\ExportPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Partners\Billing\AttributeSet;
use Microsoft\Graph\Beta\Generated\Models\Partners\Billing\BillingPeriod;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExportPostRequestBody();
$requestBody->setCurrencyCode('USD');
$requestBody->setAttributeSet(new AttributeSet('full'));
$requestBody->setBillingPeriod(new BillingPeriod('current'));
$result = $graphServiceClient->reports()->partners()->billing()->usage()->unbilled()->microsoftGraphPartnersBillingExport()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Reports
$params = @{
currencyCode = "USD"
attributeSet = "full"
billingPeriod = "current"
}
Export-MgBetaReportPartnerBillingUsageUnbilled -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.reports.partners.billing.usage.unbilled.microsoft_graph_partners_billing_export.export_post_request_body import ExportPostRequestBody
from msgraph_beta.generated.models.attribute_set import AttributeSet
from msgraph_beta.generated.models.billing_period import BillingPeriod
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ExportPostRequestBody(
currency_code = "USD",
attribute_set = AttributeSet.Full,
billing_period = BillingPeriod.Current,
)
result = await graph_client.reports.partners.billing.usage.unbilled.microsoft_graph_partners_billing_export.post(request_body)
Réponse
L’exemple suivant illustre la réponse.
HTTP/1.1 202 Accepted
Content-Type: application/json
Location: https://graph.microsoft.com/beta/reports/partners/billing/operations/9ab9cb54-d07f-4f52-9ea6-a09d7de52c14