Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Tags - using usage_api call

Đang mở
#606 11 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api, cloud

Hướng nghiên cứu

Bắt đầu với lệnh gọi Python usage_api.UsageapiClient.request_summarized_usages và phản hồi example2.txt đính kèm. So sánh các trường group_by được yêu cầu với hành vi của Usage API và xác định xem các tổ hợp tag bị thiếu có phải là điều được mong đợi hay cho thấy vấn đề ở service hoặc SDK. Hoàn thành khi đã ghi lại hành vi dự kiến hoặc xác định được một lỗi có thể tái hiện.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Usage

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)

example2.txt

Ngôn ngữ chính
Python
Star
474
Fork
321
Merge trung bình
25 phút
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của oracle/oci-python-sdk

Tất cả issue của oracle/oci-python-sdk

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.