emnify · Arazzo Workflow

emnify Set Endpoint Data Quota

Version 1.0.0

Authenticate, read the current data quota, then set a new data quota on an endpoint.

1 workflow 1 source API 1 provider
View Spec View on GitHub IoTInternet of ThingsCellular ConnectivityIoT SIMeSIMConsumer eSIMSGP.32M2MNTN-IoTSatelliteSuperNetworkArazzoWorkflows

Provider

emnify

Workflows

set-endpoint-data-quota
Read the existing data quota and assign a new one to an endpoint.
Authenticates, reads the endpoint's current data quota, and sets a new data quota with the supplied volume and expiry.
3 steps inputs: applicationToken, endpointId, expiryDate, volume outputs: endpointId, previousVolume
1
authenticate
authenticate
Exchange the application token for an auth_token used as a Bearer token.
2
getCurrentQuota
endpoint-quota-data-by-endpoint-id-get
Read the endpoint's current data quota to capture the existing volume.
3
setQuota
endpoint-quota-data-by-endpoint-id-post
Set a new data quota with ACTIVE status, the supplied volume and expiry, and Block on exhaustion (action id 1).

Source API Descriptions

Arazzo Workflow Specification

emnify-set-endpoint-data-quota-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: emnify Set Endpoint Data Quota
  summary: Authenticate, read the current data quota, then set a new data quota on an endpoint.
  description: >-
    A data-package flow. The workflow authenticates, reads the endpoint's
    current data quota to capture the existing volume, and then sets a new data
    quota with the supplied volume, expiry, and block-on-exhaustion action.
    This is the pattern used to top up or refresh an endpoint's data allowance.
    Every step spells out its request inline, including the Bearer Authorization
    header threaded from the authenticate step.
  version: 1.0.0
sourceDescriptions:
- name: emnifyApi
  url: ../openapi/emnify-api-openapi.yml
  type: openapi
workflows:
- workflowId: set-endpoint-data-quota
  summary: Read the existing data quota and assign a new one to an endpoint.
  description: >-
    Authenticates, reads the endpoint's current data quota, and sets a new data
    quota with the supplied volume and expiry.
  inputs:
    type: object
    required:
    - applicationToken
    - endpointId
    - volume
    - expiryDate
    properties:
      applicationToken:
        type: string
        description: emnify application token used to obtain an auth_token.
      endpointId:
        type: string
        description: The ID of the endpoint to set the data quota on.
      volume:
        type: number
        description: Remaining quota volume in MB.
      expiryDate:
        type: string
        description: Timestamp when the quota expires (ISO 8601).
  steps:
  - stepId: authenticate
    description: Exchange the application token for an auth_token used as a Bearer token.
    operationId: authenticate
    requestBody:
      contentType: application/json
      payload:
        application_token: $inputs.applicationToken
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      authToken: $response.body#/auth_token
  - stepId: getCurrentQuota
    description: Read the endpoint's current data quota to capture the existing volume.
    operationId: endpoint-quota-data-by-endpoint-id-get
    parameters:
    - name: endpoint_id
      in: path
      value: $inputs.endpointId
    - name: Authorization
      in: header
      value: Bearer $steps.authenticate.outputs.authToken
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      currentVolume: $response.body#/volume
  - stepId: setQuota
    description: >-
      Set a new data quota with ACTIVE status, the supplied volume and expiry,
      and Block on exhaustion (action id 1).
    operationId: endpoint-quota-data-by-endpoint-id-post
    parameters:
    - name: endpoint_id
      in: path
      value: $inputs.endpointId
    - name: Authorization
      in: header
      value: Bearer $steps.authenticate.outputs.authToken
    requestBody:
      contentType: application/json
      payload:
        status:
          id: 1
        volume: $inputs.volume
        expiry_date: $inputs.expiryDate
        action_on_exhaustion:
          id: 1
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      endpointId: $inputs.endpointId
  outputs:
    previousVolume: $steps.getCurrentQuota.outputs.currentVolume
    endpointId: $steps.setQuota.outputs.endpointId