Tags - using usage_api call
还没有人认领这个 Issue。
评估
调研方向
从 Python 的 usage_api.UsageapiClient.request_summarized_usages 调用和附带的 example2.txt 响应开始。将请求的 group_by 字段与 Usage API 的行为进行比较,并确定缺少的标签组合是预期行为,还是表示服务或 SDK 存在问题。完成的标准是记录预期行为,或确定一个可复现的缺陷。
由索引模型根据 Issue 内容生成。
描述
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)
- 主要语言
- Python
- 星标
- 473
- 派生
- 322
- 平均合并
- 13 分钟
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
oracle/oci-python-sdk 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
oracle/oci-python-sdk#890 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 45/100
oracle/oci-python-sdk#879 · 3 条评论 ·
-
Example uses non-existent API可能已有人在做 @reginaldalfret 于 9 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 66/100
oracle/oci-python-sdk#878 ·
-
SDK
难度 3/5 1-2 天 新手友好度 55/100
oracle/oci-python-sdk#861 · 5 条评论 ·
-
SDK
难度 2/5 1-3 小时 新手友好度 48/100
oracle/oci-python-sdk#852 ·
查看 oracle/oci-python-sdk 的全部 Issue
相似的 Issue
-
`burr` fails to start when the Python path has a space in it可能已有人在做 @enekoreto 今天认领。 未关闭status/needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 5 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
-
难度 2/5 半天 新手友好度 72/100
debpalash/VoiceStudio#2903 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
dagster-io/community-integrations#367 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
aws-samples/sample-per-model-bedrock#243 ·
维护者通常 1 天内回复