Skip to content

Connections

A connection is one cloud account (an OCI compartment or a GCP project) with the credentials Mayadyn uses for it. Credentials are write-only: they are encrypted with a key specific to the workspace and no endpoint returns them. Every decryption is recorded in the audit log (connection.secret_used with its purpose).

Supported providers today are Oracle Cloud (oci) and Google Cloud (gcp). AWS and Microsoft Azure are coming soon.

Two kinds of credentials (auth_mode):

  • key: a stored cloud key (OCI API signing key, GCP service account key).
  • keyless: nothing secret is stored. The account trusts Mayadyn’s identity for this one connection; the owner sets that up in their cloud with the steps from GET /v1/connections/{ref}/setup.

Guides: Connect Oracle Cloud, Connect Google Cloud.

{ref} in paths is the connection’s id or its name.

status Meaning
active last verification succeeded
error last verification failed; status_message is <code>: <message> — <hint>
pending never verified (only if the verification after create could not run)

POST /v1/vms and POST /v1/apps refuse a connection in error with 424 connection_unhealthy.


List connections, by name.

Auth: scope read. Project tokens see their project’s only.

Response 200:

{"items": [
{"id": "9a7b6c5d-4e3f-4a2b-9c1d-0e8f7a6b5c4d", "project_id": "0c9d8e7f-1a2b-4c3d-8e5f-6a7b8c9d0e1f",
"provider": "oci", "name": "oci-jeddah", "default_region": "me-jeddah-1",
"account_ref": "ocid1.tenancy.oc1..aaaaaaaa5n3x...", "status": "active",
"last_verified_at": "2026-11-30T08:40:00Z", "created_at": "2026-10-05T11:00:00Z",
"auth_mode": "keyless"},
{"id": "c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f", "project_id": "0c9d8e7f-1a2b-4c3d-8e5f-6a7b8c9d0e1f",
"provider": "gcp", "name": "gcp-dammam", "default_region": "me-central2",
"account_ref": "acme-prod-482916", "status": "error",
"status_message": "auth_failed: ... — The service account key is invalid or was deleted; create a new key.",
"last_verified_at": "2026-11-30T08:41:00Z", "created_at": "2026-10-06T09:00:00Z",
"auth_mode": "key"}
]}

Fields: Connection.

Add a cloud account, then verify it at once.

Auth: scope admin (the verification that follows is part of the call).

Request body (CreateConnectionRequest)

Field Type Required Description
provider string yes oci or gcp
name string yes ^[a-z0-9][a-z0-9-]{0,62}$ (1–63, lowercase letters, digits, dashes), unique in the workspace, e.g. oci-jeddah
default_region string yes region used when a request names none, e.g. me-jeddah-1, me-central2 (^[a-z0-9][a-z0-9-]{1,40}$)
project_id string no project id or slug; default: the default project (a project token: its own)
credentials object yes provider-specific; see Credential formats
{
"provider": "oci",
"name": "oci-jeddah",
"default_region": "me-jeddah-1",
"credentials": {
"type": "mayadyn_admit",
"tenancy_ocid": "ocid1.tenancy.oc1..aaaaaaaa5n3x...",
"compartment_ocid": "ocid1.compartment.oc1..aaaaaaaaq7w2..."
}
}

Response 201 with the Connection after verification. A failed verification is not an error response: the connection is kept with status: "error" and the reason in status_message, so the account can be fixed and verified again. A new keyless connection is normally in error until its setup steps are done.

Errors

Status Code When
400 invalid_input bad name or region; “credentials are required”; credential fields invalid (message names them); key credentials while only keyless credentials are accepted (see Keyless-only mode)
400 unsupported unknown provider: “provider "x" is not available”
404 not_found “project not found”
409 conflict “a connection named X exists”
403 permission_denied no admin

Audit: connection.create (provider, name, region, auth_mode), then connection.secret_used (purpose verify) and connection.verify.

Terminal window
curl -s -X POST "$MAYADYN/v1/connections" -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"provider":"gcp","name":"gcp-dammam","default_region":"me-central2",
"credentials":{"type":"mayadyn_federated","project_id":"acme-prod-482916",
"workload_provider":"projects/123456789012/locations/global/workloadIdentityPools/mayadyn/providers/mayadyn-oidc",
"service_account":"mayadyn-vms@acme-prod-482916.iam.gserviceaccount.com"}}'

Get one connection.

Auth: scope read.

Response 200 (Connection). Errors: 404 “connection X not found”, hint “List connections to see their names.”

Call the cloud with the stored credentials and record the result.

Auth: scope write.

Request body: none.

Response 200 with the updated Connection (status active or error, last_verified_at, and account_ref as reported by the cloud). A cloud refusal is reported in the connection, not as an error response.

Errors: 404; 400 invalid_input when only keyless credentials are accepted and the connection still holds a stored key.

Notes: the cloud call has a 30-second timeout. Audit: connection.secret_used (purpose verify), connection.verify (result ok or error, with status and message).

Terminal window
curl -s -X POST "$MAYADYN/v1/connections/oci-jeddah/verify" -H "Authorization: Bearer $TOKEN"

What the account owner must do in their cloud so it trusts Mayadyn for this keyless connection.

Auth: scope read.

Response 200 (ConnectionSetup). GCP:

{
"connection": "gcp-dammam",
"provider": "gcp",
"issuer": "https://id.mayadyn.com",
"subject": "mayadyn:6f1c2a9e-3b7d-4c1e-9a52-1d8e4b7f0c31:c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f",
"audience": "//iam.googleapis.com/projects/123456789012/locations/global/workloadIdentityPools/mayadyn/providers/mayadyn-oidc",
"steps": [
"gcloud iam workload-identity-pools create mayadyn --project=acme-prod-482916 --location=global --display-name=\"Mayadyn\"",
"gcloud iam workload-identity-pools providers create-oidc mayadyn-oidc --project=acme-prod-482916 --location=global --workload-identity-pool=mayadyn --issuer-uri=https://id.mayadyn.com --allowed-audiences=//iam.googleapis.com/projects/123456789012/locations/global/workloadIdentityPools/mayadyn/providers/mayadyn-oidc --attribute-mapping=\"google.subject=assertion.sub\" --attribute-condition=\"assertion.sub == 'mayadyn:6f1c2a9e-3b7d-4c1e-9a52-1d8e4b7f0c31:c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f'\"",
"gcloud iam service-accounts add-iam-policy-binding mayadyn-vms@acme-prod-482916.iam.gserviceaccount.com --project=acme-prod-482916 --role=roles/iam.workloadIdentityUser --member=\"principal://iam.googleapis.com/projects/123456789012/locations/global/workloadIdentityPools/mayadyn/subject/mayadyn:6f1c2a9e-3b7d-4c1e-9a52-1d8e4b7f0c31:c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f\"",
"gcloud projects add-iam-policy-binding acme-prod-482916 --member=serviceAccount:mayadyn-vms@acme-prod-482916.iam.gserviceaccount.com --role=roles/compute.instanceAdmin.v1"
],
"notes": [
"The pool and provider must be in project number 123456789012 (the number in workload_provider).",
"The first VM also needs roles/compute.networkAdmin and roles/compute.securityAdmin on the service account (Mayadyn creates the mayadyn network and its firewall rules); you may remove them afterwards.",
"Only the subject mayadyn:6f1c2a9e-...:c4d5e6f7-... is trusted: no other Mayadyn workspace or connection can use this trust.",
"To revoke Mayadyn's access, delete the provider or the workloadIdentityUser binding."
]
}

OCI (no audience):

{
"connection": "oci-jeddah",
"provider": "oci",
"issuer": "https://id.mayadyn.com",
"subject": "mayadyn:6f1c2a9e-3b7d-4c1e-9a52-1d8e4b7f0c31:9a7b6c5d-4e3f-4a2b-9c1d-0e8f7a6b5c4d",
"steps": [
"Create a policy in the tenancy's root compartment with these statements:",
"Define tenancy Mayadyn as ocid1.tenancy.oc1..<mayadyn's tenancy>",
"Define dynamic-group MayadynPlatform as ocid1.dynamicgroup.oc1..<mayadyn's group>",
"Admit dynamic-group MayadynPlatform of tenancy Mayadyn to manage instance-family in compartment id ocid1.compartment.oc1..aaaaaaaaq7w2... where target.compartment.id = 'ocid1.compartment.oc1..aaaaaaaaq7w2...'",
"Admit dynamic-group MayadynPlatform of tenancy Mayadyn to manage virtual-network-family in compartment id ocid1.compartment.oc1..aaaaaaaaq7w2... where target.compartment.id = 'ocid1.compartment.oc1..aaaaaaaaq7w2...'",
"Admit dynamic-group MayadynPlatform of tenancy Mayadyn to inspect compartments in tenancy",
"Admit dynamic-group MayadynPlatform of tenancy Mayadyn to inspect tenancies in tenancy",
"Then add the freeform tag mayadyn-connection = mayadyn:6f1c2a9e-3b7d-4c1e-9a52-1d8e4b7f0c31:9a7b6c5d-4e3f-4a2b-9c1d-0e8f7a6b5c4d to compartment ocid1.compartment.oc1..aaaaaaaaq7w2... (Identity → Compartments → Tags; keep the compartment's other tags)."
],
"notes": [
"The tag is what ties the compartment to this one connection: no other Mayadyn workspace or connection can use it.",
"Mayadyn gets no permission to change tags or compartments. ...",
"The policy covers this compartment only, not its sub-compartments (the where clause): ...",
"To revoke Mayadyn's access, delete the policy or remove the tag (Mayadyn re-reads the tag at least every 5 minutes)."
]
}

When the compartment is the tenancy root, the statements say in tenancy where target.compartment.id = '<tenancy ocid>'.

Errors: 400 invalid_input “connection X uses a stored key; setup steps are for keyless connections (replace its credentials first)”; 400 unsupported when keyless is not available for that cloud; 404.

Notes: reads (decrypts) the stored keyless configuration: audit connection.secret_used with purpose setup. The person running the steps needs rights in their cloud; an agent cannot run them.

Terminal window
curl -s "$MAYADYN/v1/connections/gcp-dammam/setup" -H "Authorization: Bearer $TOKEN"

Replace a connection’s credentials in place (for example from a key to keyless), then verify. The connection keeps its id, so its VMs, apps and keyless subject stay attached.

Auth: scope admin (the verification that follows is part of the call, as for create).

Request body (ReplaceCredentialsRequest)

Field Type Required Description
credentials object yes same formats as for create, for the connection’s existing provider
{"credentials": {"type": "mayadyn_admit",
"tenancy_ocid": "ocid1.tenancy.oc1..aaaaaaaa5n3x...",
"compartment_ocid": "ocid1.compartment.oc1..aaaaaaaaq7w2..."}}

Response 200 with the verified Connection (status may be error; for a new keyless trust, run the setup steps and verify again).

Errors: as for create, plus 409 conflict “the new credentials are for another account (A → B) and the connection still has resources”, hint “Replace credentials only for the same account, or delete the connection’s VMs and apps first (or add a new connection for the other account).” The account is compared by account_ref (OCI tenancy OCID, GCP project id).

Audit: connection.credentials_replaced (auth_mode, previous_auth_mode), then the verification entries.

Refresh the inventory of one connection from its cloud.

Auth: scope write.

Request body: none. Headers/query: Idempotency-Key, ?wait=. ?dry_run=true checks the connection exists and you may sync it, queues nothing, and answers 200 {"dry_run": true, "kind": "connection.sync", "connection": "<ref>"}.

Response 202 (or 200 if finished within wait) with a connection.sync operation; see Operations.

What a sync does: lists VMs in the connection’s default region and in every region it already has resources in. VMs made outside Mayadyn appear; VMs deleted outside it are removed from the inventory; terminated VMs are skipped. Result: {"regions": [...], "seen": N, "removed": N}.

Notes: while a sync of the connection is still pending, another sync request returns that operation. No .requested audit entry; the finished operation records connection.sync.

Terminal window
curl -s -X POST "$MAYADYN/v1/connections/oci-jeddah/sync?wait=60s" -H "Authorization: Bearer $TOKEN"

Delete a connection and its stored credentials.

Auth: scopes destroy and admin (missing either: 403 “this action needs the destroy+admin permission”).

Response 204.

Errors: 404; 409 conflict “the connection still has resources in the inventory”, hint “Delete its VMs first (or sync, if they were deleted in the cloud).”; 409 conflict “the connection still has apps”, hint “Delete its apps first.” (also for an app never deployed).

Notes: nothing is changed in the cloud. For a keyless connection, also remove the trust (GCP provider/binding, OCI policy/tag). Audit: connection.delete.


The credentials object depends on provider. Unknown fields are refused for keyless credentials; for key credentials the documented fields are read and others are ignored.

{
"tenancy_ocid": "ocid1.tenancy.oc1..aaaaaaaa5n3x...",
"user_ocid": "ocid1.user.oc1..aaaaaaaab4k9...",
"fingerprint": "12:34:56:78:9a:bc:de:f0:12:34:56:78:9a:bc:de:f0",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQ...\n-----END PRIVATE KEY-----\n",
"passphrase": "",
"compartment_ocid": "ocid1.compartment.oc1..aaaaaaaaq7w2..."
}
Field Required Notes
tenancy_ocid yes must start with ocid1.tenancy.
user_ocid yes
fingerprint yes of the API key uploaded to that user
private_key yes PEM, including BEGIN/END lines
passphrase no if the key is encrypted
compartment_ocid no default: the tenancy root

The user needs, in the compartment: manage instance-family and virtual-network-family; and read the tenancy’s region subscriptions. The first VM in a region creates a VCN named mayadyn (10.77.0.0/16) with an internet gateway and a public subnet; later VMs reuse it. account_ref is the tenancy OCID.

{"type": "mayadyn_admit",
"tenancy_ocid": "ocid1.tenancy.oc1..aaaaaaaa5n3x...",
"compartment_ocid": "ocid1.compartment.oc1..aaaaaaaaq7w2..."}
Field Required Notes
type yes mayadyn_admit
tenancy_ocid yes a tenancy OCID (ocid1.tenancy.oc1..); must be the compartment’s own tenancy
compartment_ocid yes a compartment OCID (ocid1.compartment.oc1..)

No other fields are accepted. Setup: a policy in the root compartment that admits Mayadyn’s platform identity, and the freeform tag mayadyn-connection = mayadyn:<workspace id>:<connection id> on the compartment. Mayadyn acts only where that tag names this connection (otherwise connection_not_bound), and re-reads it at least every 5 minutes. Revoke by deleting the policy or removing the tag.

The JSON key file exactly as Google issued it:

{
"type": "service_account",
"project_id": "acme-prod-482916",
"private_key_id": "3f2e1d...",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvg...\n-----END PRIVATE KEY-----\n",
"client_email": "mayadyn-vms@acme-prod-482916.iam.gserviceaccount.com",
"client_id": "109876543210987654321",
"token_uri": "https://oauth2.googleapis.com/token",
"universe_domain": "googleapis.com"
}

type must be service_account; project_id, client_email and private_key are required; token_uri must be Google’s token endpoint (another is refused, so a credential cannot aim Mayadyn’s requests elsewhere); only the googleapis.com universe is supported.

Roles: roles/compute.instanceAdmin.v1; plus roles/compute.networkAdmin and roles/compute.securityAdmin the first time (Mayadyn creates the mayadyn network and its SSH firewall rule). A region (me-central2) uses its -a zone; a zone (me-central2-b) is used as given. account_ref is the project id.

{"type": "mayadyn_federated",
"project_id": "acme-prod-482916",
"workload_provider": "projects/123456789012/locations/global/workloadIdentityPools/mayadyn/providers/mayadyn-oidc",
"service_account": "mayadyn-vms@acme-prod-482916.iam.gserviceaccount.com"}
Field Required Notes
type yes mayadyn_federated
project_id yes GCP project id
workload_provider yes projects/<number>/locations/global/workloadIdentityPools/<pool>/providers/<provider>; pool and provider ids 4–32 of [a-z0-9-]
service_account yes <name>@<project>.iam.gserviceaccount.com

No other fields are accepted. Mayadyn exchanges a short-lived token from its issuer (subject mayadyn:<workspace id>:<connection id>, audience //iam.googleapis.com/<workload_provider>) at Google STS and impersonates the service account. See OIDC issuer. Revoke by deleting the provider or the workloadIdentityUser binding.

When Mayadyn is set to accept keyless credentials only, stored keys are refused on create and replace (400 invalid_input “this server accepts keyless credentials only, never a stored cloud key”), and a key stored earlier is never opened (verify and operations: 400 “this server uses keyless credentials only; this connection still holds a stored cloud key”, hint: replace its credentials).