#%RAML 1.0 Library
types:
  Resources:
    type: object
    description: Resource Allocations
    properties:
      cpus:
        displayName: CPU shares
        description: The number of CPU shares this pod needs per instance. This number does not have to be integer, but can be a fraction.
        type: number
        minimum: 0.001
        format: double
        example: 0.1
        default: 1.0
      mem:
        displayName: memory
        type: number
        minimum: 0.001
        format: double
        description: The amount of memory in MB that is needed for the pod instance
        example: 512
        default: 128.0
      disk?:
        displayName: disk space
        type: number
        minimum: 0.0
        format: double
        description: How much disk space is needed for this application. This number does not have to be an integer, but can be a fraction.
        example: 0.2
        default: 0.0
      gpus?:
        displayName: gpu shares
        type: integer
        format: int32
        minimum: 0
        description: The amount of GPU cores that are needed for the pod
        example: 1
        default: 0

  ExecutorResources:
    type: object
    description: Executor Resource Allocations. Same as Resources but reserved for the pod executor.
    properties:
      cpus?:
        displayName: CPU shares
        description: The number of CPU shares this pod needs per instance for its executor. This number does not have to be integer, but can be a fraction.
        type: number
        minimum: 0.1
        format: double
        example: 0.2
        default: 0.1
      mem?:
        displayName: memory
        type: number
        minimum: 32
        format: double
        description: The amount of memory in MB that is needed for the pod instance for the pod instance's executor
        example: 512
        default: 32
      disk?:
        displayName: disk space
        type: number
        minimum: 10.0
        format: double
        description: How much disk space is needed for for the executor. This number does not have to be an integer, but can be a fraction.
        example: 50
        default: 10.0
  ResourceLimit: ResourceLimitUnlimited | ResourceLimitNumber
  ResourceLimitUnlimited:
    type: string
    enum: [ unlimited ]
  ResourceLimitNumber:
    type: number
    format: double
  ResourceLimits:
    type: object
    description: Specify resource limits in addition to the requested resources, allowing containers / tasks to consume more CPU or memory than requested.
    properties:
      cpus?:
        displayName: CPU shares limit
        description: The total number of CPU shares this task / container can consume. If not specified, then the task / container is constrained to use only the CPUs requested. A value of "unlimited" means the task / container should be allowed to use as many spare CPU cycles as are available on the box. This setting has no effect on nodes with CFS disabled.
        type: ResourceLimit
      mem?:
        displayName: memory
        description: The total amount of memory that this task / container can consume. If not specified, then the task / container is constrained to use only the memory requested. A value of "unlimited" means the task / container should be allowed as much memory as is free on the agent. Note that when a task goes over its requested memory limit it has a higher chance of being OOM-killed in the case of resource contention on a node.
        type: ResourceLimit
