Tags - using usage_api call
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia con la chiamata Python usage_api.UsageapiClient.request_summarized_usages e la risposta allegata example2.txt. Confronta i campi group_by richiesti con il comportamento della Usage API e determina se le combinazioni di tag mancanti sono previste o indicano un problema del servizio o dell’SDK. Il lavoro è completato quando viene documentato il comportamento previsto o viene identificato un difetto riproducibile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi all,
i am trying to get all the tags associated for a resource weather it comes under defined tags or free form tags. and i am using usage_api.usageapiclient using the usage_api.models.requestsummarizedusagedetails and in the group_by filed i am giving 4 values which are resourceId, tagKey, tagNamespace, tagValue. and i am getting the response.
in this response we are seeing the tag column but we are getting only a single record or set of tagKey, tagNamespace, tagValue instead of all the key and values for that associated resource and also missing some key value pairs.
is this an expected behaviour or am i missing some thing here?
below i am attaching the code and response
identity = oci.identity.IdentityClient(config)
user = identity.get_user(config["user"]).data
identity_client = oci.identity.IdentityClient(config)
tenancy_id = config["tenancy"]
start_date = datetime.utcnow().replace(second=0, microsecond=0, minute=0,hour=0).replace(tzinfo=None) - timedelta(days = 30)
end_date = datetime.utcnow().replace(second=0, microsecond=0, minute=0,hour=0).replace(tzinfo=None)
usage_client = oci.usage_api.UsageapiClient(config)
requestSummarizedUsagesDetails = oci.usage_api.models.RequestSummarizedUsagesDetails(
tenant_id=tenancy_id,
granularity='DAILY',
query_type='COST',
group_by=['resourceId', 'tagKey', 'tagValue', 'skuName'],
time_usage_started=start_date,
time_usage_ended=end_date
)
usageClient.request_summarized_usages
request_summarized_usages = usage_client.request_summarized_usages(
requestSummarizedUsagesDetails,
retry_strategy=oci.retry.DEFAULT_RETRY_STRATEGY
)
file = '/home/ubuntu/Desktop/example2.txt'
temp = str(request_summarized_usages.data.items)
with open (file, 'w') as f:
f.write(temp)
- Lingua principale
- Python
- Stelle
- 474
- Fork
- 321
- Merge medio
- 23m
- PR unite (30g)
- 4
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di oracle/oci-python-sdk
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
oracle/oci-python-sdk#890 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
oracle/oci-python-sdk#879 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
oracle/oci-python-sdk#878 ·
-
SDK
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
oracle/oci-python-sdk#861 · 5 commenti ·
-
SDK
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
oracle/oci-python-sdk#852 ·
Tutte le issue di oracle/oci-python-sdk
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·