Categorygithub.com/corellium/go-corellium-api-client
repositorypackage
0.0.0-20240320180151-31cbe9075818
Repository: https://github.com/corellium/go-corellium-api-client.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

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

ClassMethodHTTP requestDescription
AgentApiV1AgentAppReadyGet /v1/instances/{instanceId}/agent/v1/app/readyCheck if App subsystem is ready
AgentApiV1AgentDeleteFileDelete /v1/instances/{instanceId}/agent/v1/file/device/{filePath}Delete a File on VM
AgentApiV1AgentGetFileGet /v1/instances/{instanceId}/agent/v1/file/device/{filePath}Download a File from VM
AgentApiV1AgentGetTempFilenamePost /v1/instances/{instanceId}/agent/v1/file/tempGet the path for a new temp file
AgentApiV1AgentInstallAppPost /v1/instances/{instanceId}/agent/v1/app/installInstall App at path
AgentApiV1AgentInstallProfilePost /v1/instances/{instanceId}/agent/v1/profile/installInstall a Profile to VM
AgentApiV1AgentKillAppPost /v1/instances/{instanceId}/agent/v1/app/apps/{bundleId}/killKill an App
AgentApiV1AgentListAppIconsGet /v1/instances/{instanceId}/agent/v1/app/iconsList App Icons
AgentApiV1AgentListAppsGet /v1/instances/{instanceId}/agent/v1/app/appsList Apps
AgentApiV1AgentListAppsStatusGet /v1/instances/{instanceId}/agent/v1/app/apps/updateList Apps Status
AgentApiV1AgentListProfilesGet /v1/instances/{instanceId}/agent/v1/profile/profilesList Profiles
AgentApiV1AgentRunAppPost /v1/instances/{instanceId}/agent/v1/app/apps/{bundleId}/runRun an App
AgentApiV1AgentSetFileAttributesPatch /v1/instances/{instanceId}/agent/v1/file/device/{filePath}Change Attrs of a File on VM
AgentApiV1AgentSystemGetAdbAuthGet /v1/instances/{instanceId}/agent/v1/system/adbauthGet ADB Auth Setting (AOSP only)
AgentApiV1AgentSystemGetNetworkGet /v1/instances/{instanceId}/agent/v1/system/networkGet IP of eth0 (AOSP only)
AgentApiV1AgentSystemGetPropPost /v1/instances/{instanceId}/agent/v1/system/getpropGet System Property (AOSP only)
AgentApiV1AgentSystemInstallOpenGAppsPost /v1/instances/{instanceId}/agent/v1/system/install-opengappsInstall OpenGApps (AOSP only)
AgentApiV1AgentSystemLockPost /v1/instances/{instanceId}/agent/v1/system/lockLock Device (iOS Only)
AgentApiV1AgentSystemSetAdbAuthPut /v1/instances/{instanceId}/agent/v1/system/adbauthSet ADB Auth Setting (AOSP only)
AgentApiV1AgentSystemSetHostnamePost /v1/instances/{instanceId}/agent/v1/system/setHostnameSet Hostname of instance
AgentApiV1AgentSystemShutdownPost /v1/instances/{instanceId}/agent/v1/system/shutdownInstruct VM to halt
AgentApiV1AgentSystemUnlockPost /v1/instances/{instanceId}/agent/v1/system/unlockUnlock Device (iOS Only)
AgentApiV1AgentUninstallAppPost /v1/instances/{instanceId}/agent/v1/app/apps/{bundleId}/uninstallUninstall an App
AgentApiV1AgentUninstallProfileDelete /v1/instances/{instanceId}/agent/v1/profile/profiles/{profileId}Uninstall a Profile from VM
AgentApiV1AgentUploadFilePut /v1/instances/{instanceId}/agent/v1/file/device/{filePath}Upload a file to VM
AuthenticationApiV1AuthLoginPost /v1/auth/loginLog In
ConfigApiV1GetConfigGet /v1/configGet all configs
CoreTraceApiV1ClearCoreTraceDelete /v1/instances/{instanceId}/straceClear CoreTrace logs
CoreTraceApiV1ListThreadsGet /v1/instances/{instanceId}/strace/thread-listGet Running Threads (CoreTrace)
CoreTraceApiV1StartCoreTracePost /v1/instances/{instanceId}/strace/enableStart CoreTrace on an instance
CoreTraceApiV1StopCoreTracePost /v1/instances/{instanceId}/strace/disableStop CoreTrace on an instance.
DomainAuthProviderApiV1CreateDomainAuthProviderPost /v1/domain/{domainId}/authCreate a new auth provider for a domain
DomainAuthProviderApiV1DeleteDomainAuthProviderDelete /v1/domain/{domainId}/auth/{providerId}Delete an auth provider from a domain
DomainAuthProviderApiV1GetDomainAuthProvidersGet /v1/domain/{domainId}/authReturn all configured auth providers for a domain (including globally configured providers)
DomainAuthProviderApiV1UpdateDomainAuthProviderPut /v1/domain/{domainId}/auth/{providerId}Update an auth provider for a domain
HyperTraceApiV1BtracePreauthorizeGet /v1/instances/{instanceId}/btrace-authorizePre-authorize an btrace download
HyperTraceApiV1ClearHyperTraceDelete /v1/instances/{instanceId}/btraceClear HyperTrace logs
HyperTraceApiV1KcrangeGet /v1/instances/{instanceId}/btrace-kcrangeGet Kernel extension ranges
HyperTraceApiV1StartHyperTracePost /v1/instances/{instanceId}/btrace/enableStart HyperTrace on an instance
HyperTraceApiV1StopHyperTracePost /v1/instances/{instanceId}/btrace/disableStop HyperTrace on an instance.
HypervisorHooksApiV1ClearHyperTraceHooksPost /v1/instances/{instanceId}/hooks/clearClear Hooks on an instance
HypervisorHooksApiV1CreateHookPost /v1/instances/{instanceId}/hooksCreate hypervisor hook for Instance
HypervisorHooksApiV1DeleteHookDelete /v1/hooks/{hookId}Delete an existing hypervisor hook
HypervisorHooksApiV1ExecuteHyperTraceHooksPost /v1/instances/{instanceId}/hooks/executeExecute Hooks on an instance
HypervisorHooksApiV1GetHookByIdGet /v1/hooks/{hookId}Get hypervisor hook by id
HypervisorHooksApiV1GetHooksGet /v1/instances/{instanceId}/hooksGet all hypervisor hooks for Instance
HypervisorHooksApiV1UpdateHookPut /v1/hooks/{hookId}Update an existing hypervisor hook
ImagesApiV1CreateImagePost /v1/imagesCreate a new Image
ImagesApiV1DeleteImageDelete /v2/images/{imageId}Delete Image
ImagesApiV1GetImageGet /v1/images/{imageId}Get Image Metadata
ImagesApiV1GetImagesGet /v1/imagesGet all Images Metadata
ImagesApiV1UploadImageDataPost /v1/images/{imageId}Upload Image Data
InstancesApiV1BtracePreauthorizeGet /v1/instances/{instanceId}/btrace-authorizePre-authorize an btrace download
InstancesApiV1ClearCoreTraceDelete /v1/instances/{instanceId}/straceClear CoreTrace logs
InstancesApiV1ClearHyperTraceDelete /v1/instances/{instanceId}/btraceClear HyperTrace logs
InstancesApiV1ClearHyperTraceHooksPost /v1/instances/{instanceId}/hooks/clearClear Hooks on an instance
InstancesApiV1ClearInstancePanicsDelete /v1/instances/{instanceId}/panicsClear Panics
InstancesApiV1CreateInstancePost /v1/instancesCreate Instance
InstancesApiV1CreateSnapshotPost /v1/instances/{instanceId}/snapshotsCreate Instance Snapshot
InstancesApiV1DeleteInstanceDelete /v1/instances/{instanceId}Remove Instance
InstancesApiV1DeleteInstanceSnapshotDelete /v1/instances/{instanceId}/snapshots/{snapshotId}Delete a Snapshot
InstancesApiV1DisableExposePortPost /v1/instances/{instanceId}/exposeport/disableDisable an exposed port on an instance for device access.
InstancesApiV1EnableExposePortPost /v1/instances/{instanceId}/exposeport/enableEnable an exposed port on an instance for device access.
InstancesApiV1ExecuteHyperTraceHooksPost /v1/instances/{instanceId}/hooks/executeExecute Hooks on an instance
InstancesApiV1GetInstanceGet /v1/instances/{instanceId}Get Instance
InstancesApiV1GetInstanceConsoleGet /v1/instances/{instanceId}/consoleGet console websocket URL
InstancesApiV1GetInstanceConsoleLogGet /v1/instances/{instanceId}/consoleLogGet Console Log
InstancesApiV1GetInstanceGpiosGet /v1/instances/{instanceId}/gpiosGet Instance GPIOs
InstancesApiV1GetInstancePanicsGet /v1/instances/{instanceId}/panicsGet Panics
InstancesApiV1GetInstancePeripheralsGet /v1/instances/{instanceId}/peripheralsGet Instance Peripherals
InstancesApiV1GetInstanceRateGet /v1/instances/{instanceId}/rateGet rate information
InstancesApiV1GetInstanceScreenshotGet /v1/instances/{instanceId}/screenshot.{format}Get Instance Screenshot
InstancesApiV1GetInstanceSnapshotGet /v1/instances/{instanceId}/snapshots/{snapshotId}Get Instance Snapshot
InstancesApiV1GetInstanceSnapshotsGet /v1/instances/{instanceId}/snapshotsGet Instance Snapshots
InstancesApiV1GetInstancesGet /v1/instancesGet Instances
InstancesApiV1InstancesInstanceIdMessagePostPost /v1/instances/{instanceId}/messageReceive a message on an iOS vm
InstancesApiV1InstancesInstanceIdNetdumpPcapGetGet /v1/instances/{instanceId}/netdump.pcapDownload a netdump pcap file
InstancesApiV1InstancesInstanceIdNetworkMonitorPcapGetGet /v1/instances/{instanceId}/networkMonitor.pcapDownload a Network Monitor pcap file
InstancesApiV1KcrangeGet /v1/instances/{instanceId}/btrace-kcrangeGet Kernel extension ranges
InstancesApiV1ListThreadsGet /v1/instances/{instanceId}/strace/thread-listGet Running Threads (CoreTrace)
InstancesApiV1MediaPlayPost /v1/instances/{instanceId}/media/playStart playing media
InstancesApiV1MediaStopPost /v1/instances/{instanceId}/media/stopStop playing media
InstancesApiV1PatchInstancePatch /v1/instances/{instanceId}Update Instance
InstancesApiV1PauseInstancePost /v1/instances/{instanceId}/pausePause an Instance
InstancesApiV1PostInstanceInputPost /v1/instances/{instanceId}/inputProvide Instance Input
InstancesApiV1RebootInstancePost /v1/instances/{instanceId}/rebootReboot an Instance
InstancesApiV1RenameInstanceSnapshotPatch /v1/instances/{instanceId}/snapshots/{snapshotId}Rename a Snapshot
InstancesApiV1RestoreBackupPost /v1/instances/{instanceId}/restoreBackupRestore backup
InstancesApiV1RestoreInstanceSnapshotPost /v1/instances/{instanceId}/snapshots/{snapshotId}/restoreRestore a Snapshot
InstancesApiV1RotateInstancePost /v1/instances/{instanceId}/rotateRotate device to specified orientation
InstancesApiV1SetInstanceGpiosPut /v1/instances/{instanceId}/gpiosSet Instance GPIOs
InstancesApiV1SetInstancePeripheralsPut /v1/instances/{instanceId}/peripheralsSet Instance Peripherals
InstancesApiV1SetInstanceStatePut /v1/instances/{instanceId}/stateSet state of Instance
InstancesApiV1StartCoreTracePost /v1/instances/{instanceId}/strace/enableStart CoreTrace on an instance
InstancesApiV1StartHyperTracePost /v1/instances/{instanceId}/btrace/enableStart HyperTrace on an instance
InstancesApiV1StartInstancePost /v1/instances/{instanceId}/startStart an Instance
InstancesApiV1StartNetdumpPost /v1/instances/{instanceId}/netdump/enableStart Enhanced Network Monitor on an instance.
InstancesApiV1StartNetworkMonitorPost /v1/instances/{instanceId}/sslsplit/enableStart Network Monitor on an instance.
InstancesApiV1StopCoreTracePost /v1/instances/{instanceId}/strace/disableStop CoreTrace on an instance.
InstancesApiV1StopHyperTracePost /v1/instances/{instanceId}/btrace/disableStop HyperTrace on an instance.
InstancesApiV1StopInstancePost /v1/instances/{instanceId}/stopStop an Instance
InstancesApiV1StopNetdumpPost /v1/instances/{instanceId}/netdump/disableStop Enhanced Network Monitor on an instance.
InstancesApiV1StopNetworkMonitorPost /v1/instances/{instanceId}/sslsplit/disableStop Network Monitor on an instance.
InstancesApiV1UnpauseInstancePost /v1/instances/{instanceId}/unpauseUnpause an Instance
InstancesApiV1UpgradeInstancePost /v1/instances/{instanceId}/upgradeUpgrade iOS version
InstancesApiV2GetInstanceQuickConnectCommandGet /v2/instances/{instanceId}/quickConnectCommandRecommended SSH Command for Quick Connect
InstancesApiV2GetInstanceStateGet /v2/instances/{instanceId}/stateGet state of Instance
LicensingApiV1GetSupportedFeaturesGet /v1/license/featuresGet all supported features for user
ModelsApiV1GetModelSoftwareGet /v1/models/{model}/softwareGet Software for Model
ModelsApiV1GetModelsGet /v1/modelsGet Supported Models
NetdumpApiV1InstancesInstanceIdNetdumpPcapGetGet /v1/instances/{instanceId}/netdump.pcapDownload a netdump pcap file
NetdumpApiV1StartNetdumpPost /v1/instances/{instanceId}/netdump/enableStart Enhanced Network Monitor on an instance.
NetdumpApiV1StopNetdumpPost /v1/instances/{instanceId}/netdump/disableStop Enhanced Network Monitor on an instance.
ProjectsApiV1AddProjectKeyPost /v1/projects/{projectId}/keysAdd Project Authorized Key
ProjectsApiV1CreateProjectPost /v1/projectsCreate a Project
ProjectsApiV1DeleteProjectDelete /v1/projects/{projectId}Delete a Project
ProjectsApiV1GetProjectGet /v1/projects/{projectId}Get a Project
ProjectsApiV1GetProjectInstancesGet /v1/projects/{projectId}/instancesGet Instances in Project
ProjectsApiV1GetProjectKeysGet /v1/projects/{projectId}/keysGet Project Authorized Keys
ProjectsApiV1GetProjectVpnConfigGet /v1/projects/{projectId}/vpnconfig/{format}Get Project VPN Configuration
ProjectsApiV1GetProjectsGet /v1/projectsGet Projects
ProjectsApiV1RemoveProjectKeyDelete /v1/projects/{projectId}/keys/{keyId}Delete Project Authorized Key
ProjectsApiV1UpdateProjectPatch /v1/projects/{projectId}Update a Project
ProjectsApiV1UpdateProjectSettingsPatch /v1/projects/{projectId}/settingsChange Project Settings
RolesApiV1AddTeamRoleToProjectPut /v1/roles/projects/{projectId}/teams/{teamId}/roles/{roleId}Add team role to project
RolesApiV1AddUserRoleToProjectPut /v1/roles/projects/{projectId}/users/{userId}/roles/{roleId}Add user role to project
RolesApiV1RemoveTeamRoleFromProjectDelete /v1/roles/projects/{projectId}/teams/{teamId}/roles/{roleId}Remove team role from project
RolesApiV1RemoveUserRoleFromProjectDelete /v1/roles/projects/{projectId}/users/{userId}/roles/{roleId}Remove user role from project
RolesApiV1RolesGet /v1/rolesGet all roles
SnapshotsApiV1CreateSnapshotPost /v1/instances/{instanceId}/snapshotsCreate Instance Snapshot
SnapshotsApiV1DeleteInstanceSnapshotDelete /v1/instances/{instanceId}/snapshots/{snapshotId}Delete a Snapshot
SnapshotsApiV1DeleteSnapshotDelete /v1/snapshots/{snapshotId}Delete a Snapshot
SnapshotsApiV1DeleteSnapshotPermissionsDelete /v1/snapshots/{snapshotId}/permissionsRemove a user from the list of users who have access to the snapshot
SnapshotsApiV1GetInstanceSnapshotGet /v1/instances/{instanceId}/snapshots/{snapshotId}Get Instance Snapshot
SnapshotsApiV1GetInstanceSnapshotsGet /v1/instances/{instanceId}/snapshotsGet Instance Snapshots
SnapshotsApiV1GetSharedSnapshotsGet /v1/snapshotsFetch snapshots shared with and shared by the requesting user
SnapshotsApiV1GetSnapshotGet /v1/snapshots/{snapshotId}Get Snapshot
SnapshotsApiV1RenameInstanceSnapshotPatch /v1/instances/{instanceId}/snapshots/{snapshotId}Rename a Snapshot
SnapshotsApiV1RestoreInstanceSnapshotPost /v1/instances/{instanceId}/snapshots/{snapshotId}/restoreRestore a Snapshot
SnapshotsApiV1SetSnapshotPermissionsPost /v1/snapshots/{snapshotId}/permissionsAdd a user to the list of users who have access to the snapshot
SnapshotsApiV1SnapshotRenamePatch /v1/snapshots/{snapshotId}Rename a Snapshot
StatusApiV1ReadyGet /v1/readyAPI Status
TeamsApiV1AddUserToTeamPut /v1/teams/{teamId}/users/{userId}Add user to team
TeamsApiV1RemoveUserFromTeamDelete /v1/teams/{teamId}/users/{userId}Remove user from team
TeamsApiV1TeamChangePatch /v1/teams/{teamId}Update team
TeamsApiV1TeamCreatePost /v1/teamsCreate team
TeamsApiV1TeamDeleteDelete /v1/teams/{teamId}Delete team
TeamsApiV1TeamsGet /v1/teamsGet teams
TrialRequestsApiV1CreateSubscriberInvitePost /v1/billing/invitesCreate Subscriber Invite
UsersApiV1CreateUserPost /v1/usersCreate User
UsersApiV1DeleteUserDelete /v1/users/{userId}Delete User
UsersApiV1GetResetLinkInfoGet /v1/users/reset-link-infoSend Password Reset Link Info
UsersApiV1ResetUserPasswordPost /v1/users/reset-passwordReset User Password
UsersApiV1SendUserResetLinkPost /v1/users/send-reset-linkSend Password Reset Link
UsersApiV1UpdateUserPatch /v1/users/{userId}Update User
UsersApiV1UserAgreeTermsPost /v1/users/agreeConsent to the current terms and conditions
UsersApiV1UsersChangePasswordPostPost /v1/users/change-passwordChange User Password
UsersApiV1UsersLoginPost /v1/users/loginLog 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