Jobs (v2) - Manage Jobs in Superna Eyeglass
Introduction
The Superna Eyeglass REST API - v2 Jobs allows for programmatic management of jobs, providing endpoints to create, retrieve, update, and delete various types of jobs including failover, readiness, and replication jobs.
Endpoints
GET /v2/jobs/failover
Description: Returns failover jobs from Superna Eyeglass.
Parameters:
| Parameter | Type | Location | Description | 
|---|---|---|---|
| state | string | query | Filter running or complete jobs (all, running, finished). | 
| success | boolean | query | Filter jobs by result success (true, false). | 
Response Codes:
200 OK: Successfully retrieved jobs.default: Error payload, see response structure.
Example Responses:
200 OK:
[
  {
    "id": "job1",
    "name": "FailoverJob1",
    "status": "running",
    "startTime": "2024-11-01T10:00:00Z",
    "endTime": "2024-11-01T12:00:00Z"
  }
]
Default (Error):
{
  "code": 400,
  "message": "Invalid request parameters"
}
Model Job:
{
  "failoverTarget": {
    "policies": [
      {
        "id": "string",
        "name": "string",
        "failoverReadiness": {
          "status": "OK"
        },
        "readinessDetail": [
          {
            "name": "string",
            "reason": "string",
            "status": {
              "status": "OK"
            },
            "statusChildren": []
          }
        ],
        "target": {
          "id": "string",
          "ip": "string",
          "name": "string"
        },
        "zone": {
          "id": "string",
          "name": "string",
          "failoverReadiness": {
            "status": "OK"
          },
          "readinessDetail": []
        }
      }
    ],
    "zone": {
      "id": "string",
      "name": "string",
      "failoverReadiness": {
        "status": "OK"
      },
      "readinessDetail": []
    }
  },
  "finished": 0,
  "id": "string",
  "jobStatusDetails": {
    "childrenDetails": [],
    "finished": 0,
    "id": "string",
    "info": "string",
    "name": "string",
    "started": 0,
    "state": "string",
    "status": "string"
  },
  "jobType": "zone_failover",
  "name": "string",
  "sourceNode": {
    "id": "string",
    "ip": "string",
    "name": "string"
  },
  "started": 0,
  "success": true,
  "targetNode": {
    "id": "string",
    "ip": "string",
    "name": "string"
  }
}
POST /v2/jobs/failover
Description: Launch a new failover job in Eyeglass.
Parameters:
| Parameter | Type | Location | Description | 
|---|---|---|---|
| sourceid | string | query | ID of the source node for this job. | 
| targetid | string | query | ID of the target node for this job. | 
| failovertarget | string | query | ID of the access zone to failover OR IDs of syncIQ policies (comma separated) to failover. | 
| pool | string | query | Pool name in case of pool failover. The name format is groupName:subnetName:poolName. | 
| controlled | boolean | query | Execute a controlled failover by running operations against the source cluster as well as the target. | 
| datasync | boolean | query | Run the final incremental data sync before failover. | 
| configsync | boolean | query | Run a configuration sync before failover. | 
| resyncprep | boolean | query | Run resync prep on the source cluster to create the mirror policies. | 
| disablemirror | boolean | query | Disable mirror policies created on the failover target. | 
| quotasync | boolean | query | Run quota jobs to failover quotas to target. | 
| blockonwarnings | boolean | query | Block failover on warnings. | 
| rollbackrenamedshares | boolean | query | Rollback renamed shares on failure. | 
| smbdataintegrity | boolean | query | SMB data integrity failover. | 
Response Codes:
201 Created: Successfully created the failover job.default: Error payload, see response structure.
Example Responses:
201 Created:
{
  "id": "job1"
}
Default (Error):
{
  "code": 400,
  "message": "Invalid request parameters"
}
POST /v2/jobs/failover/drtest
Description: Enter/Exit DR test mode for a given policy.
cURL Example:
curl -X POST --header 'Content-Type: application/json' 'https://<your-ip>/sera/v2/jobs/failover/drtest?enable={enable}&configsync={configsync}&datasync={datasync}&policy={policy}'
Parameters:
| Parameter | Type | Location | Description | 
|---|---|---|---|
| enable | boolean | query | True = Make target writable (Enter DR test mode). False = Make target read-only (Exit DR test mode). | 
| configsync | boolean | query | Run a configuration while DR test job. | 
| datasync | boolean | query | Run policy while DR test job. | 
| policy | string | query | DR testing policy id (as retrieved with /nodes/{id}/policies GET). | 
Response Codes:
201 Created: Successfully created the DR test job.default: Error payload, see response structure.
Example Responses:
201 Created:
{
  "id": "job1"
}
Default (Error):
{
  "code": 400,
  "message": "Invalid request parameters"
}