Skip to content

Application API

Application Resource

The Application is the top-level resource in OAM.

Schema

apiVersion: core.oam.dev/v1alpha2
kind: Application
metadata:
  name: string              # Application name
  namespace: string         # OAM namespace
  labels:                   # Labels
    key: value
  annotations:              # Annotations
    key: value
spec:
  components: []Component   # Workload components
  scopes: []Scope          # Application scopes
  policies: []Policy       # Policies (future)
  workflow: *Workflow      # Workflow (future)
status:
  phase: string            # running, degraded, stopped
  conditions: []Condition  # Status conditions
  components: []ComponentStatus
  updatedAt: time

Example

apiVersion: core.oam.dev/v1alpha2
kind: Application
metadata:
  name: ecommerce-platform
  labels:
    environment: production
spec:
  components:
    - name: web
      type: webservice
      properties:
        image: nginx:latest
  scopes:
    - scopeRef:
        kind: networkscope.nomad.oam.dev
        name: production

API Endpoints

Create Application

POST /api/v1/applications
Content-Type: application/yaml

<application yaml>

List Applications

GET /api/v1/applications

Get Application

GET /api/v1/applications/{name}

Update Application

PUT /api/v1/applications/{name}
Content-Type: application/yaml

<application yaml>

Delete Application

DELETE /api/v1/applications/{name}

Get Application Status

GET /api/v1/applications/{name}/status

Application Phases

Phase Description
running All components are healthy
degraded Some components are unhealthy
deploying Deployment in progress
stopped All components stopped
failed Deployment failed

Status Conditions

Type Status Description
Ready True/False Application is ready
Healthy True/False All components healthy
Synced True/False Synced with Nomad