openapi: 3.1.0
info:
  title: interLink Plugin spec
  description: openapi spec for interLink apis <-> provider plugin communication
  version: v0.4.0
paths:
  /create:
    post:
      summary: Create Pod
      operationId: create_pod_create_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Pod'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateStruct'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /delete:
    post:
      summary: Delete Pod
      operationId: delete_pod_delete_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PodRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string
                title: Response Delete Pod Delete Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /status:
    get:
      summary: Status Pod
      operationId: status_pod_status_get
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/PodRequest'
              type: array
              title: Pods
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PodStatus'
                type: array
                title: Response Status Pod Status Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /getLogs:
    get:
      summary: Get Logs
      operationId: get_logs_getLogs_get
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LogRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            text/plain:
              schema:
                type: string
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ConfigMap:
      properties:
        metadata:
          $ref: '#/components/schemas/Metadata'
        data:
          anyOf:
            - type: object
            - type: 'null'
          title: Data
        binary_data:
          anyOf:
            - type: object
            - type: 'null'
          title: Binary Data
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        immutable:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Immutable
      type: object
      required:
        - metadata
        - data
      title: ConfigMap
    ConfigMapKeySelector:
      properties:
        key:
          type: string
          title: Key
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        optional:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Optional
      type: object
      required:
        - key
      title: ConfigMapKeySelector
    ConfigMapVolumeSource:
      properties:
        name:
          type: string
          title: Name
        items:
          anyOf:
            - items:
                $ref: '#/components/schemas/KeyToPath'
              type: array
            - type: 'null'
          title: Items
          default: []
        optional:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Optional
        default_mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Default Mode
      type: object
      required:
        - name
      title: ConfigMapVolumeSource
    Container:
      properties:
        name:
          type: string
          title: Name
        image:
          type: string
          title: Image
        tag:
          type: string
          title: Tag
          default: latest
        command:
          items:
            type: string
          type: array
          title: Command
        args:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Args
          default: []
        resources:
          anyOf:
            - type: object
            - type: 'null'
          title: Resources
          default: {}
        volume_mounts:
          anyOf:
            - items:
                $ref: '#/components/schemas/VolumeMount'
              type: array
            - type: 'null'
          title: Volume Mounts
          default: []
        env:
          anyOf:
            - items:
                $ref: '#/components/schemas/EnvVar'
              type: array
            - type: 'null'
          title: Env
        security_context:
          anyOf:
            - $ref: '#/components/schemas/SecurityContext'
            - type: 'null'
      type: object
      required:
        - name
        - image
        - command
      title: Container
    ContainerStates:
      properties:
        terminated:
          anyOf:
            - $ref: '#/components/schemas/StateTerminated'
            - type: 'null'
        running:
          anyOf:
            - $ref: '#/components/schemas/StateRunning'
            - type: 'null'
        waiting:
          anyOf:
            - $ref: '#/components/schemas/StateWaiting'
            - type: 'null'
      type: object
      title: ContainerStates
    ContainerStatus:
      properties:
        name:
          type: string
          title: Name
        state:
          $ref: '#/components/schemas/ContainerStates'
      type: object
      required:
        - name
        - state
      title: ContainerStatus
    CreateStruct:
      properties:
        pod_uid:
          type: string
          title: Pod Uid
        pod_jid:
          type: string
          title: Pod Jid
      type: object
      required:
        - pod_uid
        - pod_jid
      title: CreateStruct
    EnvVar:
      properties:
        name:
          type: string
          title: Name
        value:
          anyOf:
            - type: string
            - type: 'null'
          title: Value
        value_from:
          anyOf:
            - $ref: '#/components/schemas/EnvVarSource'
            - type: 'null'
      type: object
      required:
        - name
      title: EnvVar
    EnvVarSource:
      properties:
        config_map_key_ref:
          anyOf:
            - $ref: '#/components/schemas/ConfigMapKeySelector'
            - type: 'null'
        secret_key_ref:
          anyOf:
            - $ref: '#/components/schemas/SecretKeySelector'
            - type: 'null'
      type: object
      title: EnvVarSource
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    KeyToPath:
      properties:
        key:
          anyOf:
            - type: string
            - type: 'null'
          title: Key
        path:
          type: string
          title: Path
        mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Mode
      type: object
      required:
        - key
        - path
      title: KeyToPath
    LogOpts:
      properties:
        tail:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tail
        limit_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit Bytes
        timestamps:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Timestamps
        previous:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Previous
        since_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Since Seconds
        since_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Since Time
      type: object
      title: LogOpts
    LogRequest:
      properties:
        namespace:
          type: string
          title: Namespace
        pod_uid:
          type: string
          title: Pod Uid
        pod_name:
          type: string
          title: Pod Name
        container_name:
          type: string
          title: Container Name
        opts:
          $ref: '#/components/schemas/LogOpts'
      type: object
      required:
        - namespace
        - pod_uid
        - pod_name
        - container_name
        - opts
      title: LogRequest
    Metadata:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        namespace:
          anyOf:
            - type: string
            - type: 'null'
          title: Namespace
        uid:
          anyOf:
            - type: string
            - type: 'null'
          title: Uid
        annotations:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Annotations
          default: {}
        labels:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Labels
          default: {}
        generate_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Generate Name
      type: object
      title: Metadata
    Pod:
      properties:
        pod:
          $ref: '#/components/schemas/PodRequest'
        container:
          items:
            $ref: '#/components/schemas/Volume'
          type: array
          title: Container
      type: object
      required:
        - pod
        - container
      title: Pod
    PodRequest:
      properties:
        metadata:
          $ref: '#/components/schemas/Metadata'
        spec:
          $ref: '#/components/schemas/PodSpec'
      type: object
      required:
        - metadata
        - spec
      title: PodRequest
    PodSpec:
      properties:
        containers:
          items:
            $ref: '#/components/schemas/Container'
          type: array
          title: Containers
        init_containers:
          anyOf:
            - items:
                $ref: '#/components/schemas/Container'
              type: array
            - type: 'null'
          title: Init Containers
        volumes:
          anyOf:
            - items:
                $ref: '#/components/schemas/PodVolume'
              type: array
            - type: 'null'
          title: Volumes
        preemption_policy:
          anyOf:
            - type: string
            - type: 'null'
          title: Preemption Policy
        priority_class_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Priority Class Name
        priority:
          anyOf:
            - type: integer
            - type: 'null'
          title: Priority
        restart_policy:
          anyOf:
            - type: string
            - type: 'null'
          title: Restart Policy
        termination_grace_period_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Termination Grace Period Seconds
      type: object
      required:
        - containers
      title: PodSpec
    PodStatus:
      properties:
        name:
          type: string
          title: Name
        uid:
          type: string
          title: Uid
        namespace:
          type: string
          title: Namespace
        containers:
          items:
            $ref: '#/components/schemas/ContainerStatus'
          type: array
          title: Containers
      type: object
      required:
        - name
        - uid
        - namespace
        - containers
      title: PodStatus
    PodVolume:
      properties:
        name:
          type: string
          title: Name
        empty_dir:
          anyOf:
            - type: object
            - type: 'null'
          title: Empty Dir
        secret:
          anyOf:
            - $ref: '#/components/schemas/SecretVolumeSource'
            - type: 'null'
        config_map:
          anyOf:
            - $ref: '#/components/schemas/ConfigMapVolumeSource'
            - type: 'null'
      type: object
      required:
        - name
      title: PodVolume
    Secret:
      properties:
        metadata:
          $ref: '#/components/schemas/Metadata'
        data:
          anyOf:
            - type: object
            - type: 'null'
          title: Data
        string_data:
          anyOf:
            - type: object
            - type: 'null'
          title: String Data
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        immutable:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Immutable
      type: object
      required:
        - metadata
      title: Secret
    SecretKeySelector:
      properties:
        key:
          type: string
          title: Key
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        optional:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Optional
      type: object
      required:
        - key
      title: SecretKeySelector
    SecretVolumeSource:
      properties:
        secret_name:
          type: string
          title: Secret Name
        items:
          anyOf:
            - items:
                $ref: '#/components/schemas/KeyToPath'
              type: array
            - type: 'null'
          title: Items
          default: []
        optional:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Optional
        default_mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Default Mode
      type: object
      required:
        - secret_name
      title: SecretVolumeSource
    SecurityContext:
      properties:
        allow_privilege_escalation:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Allow Privilege Escalation
        privileged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Privileged
        proc_mount:
          anyOf:
            - type: string
            - type: 'null'
          title: Proc Mount
        read_only_file_system:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Read Only File System
        run_as_group:
          anyOf:
            - type: integer
            - type: 'null'
          title: Run As Group
        run_as_non_root:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Run As Non Root
        run_as_user:
          anyOf:
            - type: integer
            - type: 'null'
          title: Run As User
      type: object
      title: SecurityContext
    StateRunning:
      properties:
        started_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Started At
      type: object
      title: StateRunning
    StateTerminated:
      properties:
        exit_code:
          type: integer
          title: Exit Code
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
      type: object
      required:
        - exit_code
      title: StateTerminated
    StateWaiting:
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
      type: object
      title: StateWaiting
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    Volume:
      properties:
        name:
          type: string
          title: Name
        config_maps:
          anyOf:
            - items:
                $ref: '#/components/schemas/ConfigMap'
              type: array
            - type: 'null'
          title: Config Maps
        secrets:
          anyOf:
            - items:
                $ref: '#/components/schemas/Secret'
              type: array
            - type: 'null'
          title: Secrets
        empty_dirs:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Empty Dirs
      type: object
      required:
        - name
      title: Volume
    VolumeMount:
      properties:
        name:
          type: string
          title: Name
        mount_path:
          type: string
          title: Mount Path
        sub_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Sub Path
        read_only:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Read Only
          default: false
        mount_propagation:
          anyOf:
            - type: string
            - type: 'null'
          title: Mount Propagation
      type: object
      required:
        - name
        - mount_path
      title: VolumeMount
