Skip to content

Latest commit

 

History

History
395 lines (351 loc) · 32.5 KB

README.md

File metadata and controls

395 lines (351 loc) · 32.5 KB

Go API client for corellium

REST API to manage your virtual devices.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 6.1.0-20784
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import corellium "github.com/corellium/go-corellium-api-client"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), corellium.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), corellium.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), corellium.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), corellium.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://app.corellium.com/api

Class Method HTTP request Description
AgentApi V1AgentAppReady Get /v1/instances/{instanceId}/agent/v1/app/ready Check if App subsystem is ready
AgentApi V1AgentDeleteFile Delete /v1/instances/{instanceId}/agent/v1/file/device/{filePath} Delete a File on VM
AgentApi V1AgentGetFile Get /v1/instances/{instanceId}/agent/v1/file/device/{filePath} Download a File from VM
AgentApi V1AgentGetTempFilename Post /v1/instances/{instanceId}/agent/v1/file/temp Get the path for a new temp file
AgentApi V1AgentInstallApp Post /v1/instances/{instanceId}/agent/v1/app/install Install App at path
AgentApi V1AgentInstallProfile Post /v1/instances/{instanceId}/agent/v1/profile/install Install a Profile to VM
AgentApi V1AgentKillApp Post /v1/instances/{instanceId}/agent/v1/app/apps/{bundleId}/kill Kill an App
AgentApi V1AgentListAppIcons Get /v1/instances/{instanceId}/agent/v1/app/icons List App Icons
AgentApi V1AgentListApps Get /v1/instances/{instanceId}/agent/v1/app/apps List Apps
AgentApi V1AgentListAppsStatus Get /v1/instances/{instanceId}/agent/v1/app/apps/update List Apps Status
AgentApi V1AgentListProfiles Get /v1/instances/{instanceId}/agent/v1/profile/profiles List Profiles
AgentApi V1AgentRunApp Post /v1/instances/{instanceId}/agent/v1/app/apps/{bundleId}/run Run an App
AgentApi V1AgentSetFileAttributes Patch /v1/instances/{instanceId}/agent/v1/file/device/{filePath} Change Attrs of a File on VM
AgentApi V1AgentSystemGetAdbAuth Get /v1/instances/{instanceId}/agent/v1/system/adbauth Get ADB Auth Setting (AOSP only)
AgentApi V1AgentSystemGetNetwork Get /v1/instances/{instanceId}/agent/v1/system/network Get IP of eth0 (AOSP only)
AgentApi V1AgentSystemGetProp Post /v1/instances/{instanceId}/agent/v1/system/getprop Get System Property (AOSP only)
AgentApi V1AgentSystemInstallOpenGApps Post /v1/instances/{instanceId}/agent/v1/system/install-opengapps Install OpenGApps (AOSP only)
AgentApi V1AgentSystemLock Post /v1/instances/{instanceId}/agent/v1/system/lock Lock Device (iOS Only)
AgentApi V1AgentSystemSetAdbAuth Put /v1/instances/{instanceId}/agent/v1/system/adbauth Set ADB Auth Setting (AOSP only)
AgentApi V1AgentSystemSetHostname Post /v1/instances/{instanceId}/agent/v1/system/setHostname Set Hostname of instance
AgentApi V1AgentSystemShutdown Post /v1/instances/{instanceId}/agent/v1/system/shutdown Instruct VM to halt
AgentApi V1AgentSystemUnlock Post /v1/instances/{instanceId}/agent/v1/system/unlock Unlock Device (iOS Only)
AgentApi V1AgentUninstallApp Post /v1/instances/{instanceId}/agent/v1/app/apps/{bundleId}/uninstall Uninstall an App
AgentApi V1AgentUninstallProfile Delete /v1/instances/{instanceId}/agent/v1/profile/profiles/{profileId} Uninstall a Profile from VM
AgentApi V1AgentUploadFile Put /v1/instances/{instanceId}/agent/v1/file/device/{filePath} Upload a file to VM
AuthenticationApi V1AuthLogin Post /v1/auth/login Log In
ConfigApi V1GetConfig Get /v1/config Get all configs
CoreTraceApi V1ClearCoreTrace Delete /v1/instances/{instanceId}/strace Clear CoreTrace logs
CoreTraceApi V1ListThreads Get /v1/instances/{instanceId}/strace/thread-list Get Running Threads (CoreTrace)
CoreTraceApi V1StartCoreTrace Post /v1/instances/{instanceId}/strace/enable Start CoreTrace on an instance
CoreTraceApi V1StopCoreTrace Post /v1/instances/{instanceId}/strace/disable Stop CoreTrace on an instance.
DomainAuthProviderApi V1CreateDomainAuthProvider Post /v1/domain/{domainId}/auth Create a new auth provider for a domain
DomainAuthProviderApi V1DeleteDomainAuthProvider Delete /v1/domain/{domainId}/auth/{providerId} Delete an auth provider from a domain
DomainAuthProviderApi V1GetDomainAuthProviders Get /v1/domain/{domainId}/auth Return all configured auth providers for a domain (including globally configured providers)
DomainAuthProviderApi V1UpdateDomainAuthProvider Put /v1/domain/{domainId}/auth/{providerId} Update an auth provider for a domain
HyperTraceApi V1BtracePreauthorize Get /v1/instances/{instanceId}/btrace-authorize Pre-authorize an btrace download
HyperTraceApi V1ClearHyperTrace Delete /v1/instances/{instanceId}/btrace Clear HyperTrace logs
HyperTraceApi V1Kcrange Get /v1/instances/{instanceId}/btrace-kcrange Get Kernel extension ranges
HyperTraceApi V1StartHyperTrace Post /v1/instances/{instanceId}/btrace/enable Start HyperTrace on an instance
HyperTraceApi V1StopHyperTrace Post /v1/instances/{instanceId}/btrace/disable Stop HyperTrace on an instance.
HypervisorHooksApi V1ClearHyperTraceHooks Post /v1/instances/{instanceId}/hooks/clear Clear Hooks on an instance
HypervisorHooksApi V1CreateHook Post /v1/instances/{instanceId}/hooks Create hypervisor hook for Instance
HypervisorHooksApi V1DeleteHook Delete /v1/hooks/{hookId} Delete an existing hypervisor hook
HypervisorHooksApi V1ExecuteHyperTraceHooks Post /v1/instances/{instanceId}/hooks/execute Execute Hooks on an instance
HypervisorHooksApi V1GetHookById Get /v1/hooks/{hookId} Get hypervisor hook by id
HypervisorHooksApi V1GetHooks Get /v1/instances/{instanceId}/hooks Get all hypervisor hooks for Instance
HypervisorHooksApi V1UpdateHook Put /v1/hooks/{hookId} Update an existing hypervisor hook
ImagesApi V1CreateImage Post /v1/images Create a new Image
ImagesApi V1DeleteImage Delete /v2/images/{imageId} Delete Image
ImagesApi V1GetImage Get /v1/images/{imageId} Get Image Metadata
ImagesApi V1GetImages Get /v1/images Get all Images Metadata
ImagesApi V1UploadImageData Post /v1/images/{imageId} Upload Image Data
InstancesApi V1BtracePreauthorize Get /v1/instances/{instanceId}/btrace-authorize Pre-authorize an btrace download
InstancesApi V1ClearCoreTrace Delete /v1/instances/{instanceId}/strace Clear CoreTrace logs
InstancesApi V1ClearHyperTrace Delete /v1/instances/{instanceId}/btrace Clear HyperTrace logs
InstancesApi V1ClearHyperTraceHooks Post /v1/instances/{instanceId}/hooks/clear Clear Hooks on an instance
InstancesApi V1ClearInstancePanics Delete /v1/instances/{instanceId}/panics Clear Panics
InstancesApi V1CreateInstance Post /v1/instances Create Instance
InstancesApi V1CreateSnapshot Post /v1/instances/{instanceId}/snapshots Create Instance Snapshot
InstancesApi V1DeleteInstance Delete /v1/instances/{instanceId} Remove Instance
InstancesApi V1DeleteInstanceSnapshot Delete /v1/instances/{instanceId}/snapshots/{snapshotId} Delete a Snapshot
InstancesApi V1DisableExposePort Post /v1/instances/{instanceId}/exposeport/disable Disable an exposed port on an instance for device access.
InstancesApi V1EnableExposePort Post /v1/instances/{instanceId}/exposeport/enable Enable an exposed port on an instance for device access.
InstancesApi V1ExecuteHyperTraceHooks Post /v1/instances/{instanceId}/hooks/execute Execute Hooks on an instance
InstancesApi V1GetInstance Get /v1/instances/{instanceId} Get Instance
InstancesApi V1GetInstanceConsole Get /v1/instances/{instanceId}/console Get console websocket URL
InstancesApi V1GetInstanceConsoleLog Get /v1/instances/{instanceId}/consoleLog Get Console Log
InstancesApi V1GetInstanceGpios Get /v1/instances/{instanceId}/gpios Get Instance GPIOs
InstancesApi V1GetInstancePanics Get /v1/instances/{instanceId}/panics Get Panics
InstancesApi V1GetInstancePeripherals Get /v1/instances/{instanceId}/peripherals Get Instance Peripherals
InstancesApi V1GetInstanceRate Get /v1/instances/{instanceId}/rate Get rate information
InstancesApi V1GetInstanceScreenshot Get /v1/instances/{instanceId}/screenshot.{format} Get Instance Screenshot
InstancesApi V1GetInstanceSnapshot Get /v1/instances/{instanceId}/snapshots/{snapshotId} Get Instance Snapshot
InstancesApi V1GetInstanceSnapshots Get /v1/instances/{instanceId}/snapshots Get Instance Snapshots
InstancesApi V1GetInstances Get /v1/instances Get Instances
InstancesApi V1InstancesInstanceIdMessagePost Post /v1/instances/{instanceId}/message Receive a message on an iOS vm
InstancesApi V1InstancesInstanceIdNetdumpPcapGet Get /v1/instances/{instanceId}/netdump.pcap Download a netdump pcap file
InstancesApi V1InstancesInstanceIdNetworkMonitorPcapGet Get /v1/instances/{instanceId}/networkMonitor.pcap Download a Network Monitor pcap file
InstancesApi V1Kcrange Get /v1/instances/{instanceId}/btrace-kcrange Get Kernel extension ranges
InstancesApi V1ListThreads Get /v1/instances/{instanceId}/strace/thread-list Get Running Threads (CoreTrace)
InstancesApi V1MediaPlay Post /v1/instances/{instanceId}/media/play Start playing media
InstancesApi V1MediaStop Post /v1/instances/{instanceId}/media/stop Stop playing media
InstancesApi V1PatchInstance Patch /v1/instances/{instanceId} Update Instance
InstancesApi V1PauseInstance Post /v1/instances/{instanceId}/pause Pause an Instance
InstancesApi V1PostInstanceInput Post /v1/instances/{instanceId}/input Provide Instance Input
InstancesApi V1RebootInstance Post /v1/instances/{instanceId}/reboot Reboot an Instance
InstancesApi V1RenameInstanceSnapshot Patch /v1/instances/{instanceId}/snapshots/{snapshotId} Rename a Snapshot
InstancesApi V1RestoreBackup Post /v1/instances/{instanceId}/restoreBackup Restore backup
InstancesApi V1RestoreInstanceSnapshot Post /v1/instances/{instanceId}/snapshots/{snapshotId}/restore Restore a Snapshot
InstancesApi V1RotateInstance Post /v1/instances/{instanceId}/rotate Rotate device to specified orientation
InstancesApi V1SetInstanceGpios Put /v1/instances/{instanceId}/gpios Set Instance GPIOs
InstancesApi V1SetInstancePeripherals Put /v1/instances/{instanceId}/peripherals Set Instance Peripherals
InstancesApi V1SetInstanceState Put /v1/instances/{instanceId}/state Set state of Instance
InstancesApi V1StartCoreTrace Post /v1/instances/{instanceId}/strace/enable Start CoreTrace on an instance
InstancesApi V1StartHyperTrace Post /v1/instances/{instanceId}/btrace/enable Start HyperTrace on an instance
InstancesApi V1StartInstance Post /v1/instances/{instanceId}/start Start an Instance
InstancesApi V1StartNetdump Post /v1/instances/{instanceId}/netdump/enable Start Enhanced Network Monitor on an instance.
InstancesApi V1StartNetworkMonitor Post /v1/instances/{instanceId}/sslsplit/enable Start Network Monitor on an instance.
InstancesApi V1StopCoreTrace Post /v1/instances/{instanceId}/strace/disable Stop CoreTrace on an instance.
InstancesApi V1StopHyperTrace Post /v1/instances/{instanceId}/btrace/disable Stop HyperTrace on an instance.
InstancesApi V1StopInstance Post /v1/instances/{instanceId}/stop Stop an Instance
InstancesApi V1StopNetdump Post /v1/instances/{instanceId}/netdump/disable Stop Enhanced Network Monitor on an instance.
InstancesApi V1StopNetworkMonitor Post /v1/instances/{instanceId}/sslsplit/disable Stop Network Monitor on an instance.
InstancesApi V1UnpauseInstance Post /v1/instances/{instanceId}/unpause Unpause an Instance
InstancesApi V1UpgradeInstance Post /v1/instances/{instanceId}/upgrade Upgrade iOS version
InstancesApi V2GetInstanceQuickConnectCommand Get /v2/instances/{instanceId}/quickConnectCommand Recommended SSH Command for Quick Connect
InstancesApi V2GetInstanceState Get /v2/instances/{instanceId}/state Get state of Instance
LicensingApi V1GetSupportedFeatures Get /v1/license/features Get all supported features for user
ModelsApi V1GetModelSoftware Get /v1/models/{model}/software Get Software for Model
ModelsApi V1GetModels Get /v1/models Get Supported Models
NetdumpApi V1InstancesInstanceIdNetdumpPcapGet Get /v1/instances/{instanceId}/netdump.pcap Download a netdump pcap file
NetdumpApi V1StartNetdump Post /v1/instances/{instanceId}/netdump/enable Start Enhanced Network Monitor on an instance.
NetdumpApi V1StopNetdump Post /v1/instances/{instanceId}/netdump/disable Stop Enhanced Network Monitor on an instance.
ProjectsApi V1AddProjectKey Post /v1/projects/{projectId}/keys Add Project Authorized Key
ProjectsApi V1CreateProject Post /v1/projects Create a Project
ProjectsApi V1DeleteProject Delete /v1/projects/{projectId} Delete a Project
ProjectsApi V1GetProject Get /v1/projects/{projectId} Get a Project
ProjectsApi V1GetProjectInstances Get /v1/projects/{projectId}/instances Get Instances in Project
ProjectsApi V1GetProjectKeys Get /v1/projects/{projectId}/keys Get Project Authorized Keys
ProjectsApi V1GetProjectVpnConfig Get /v1/projects/{projectId}/vpnconfig/{format} Get Project VPN Configuration
ProjectsApi V1GetProjects Get /v1/projects Get Projects
ProjectsApi V1RemoveProjectKey Delete /v1/projects/{projectId}/keys/{keyId} Delete Project Authorized Key
ProjectsApi V1UpdateProject Patch /v1/projects/{projectId} Update a Project
ProjectsApi V1UpdateProjectSettings Patch /v1/projects/{projectId}/settings Change Project Settings
RolesApi V1AddTeamRoleToProject Put /v1/roles/projects/{projectId}/teams/{teamId}/roles/{roleId} Add team role to project
RolesApi V1AddUserRoleToProject Put /v1/roles/projects/{projectId}/users/{userId}/roles/{roleId} Add user role to project
RolesApi V1RemoveTeamRoleFromProject Delete /v1/roles/projects/{projectId}/teams/{teamId}/roles/{roleId} Remove team role from project
RolesApi V1RemoveUserRoleFromProject Delete /v1/roles/projects/{projectId}/users/{userId}/roles/{roleId} Remove user role from project
RolesApi V1Roles Get /v1/roles Get all roles
SnapshotsApi V1CreateSnapshot Post /v1/instances/{instanceId}/snapshots Create Instance Snapshot
SnapshotsApi V1DeleteInstanceSnapshot Delete /v1/instances/{instanceId}/snapshots/{snapshotId} Delete a Snapshot
SnapshotsApi V1DeleteSnapshot Delete /v1/snapshots/{snapshotId} Delete a Snapshot
SnapshotsApi V1DeleteSnapshotPermissions Delete /v1/snapshots/{snapshotId}/permissions Remove a user from the list of users who have access to the snapshot
SnapshotsApi V1GetInstanceSnapshot Get /v1/instances/{instanceId}/snapshots/{snapshotId} Get Instance Snapshot
SnapshotsApi V1GetInstanceSnapshots Get /v1/instances/{instanceId}/snapshots Get Instance Snapshots
SnapshotsApi V1GetSharedSnapshots Get /v1/snapshots Fetch snapshots shared with and shared by the requesting user
SnapshotsApi V1GetSnapshot Get /v1/snapshots/{snapshotId} Get Snapshot
SnapshotsApi V1RenameInstanceSnapshot Patch /v1/instances/{instanceId}/snapshots/{snapshotId} Rename a Snapshot
SnapshotsApi V1RestoreInstanceSnapshot Post /v1/instances/{instanceId}/snapshots/{snapshotId}/restore Restore a Snapshot
SnapshotsApi V1SetSnapshotPermissions Post /v1/snapshots/{snapshotId}/permissions Add a user to the list of users who have access to the snapshot
SnapshotsApi V1SnapshotRename Patch /v1/snapshots/{snapshotId} Rename a Snapshot
StatusApi V1Ready Get /v1/ready API Status
TeamsApi V1AddUserToTeam Put /v1/teams/{teamId}/users/{userId} Add user to team
TeamsApi V1RemoveUserFromTeam Delete /v1/teams/{teamId}/users/{userId} Remove user from team
TeamsApi V1TeamChange Patch /v1/teams/{teamId} Update team
TeamsApi V1TeamCreate Post /v1/teams Create team
TeamsApi V1TeamDelete Delete /v1/teams/{teamId} Delete team
TeamsApi V1Teams Get /v1/teams Get teams
TrialRequestsApi V1CreateSubscriberInvite Post /v1/billing/invites Create Subscriber Invite
UsersApi V1CreateUser Post /v1/users Create User
UsersApi V1DeleteUser Delete /v1/users/{userId} Delete User
UsersApi V1GetResetLinkInfo Get /v1/users/reset-link-info Send Password Reset Link Info
UsersApi V1ResetUserPassword Post /v1/users/reset-password Reset User Password
UsersApi V1SendUserResetLink Post /v1/users/send-reset-link Send Password Reset Link
UsersApi V1UpdateUser Patch /v1/users/{userId} Update User
UsersApi V1UserAgreeTerms Post /v1/users/agree Consent to the current terms and conditions
UsersApi V1UsersChangePasswordPost Post /v1/users/change-password Change User Password
UsersApi V1UsersLogin Post /v1/users/login Log In

Documentation For Models

Documentation For Authorization

BearerAuth

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author