Closed pitouche closed 1 year ago
Hi @pitouche ,
osc-sdk-python provides all its data from Outscale API and perform no additional transformation. Note that Outscale API has some server-sided filtering option but not in osc-sdk-python.
Please contact Outscale support to express your need.
Ok so from what i understand this issue is more linked with the API implementation itself.
We can close this issue then, ticket opened on support side.
Hello, Using a little sample script on our Outscale Account:
from osc_sdk_python import Gateway gw = Gateway(access_key=ak, secret_key=sk, region=region) res = gw.ReadQuotas()
The res var hold now the answer divided into several section, the more interesting one being the "global" section.
The issue here, is the global section doesnt report all Quotas of the account, example "sg_rule_limit" and "vpc_sg_rule_limit" are not listed in the "global" section of the answer, instead it is reported in another section which is dependent of the presence of running Instances in the Account, This is not normal, we should be able to consult the quota without having first an Instance running in the account or any "rtb-", "i-", "sg-", "vpc-", "vgw-*" and so on.
Example of global content: global {'ShortDescription': 'VM Limit', 'QuotaCollection': 'Compute', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of VM this user can own', 'MaxValue': 2, 'UsedValue': 0, 'Name': 'vm_limit'} {'ShortDescription': 'Core Limit', 'QuotaCollection': 'Compute', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of total cores (virtual core)', 'MaxValue': 9, 'UsedValue': 0, 'Name': 'core_limit'} {'ShortDescription': 'Memory Limit', 'QuotaCollection': 'Compute', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of total memory (GiB)', 'MaxValue': 9, 'UsedValue': 0, 'Name': 'memory_limit'} {'ShortDescription': 'IP Limit', 'QuotaCollection': 'Compute', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum IP addresses the user can allocate', 'MaxValue': 20, 'UsedValue': 0, 'Name': 'ip_limit'} {'ShortDescription': 'GPU Limit', 'QuotaCollection': 'Compute', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of GPU the user can allocate', 'MaxValue': 2, 'UsedValue': 0, 'Name': 'gpu_limit'} {'ShortDescription': 'Dedicated Server Limit', 'QuotaCollection': 'Compute', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of dedicated servers', 'MaxValue': 0, 'UsedValue': 0, 'Name': 'dedicated_server_limit'} {'ShortDescription': 'Volume Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of BSU volumes', 'MaxValue': 99999, 'UsedValue': 27, 'Name': 'volume_limit'} {'ShortDescription': 'Volume Size Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum cumulated size of BSU volumes (GiB)', 'MaxValue': 280, 'UsedValue': 0, 'Name': 'volume_size_limit'} {'ShortDescription': 'IO1 Volume Size Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum cumulated size of IO1 volumes (GiB)', 'MaxValue': 280, 'UsedValue': 0, 'Name': 'io1_volume_size_limit'} {'ShortDescription': 'OS1 Volume Size Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum cumulated size of OS1 volumes (GiB)', 'MaxValue': 200, 'UsedValue': 0, 'Name': 'os1_volume_size_limit'} {'ShortDescription': 'GP2 Volume Size Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum cumulated size of GP2 volumes (GiB)', 'MaxValue': 100, 'UsedValue': 0, 'Name': 'gp2_volume_size_limit'} {'ShortDescription': 'ST1 Volume Size Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum cumulated size of ST1 volumes (GiB)', 'MaxValue': 200, 'UsedValue': 0, 'Name': 'st1_volume_size_limit'} {'ShortDescription': 'SC1 Volume Size Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum cumulated size of SC1 volumes (GiB)', 'MaxValue': 20, 'UsedValue': 0, 'Name': 'sc1_volume_size_limit'} {'ShortDescription': 'Standard Volume Size Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum cumulated size of standard volumes (GiB)', 'MaxValue': 30, 'UsedValue': 0, 'Name': 'standard_volume_size_limit'} {'ShortDescription': 'Snapshot Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of snapshots', 'MaxValue': 10, 'UsedValue': 0, 'Name': 'snapshot_limit'} {'ShortDescription': 'Snapshot Exports Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of running snapshot export tasks', 'MaxValue': 5, 'UsedValue': 0, 'Name': 'snapshot_export_limit'} {'ShortDescription': 'Image Exports Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of running image export tasks', 'MaxValue': 5, 'UsedValue': 0, 'Name': 'image_export_limit'} {'ShortDescription': 'Provisioned IOPS Limit', 'QuotaCollection': 'Storage', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of IOPS delivered by provisioned IOPS volumes', 'MaxValue': 400, 'UsedValue': 0, 'Name': 'iops_limit'} {'ShortDescription': 'Prefix Lists Limit', 'QuotaCollection': 'Security Groups', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of prefix lists is reached.', 'MaxValue': 0, 'UsedValue': 0, 'Name': 'prefix_list_limit'} {'ShortDescription': 'Security Groups Limit', 'QuotaCollection': 'Security Groups', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of security groups', 'MaxValue': 60, 'UsedValue': 0, 'Name': 'sg_limit'} {'ShortDescription': 'VPC Limit', 'QuotaCollection': 'VPC', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of VPC', 'MaxValue': 4, 'UsedValue': 0, 'Name': 'vpc_limit'} {'ShortDescription': 'Internet Gateway Limit', 'QuotaCollection': 'VPC', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of internet gateways', 'MaxValue': 3, 'UsedValue': 0, 'Name': 'igw_limit'} {'ShortDescription': 'Bypass VPC limit', 'QuotaCollection': 'VPC', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of firewall bypassing VPCs', 'MaxValue': 3, 'UsedValue': 0, 'Name': 'bypass_vpc_limit'} {'ShortDescription': 'Peering requests limit', 'QuotaCollection': 'VPC', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of peering connection in pending acceptance', 'MaxValue': 5, 'UsedValue': 0, 'Name': 'networklink_request_limit'} {'ShortDescription': 'Peering connection limit', 'QuotaCollection': 'VPC', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of available peering connections per VPC', 'MaxValue': 5, 'UsedValue': 0, 'Name': 'networklink_limit'} {'ShortDescription': 'VPC Endpoint Limit', 'QuotaCollection': 'VPC', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of VPC endpoints', 'MaxValue': 0, 'UsedValue': 0, 'Name': 'network_endpoint_limit'} {'ShortDescription': 'Nat Gateway Limit', 'QuotaCollection': 'VPC', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of NAT gateways', 'MaxValue': 1, 'UsedValue': 0, 'Name': 'nat_gateway_limit'} {'ShortDescription': 'VPN Gateway Limit', 'QuotaCollection': 'VPN', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of VPN gateways', 'MaxValue': 1, 'UsedValue': 0, 'Name': 'vpg_limit'} {'ShortDescription': 'Customer Gateway Limit', 'QuotaCollection': 'VPN', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of CGW gateways', 'MaxValue': 2, 'UsedValue': 0, 'Name': 'cgw_limit'} {'ShortDescription': 'BGP Route Limit', 'QuotaCollection': 'VPN', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number BGP advertised routes per VPN connection', 'MaxValue': 1, 'UsedValue': 0, 'Name': 'bgp_route_limit'} {'ShortDescription': 'Static Route Limit', 'QuotaCollection': 'VPN', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of static routes per VPN connection', 'MaxValue': 1, 'UsedValue': 0, 'Name': 'static_route_limit'} {'ShortDescription': 'Load Balancer Limit', 'QuotaCollection': 'LBU', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of load balancers per region', 'MaxValue': 2, 'UsedValue': 1, 'Name': 'lb_limit'} {'ShortDescription': 'Load Balancer Listener Rules Limit', 'QuotaCollection': 'LBU', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of listener rules for an account', 'MaxValue': 1, 'UsedValue': 0, 'Name': 'lb_rules_limit'} {'ShortDescription': 'Direct Link Connection Limit', 'QuotaCollection': 'Direct Link', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of Direct Link connections', 'MaxValue': 0, 'UsedValue': 0, 'Name': 'dl_connection_limit'} {'ShortDescription': 'Direct Link Interface Limit', 'QuotaCollection': 'Direct Link', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number Direct Link interfaces per connections', 'MaxValue': 50, 'UsedValue': 0, 'Name': 'dl_interface_limit'} {'ShortDescription': 'Bypass Group Limit', 'QuotaCollection': 'Other', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of bypass group the user can own', 'MaxValue': 1, 'UsedValue': 0, 'Name': 'bypass_group_limit'} {'ShortDescription': 'Bypass Group Size Limit', 'QuotaCollection': 'Other', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum size of a bypass group', 'MaxValue': 0, 'UsedValue': 0, 'Name': 'bypass_group_size_limit'} {'ShortDescription': 'Customer master key limit', 'QuotaCollection': 'OKMS', 'AccountId': 'XXXXXXXXXXXX', 'Description': 'Maximum number of customer master key the user can own', 'MaxValue': 0, 'UsedValue': 0, 'Name': 'cmk_limit'}
It would be cool if global could be populated with REALLY ALL quotas, overall "UsedValue" can be of interest, but i could afford having "None" for sg_rules_limit in global, then cycle by myself the other section to figure it out.
I dont use the Quota API to know if i am far or close to it, i read it to know my limits, so, finding the limit by cycling through any other entry than the "global" one is a bit overkill, i would have prefer to get the max information in the global section.