Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to find the physical location and geographical region of the particular resource #598

Open
Gopichand785 opened this issue Nov 2, 2023 · 7 comments
Labels
Usage Issue pertains to the Usage service

Comments

@Gopichand785
Copy link

For Azure: while getting the resource information from the cloud we are getting the following example-

  1. resource_region: useast , 2. meter_region: North East , meter_type: Bandwidth.
    when the meter type is bandwidth[it is the parameter the datatrasfer is happening in that resource] we were calculating the network traffic cost.
    For OCI:
    In the same way, the resource location is coming from the API response. But how to get the another location for the same resource. Is their any terminology difference to get that regions in OCI.
    As per my knowledge, resource region means physical location of the resource. meter_region means the geographical scope of the usage being metered. By using these two locations and usage quantity we want to calculate the network traffic cost.
    My query is, how to get the geographical scope of the usage being metered.
    Is their any terminology difference in the OCI?
    will you please provide the API to get the another region from where the data transfer is happening?
    currently, we were using usageapi
@richachugh11
Copy link

Can you specify which specific OCI service or API you are using for obtaining resource and meter information?

@richachugh11 richachugh11 added the Usage Issue pertains to the Usage service label Nov 14, 2023
@Gopichand785
Copy link
Author

@richachugh11 , I used the below API to fetch the details of the particular resource present in the console. But, I am not able to get the two different regions.
That too, will you please provide any other API or info to get all the information of the particular resource because group_by field only accepts only four parameters. Is their any way?
usage_client = oci.usage_api.UsageapiClient(config)
while current_date <= end_date:
requestSummarizedUsagesDetails = oci.usage_api.models.RequestSummarizedUsagesDetails(
tenant_id=tenant_id,
granularity='DAILY',
query_type='COST',
group_by=['region', 'resourceId', 'skuName', 'service'],
time_usage_started=self.str_from_datetime(current_date),
time_usage_ended=self.str_from_datetime(min(end_date,current_date+interval)),
compartment_depth=2
)
request_summarized_usages = usage_client.request_summarized_usages(
requestSummarizedUsagesDetails,
retry_strategy=oci.retry.DEFAULT_RETRY_STRATEGY
)

@Gopichand-Heeddata
Copy link

@adizohar can you look into this?
For some clouds : while getting the resource information from the cloud we are getting the following example-
resource_region: useast , 2. meter_region: North East , meter_type: Bandwidth.
when the meter type is bandwidth[it is the parameter the datatrasfer is happening in that resource] we were calculating the network traffic cost.
For OCI:
In the same way, the resource location is coming from the API response. But how to get the another location for the same resource. Is their any terminology difference to get that regions in OCI.
As per my knowledge, resource region means physical location of the resource. meter_region means the geographical scope of the usage being metered. By using these two locations and usage quantity we want to calculate the network traffic cost.
My query is, how to get the geographical scope of the usage being metered.
Is their any terminology difference in the OCI?
will you please provide the API to get the another region from where the data transfer is happening?
currently, we were using usageapi

I am using below api :
usage_client = oci.usage_api.UsageapiClient(config)
while current_date <= end_date:
requestSummarizedUsagesDetails = oci.usage_api.models.RequestSummarizedUsagesDetails(
tenant_id=tenant_id,
granularity='DAILY',
query_type='COST',
group_by=['region', 'resourceId', 'skuName', 'service'],
time_usage_started=self.str_from_datetime(current_date),
time_usage_ended=self.str_from_datetime(min(end_date,current_date+interval)),
compartment_depth=2
)
request_summarized_usages = usage_client.request_summarized_usages(
requestSummarizedUsagesDetails,
retry_strategy=oci.retry.DEFAULT_RETRY_STRATEGY
)

@adizohar
Copy link
Member

Gopi, currently, there is no bandwidth and target region in the usage api
Our SDK team will follow this question with the metering team and advise

@Gopichand-Heeddata
Copy link

Thank you for providing the information@adizohar

@Gopichand-Heeddata
Copy link

@adizohar Can we get this information from Network flow logs or Network command center?

@adizohar
Copy link
Member

adizohar commented Feb 2, 2024

Flowlogs will give you source and dest ip address and few more items
Please check here - https://docs.oracle.com/en-us/iaas/Content/Logging/Reference/details_for_vcn_flow_logs.htm
This is not related to Python SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Usage Issue pertains to the Usage service
Projects
None yet
Development

No branches or pull requests

4 participants