Laravel WebSocket Applications API

The WebSocket Applications API from Laravel — 3 operation(s) for websocket applications.

OpenAPI Specification

laravel-websocket-applications-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Laravel Cloud Applications WebSocket Applications API
  version: 0.0.1
servers:
- url: https://cloud.laravel.com/api
security:
- http: []
tags:
- name: WebSocket Applications
paths:
  /websocket-servers/{websocketServer}/applications:
    get:
      operationId: public.websocket-servers.applications.index
      description: Get a list of all applications for a specific WebSocket cluster.
      summary: List WebSocket applications
      tags:
      - WebSocket Applications
      parameters:
      - name: websocketServer
        in: path
        required: true
        description: The websocket server identifier
        schema:
          type: string
      - name: include
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - server
        explode: false
      responses:
        '200':
          description: Paginated set of `WebsocketApplicationResource`
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/WebsocketApplicationResource'
                  links:
                    type: object
                    properties:
                      first:
                        type: string
                      last:
                        type: string
                      prev:
                        type: string
                      next:
                        type: string
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                        minimum: 1
                      from:
                        type:
                        - integer
                        - 'null'
                        minimum: 1
                      last_page:
                        type: integer
                        minimum: 1
                      links:
                        type: array
                        description: Generated paginator links.
                        items:
                          type: object
                          properties:
                            url:
                              type:
                              - string
                              - 'null'
                            label:
                              type: string
                            active:
                              type: boolean
                          required:
                          - url
                          - label
                          - active
                      path:
                        type:
                        - string
                        - 'null'
                        description: Base path for paginator generated URLs.
                      per_page:
                        type: integer
                        description: Number of items shown per page.
                        minimum: 0
                      to:
                        type:
                        - integer
                        - 'null'
                        description: Number of the last item in the slice.
                        minimum: 1
                      total:
                        type: integer
                        description: Total number of items being paginated.
                        minimum: 0
                    required:
                    - current_page
                    - from
                    - last_page
                    - links
                    - path
                    - per_page
                    - to
                    - total
                  included:
                    type: array
                    items:
                      $ref: '#/components/schemas/WebsocketServerResource'
                required:
                - data
                - links
                - meta
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
    post:
      operationId: public.websocket-servers.applications.store
      description: Create a new application for a WebSocket cluster.
      summary: Create WebSocket application
      tags:
      - WebSocket Applications
      parameters:
      - name: websocketServer
        in: path
        required: true
        description: The websocket server identifier
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreWebsocketApplicationRequest'
      responses:
        '201':
          description: '`WebsocketApplicationResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WebsocketApplicationResource'
                  included:
                    type: array
                    items:
                      $ref: '#/components/schemas/WebsocketServerResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
  /websocket-applications/{websocketApplication}:
    get:
      operationId: public.websocket-applications.show
      description: Get a specific WebSocket application including credentials.
      summary: Get WebSocket application
      tags:
      - WebSocket Applications
      parameters:
      - name: websocketApplication
        in: path
        required: true
        description: The websocket application identifier
        schema:
          type: string
      - name: include
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - server
        explode: false
      responses:
        '200':
          description: '`WebsocketApplicationResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WebsocketApplicationResource'
                  included:
                    type: array
                    items:
                      $ref: '#/components/schemas/WebsocketServerResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
    patch:
      operationId: public.websocket-applications.update
      description: Update a WebSocket application.
      summary: Update WebSocket application
      tags:
      - WebSocket Applications
      parameters:
      - name: websocketApplication
        in: path
        required: true
        description: The websocket application identifier
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebsocketApplicationRequest'
      responses:
        '200':
          description: '`WebsocketApplicationResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WebsocketApplicationResource'
                  included:
                    type: array
                    items:
                      $ref: '#/components/schemas/WebsocketServerResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
    delete:
      operationId: public.websocket-applications.destroy
      description: Delete a WebSocket application.
      summary: Delete WebSocket application
      tags:
      - WebSocket Applications
      parameters:
      - name: websocketApplication
        in: path
        required: true
        description: The websocket application identifier
        schema:
          type: string
      responses:
        '204':
          description: No content
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
  /websocket-applications/{websocketApplication}/metrics:
    get:
      operationId: public.websocket-applications.metrics
      description: Get metrics for a specific WebSocket application.
      summary: Get WebSocket application metrics
      tags:
      - WebSocket Applications
      parameters:
      - name: websocketApplication
        in: path
        required: true
        description: The websocket application identifier
        schema:
          type: string
      - name: period
        in: query
        schema:
          anyOf:
          - $ref: '#/components/schemas/MetricPeriod'
          - type: 'null'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      connection_count:
                        type: object
                        properties:
                          labels:
                            type: array
                            items:
                              type: string
                          average:
                            type: array
                            items:
                              type: number
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                x:
                                  type: string
                                y:
                                  type: array
                                  items:
                                    type: number
                              required:
                              - x
                              - y
                        required:
                        - labels
                        - average
                        - data
                      message_rate:
                        type: object
                        properties:
                          labels:
                            type: array
                            items:
                              type: string
                          average:
                            type: array
                            items:
                              type: number
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                x:
                                  type: string
                                y:
                                  type: array
                                  items:
                                    type: number
                              required:
                              - x
                              - y
                        required:
                        - labels
                        - average
                        - data
                    required:
                    - connection_count
                    - message_rate
                  meta:
                    type: object
                    properties:
                      period:
                        type: string
                      available_periods:
                        type: array
                        items:
                          type: string
                    required:
                    - period
                    - available_periods
                required:
                - data
                - meta
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    CloudRegion:
      type: string
      enum:
      - us-east-2
      - us-east-1
      - ca-central-1
      - eu-central-1
      - eu-west-1
      - eu-west-2
      - me-central-1
      - ap-southeast-1
      - ap-southeast-2
      - ap-northeast-1
      title: CloudRegion
    MetricPeriod:
      type: string
      enum:
      - 6h
      - 24h
      - 3d
      - 7d
      - 30d
      title: MetricPeriod
    WebsocketApplicationResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
          - websocketApplications
        attributes:
          type: object
          properties:
            name:
              type: string
            app_id:
              type: string
            allowed_origins:
              type: array
              items: {}
            ping_interval:
              type: integer
            activity_timeout:
              type: integer
            max_message_size:
              type: integer
            max_connections:
              type: integer
            created_at:
              type:
              - string
              - 'null'
              format: date-time
            ? ''
            : anyOf:
              - type: object
                properties:
                  key:
                    type: string
                  secret:
                    type: string
                required:
                - key
                - secret
              - type: array
                items:
                  type: string
                minItems: 0
                maxItems: 0
                additionalItems: false
          required:
          - name
          - app_id
          - allowed_origins
          - ping_interval
          - activity_timeout
          - max_message_size
          - max_connections
          - created_at
          - null
        relationships:
          type: object
          properties:
            server:
              type: object
              properties:
                data:
                  anyOf:
                  - $ref: '#/components/schemas/WebsocketServerResourceIdentifier'
                  - type: 'null'
              required:
              - data
      required:
      - id
      - type
      title: WebsocketApplicationResource
    WebsocketApplicationResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
          - websocketApplications
        id:
          type: string
      required:
      - type
      - id
      title: WebsocketApplicationResourceIdentifier
    WebsocketServerStatus:
      type: string
      enum:
      - creating
      - updating
      - available
      - stopped
      - deleting
      - deleted
      - unknown
      title: WebsocketServerStatus
    WebsocketServerResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
          - websocketServers
        id:
          type: string
      required:
      - type
      - id
      title: WebsocketServerResourceIdentifier
    WebsocketServerConnectionDistributionStrategy:
      type: string
      enum:
      - evenly
      - custom
      title: WebsocketServerConnectionDistributionStrategy
    StoreWebsocketApplicationRequest:
      type: object
      properties:
        name:
          type: string
          pattern: ^[a-z0-9_-]+$
          minLength: 3
          maxLength: 40
        allowed_origins:
          type:
          - array
          - 'null'
          items:
            type: string
            maxLength: 255
        ping_interval:
          type: integer
          minimum: 1
          maximum: 60
        activity_timeout:
          type: integer
          minimum: 1
          maximum: 60
      required:
      - name
      title: StoreWebsocketApplicationRequest
    WebsocketServerResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
          - websocketServers
        attributes:
          type: object
          properties:
            name:
              type: string
            type:
              $ref: '#/components/schemas/WebsocketServerType'
            region:
              $ref: '#/components/schemas/CloudRegion'
            status:
              $ref: '#/components/schemas/WebsocketServerStatus'
            max_connections:
              $ref: '#/components/schemas/WebsocketServerMaxConnection'
            connection_distribution_strategy:
              $ref: '#/components/schemas/WebsocketServerConnectionDistributionStrategy'
            hostname:
              type: string
            created_at:
              type:
              - string
              - 'null'
              format: date-time
          required:
          - name
          - type
          - region
          - status
          - max_connections
          - connection_distribution_strategy
          - hostname
          - created_at
        relationships:
          type: object
          properties:
            applications:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/WebsocketApplicationResourceIdentifier'
              required:
              - data
      required:
      - id
      - type
      title: WebsocketServerResource
    WebsocketServerType:
      type: string
      enum:
      - reverb
      title: WebsocketServerType
    UpdateWebsocketApplicationRequest:
      type: object
      properties:
        name:
          type: string
          pattern: ^[a-z0-9_-]+$
          minLength: 3
          maxLength: 40
        allowed_origins:
          type: array
          items:
            type: string
            maxLength: 255
        ping_interval:
          type: integer
          minimum: 1
          maximum: 60
        activity_timeout:
          type: integer
          minimum: 1
          maximum: 60
      title: UpdateWebsocketApplicationRequest
    WebsocketServerMaxConnection:
      type: integer
      enum:
      - 100
      - 200
      - 500
      - 2000
      - 5000
      - 10000
      title: WebsocketServerMaxConnection
  responses:
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
            - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
            - message
            - errors
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
            - message
  securitySchemes:
    http:
      type: http
      description: The Bearer Token generated on the Cloud UI.
      scheme: bearer
      bearerFormat: bearer