Overview
IAM
- Account
- Users
- API Tokens
CDN
- IP addresses list
- CDN service
- Origins
- CDN resources
- CDN activity logs
- Log forwarding
- Log viewer
- Logs uploader
- Tools
- Rules
- Rule templates
- Purge history
- SSL certificates
- CA certificates
- CDN Statistics
- Advanced analytics
- Origin shielding
- Let's Encrypt certificates
Managed DNS
- Analyze
- Locations
- Lookup
- Metrics
- Pickers
- DNS Clients
- Zones
- DNSSEC
- RRsets
Cloud
- Bare Metal
- Container as a Service
- Cost Reports
- DDOS Protection
- File Shares
- Firewalls
- Floating IPs
- Function as a Service
- GPU Cloud
- IP Ranges
- Images
- Inference Instances
- Instances
- GETList apptemplates
- GETGet apptemplate
- GETList instance flavors
- GETSearch instances across all reseller clients
- GETList instances
- POSTList suitable flavors for instance creation
- GETDeprecated. Get instance naming restrictions that are applied to specified project and region.deprecated
- GETGet instance
- DELDelete instance
- PATCHRename instance
- POSTAssign security group
- POSTAttach interface
- GETList suitable flavors for instance resize
- POSTResize instance
- POSTUn-assign security group
- POSTDetach interface
- GETGet instance console URL
- GETList network interfaces
- GETList instance tags
- PUTReplace tags
- POSTCreate or update tags
- GETGet instance tag
- DELDelete instance tag
- POSTGet instance metrics
- GETList network ports
- POSTDeprecated. Powercycle instancedeprecated
- POSTPut instance into the server group
- POSTDeprecated. Reboot instancedeprecated
- POSTRemove instance from the server group
- POSTDeprecated. Resume instancedeprecated
- GETGet instance security groups
- POSTDeprecated. Start instancedeprecated
- POSTDeprecated. Stop instancedeprecated
- POSTDeprecated. Suspend instancedeprecated
- PUTDeprecated. Assign allowed address pairs for instance portdeprecated
- POSTDisable port security for instance interface
- POSTEnable port security for instance interface
- GETGet instance price
- GETList name template configs of the reseller.
- PUTUpdate or create reseller naming configuration.
- GETGet naming restrictions that are applied to specified project and region.
- DELDelete the reseller's name_templates setting and drop all naming restrictions on the region.
- GETFilter instances by security group
- POSTCreate instance
- POSTCheck quota for instance creation
- POSTPerform a specific action on an instance.
- GETGet instance tag by key
- DELDelete instance tag by key
- PUTAssign allowed address pairs for instance port
- POSTPreview instance price
- GET
- Load Balancers
- Logging
- Managed Kubernetes
- Managed PostgreSQL
- Networks
- Placement Groups
- Projects
- Quotas
- Regions
- Registry
- Reservations
- Reserved IPs
- Routers
- SSH Keys
- Secrets
- Service Endpoints
- Snapshot Schedules
- Snapshots
- Tasks
- User Actions
- User Role Assignments
- Volumes
Security
- Event Logs
- BGP announces
- Security Templates
- Profiles
FastEdge
- Apps
- Binaries
- FastEdge Clients
- FastEdge Secrets
- Stats
- FastEdge Templates
WAAP
- WAAP Service
- Domains
- Policies
- Analytics
- Custom Page Sets
- Custom Rules
- Firewall Rules
- Advanced Rules
- Tags
- Network Organizations
- API Discovery
- IP Spotlight
- Security Insights
Web Security
- Billing Statistics
- Resources
Video Streaming
- Streams
- Overlays
- Broadcasts
- Restreams
- Videos
- Subtitles
- Directories
- Playlists
- QualitySets
- Players
- AI
- Streaming Statistics
Object Storage
- Notifications
- Key
- Location
- Storage
- Storage Statistics
Instances
Get instance metrics
Get instance metrics, including cpu, memory, network and disk metrics
POST
/
cloud
/
v1
/
instances
/
{project_id}
/
{region_id}
/
{instance_id}
/
metrics
Copy
Ask AI
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
metrics_list = client.cloud.instances.metrics.list(
instance_id="instance_id",
project_id=0,
region_id=0,
time_interval=6,
time_unit="day",
)
print(metrics_list.count)
Copy
Ask AI
{
"count": 1,
"results": [
{
"cpu_util": 8,
"disks": [
{
"disk_Bps_read": 16384,
"disk_Bps_write": 86016,
"disk_iops_read": 3,
"disk_iops_write": 12,
"disk_name": "sda"
},
{
"disk_Bps_read": 163840,
"disk_Bps_write": 860160,
"disk_iops_read": 30,
"disk_iops_write": 120,
"disk_name": "sdb"
}
],
"memory_util": 33.28411162695459,
"network_Bps_egress": 102,
"network_Bps_ingress": 102,
"network_pps_egress": 0.7,
"network_pps_ingress": 0.7,
"time": "2020-07-07T12:57:00Z"
}
]
}
Authorizations
API key for authentication.
Path Parameters
Project ID
Region ID
Instance ID
Body
application/json
Time range and time unit, required to obtain instance metrics. Available intervals are 1h, 6h, 24h, 7 days, 14 days. Time delta in the results is fixed and depends on the time range: 1h - 15 seconds, 6h - 20 seconds, 24h - 2 minutes, 7 days - 10 minutes, 14 days - 20 minutes.
Response
200 - application/json
OK
The response is of type object
.
Was this page helpful?
Copy
Ask AI
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
metrics_list = client.cloud.instances.metrics.list(
instance_id="instance_id",
project_id=0,
region_id=0,
time_interval=6,
time_unit="day",
)
print(metrics_list.count)
Copy
Ask AI
{
"count": 1,
"results": [
{
"cpu_util": 8,
"disks": [
{
"disk_Bps_read": 16384,
"disk_Bps_write": 86016,
"disk_iops_read": 3,
"disk_iops_write": 12,
"disk_name": "sda"
},
{
"disk_Bps_read": 163840,
"disk_Bps_write": 860160,
"disk_iops_read": 30,
"disk_iops_write": 120,
"disk_name": "sdb"
}
],
"memory_util": 33.28411162695459,
"network_Bps_egress": 102,
"network_Bps_ingress": 102,
"network_pps_egress": 0.7,
"network_pps_ingress": 0.7,
"time": "2020-07-07T12:57:00Z"
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.