Skip to main content
GET
/
cloud
/
v1
/
user_actions
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
page = client.cloud.audit_logs.list()
page = page.results[0]
print(page.id)
{
  "count": 1,
  "results": [
    {
      "acknowledged": true,
      "action_data": {},
      "action_type": "activate",
      "api_group": "ai_cluster",
      "client_id": 10,
      "email": "[email protected]",
      "id": "<string>",
      "is_complete": true,
      "issued_by_user_id": 222324,
      "project_id": 1,
      "region_id": 4,
      "resources": [
        {
          "resource_id": "<string>",
          "resource_type": "caas_container",
          "resource_body": {
            "key": "value"
          },
          "search_field": "name"
        }
      ],
      "source_user_ip": "1.2.3.4",
      "task_id": "1bdcc138-e716-41ff-ad8d-3477a7ac6d14",
      "timestamp": "2023-11-07T05:31:56Z",
      "token_id": 192021,
      "total_price": {
        "currency_code": "USD",
        "price_per_hour": 0.01,
        "price_per_month": 7.2,
        "price_status": "error"
      },
      "user_agent": "Mozilla/5.0",
      "user_id": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Query Parameters

action_type
enum<string>[]

User action type. Several options can be specified.

Available options:
activate,
attach,
change_logging_resources,
create,
create_access_rule,
deactivate,
delete,
delete_access_rule,
delete_metadata,
detach,
disable_logging,
disable_portsecurity,
download,
enable_logging,
enable_portsecurity,
failover,
put_into_servergroup,
reboot,
reboot_hard,
rebuild,
regenerate_credentials,
remove_from_servergroup,
replace_metadata,
resize,
resume,
retype,
revert,
scale_down,
scale_up,
start,
stop,
suspend,
update,
update_metadata,
upgrade
api_group
enum<string>[]

API group that requested action belongs to. Several options can be specified.

Available options:
ai_cluster,
backup_service,
caas_container,
caas_key,
caas_pull_secret,
dbaas_postgres,
ddos_profile,
faas_function,
faas_key,
faas_namespace,
file_shares,
floating_ip,
image,
inference_at_the_edge,
instance,
instance_isolation,
k8s_cluster,
k8s_cluster_template,
k8s_pool,
laas,
laas_topic,
lb_health_monitor,
lb_l7policy,
lb_l7rule,
lblistener,
lbpool,
lbpool_member,
lifecycle_policy,
lifecycle_policy_volume_member,
loadbalancer,
network,
port,
project,
quota_limit_request,
registry,
reservation,
reserved_fixed_ip,
role,
router,
secret,
securitygroup,
securitygrouprule,
servergroup,
shared_flavor,
shared_image,
shared_network,
snapshot,
snapshot_schedule,
ssh_key,
subnet,
user,
vip_ip_addresses,
volume
from_timestamp
string<date-time>

ISO formatted datetime string. Starting timestamp from which user actions are requested

limit
integer
default:1000

Optional. Limit the number of returned items

Required range: x <= 1000
offset
integer
default:0

Optional. Offset value is used to exclude the first set of records from the result

Required range: x >= 0
order_by
enum<string>
default:desc

Sorting by timestamp. Oldest first, or most recent first

Available options:
asc,
desc
project_id
integer<int64>[]

Project ID. Several options can be specified.

region_id
integer<int64>[]

Region ID. Several options can be specified.

resource_id
string[]

Resource ID. Several options can be specified.

search_field
string

Extra search field for common object properties such as name, IP address, or other, depending on the resource_type

sorting
enum<string>
default:desc
deprecated

(DEPRECATED Use 'order_by' instead) Sorting by timestamp. Oldest first, or most recent first

Available options:
asc,
desc
source_user_ips
string[]

Originating IP address of the client making the request. Several options can be specified.

to_timestamp
string<date-time>

ISO formatted datetime string. Ending timestamp until which user actions are requested

user_agents
string[]

User-Agent string identifying the client making the request. Several options can be specified.

Response

200 - application/json

OK

count
integer
required

Number of objects

Required range: x >= 0
results
UserAction schema · object[]
required

Objects