openapi: 3.1.0
info:
  title: System Webhook API - v1beta1
  description: API for registering and managing HTTP webhooks and subscriptions.
  version: v1beta1
  contact: {}
  license:
    name: HPE License
    url: https://www.hpe.com/us/en/software/licensing.html
servers:
  - url: https://hoku-ext-api.ccs.arubathena.com
    description: Hoku endpoint(Dev)
  - url: https://polaris-default-ext-api.ccs.arubathena.com
    description: Polaris endpoint(QA)
  - url: https://mira-default-ext-api-api.ccs.arubathena.com
    description: Mira endpoint(QA)
  - url: https://pavo-default-ext-api.common.cloud.hpe.com
    description: Pavo endpoint(Staging)
  - url: https://global.api.greenlake.hpe.com
    description: Aquila endpoint(Production)
tags:
  - name: Webhooks
    description: Everything about Webhooks
  - name: Subscriptions
    description: Everything about Subscriptions
security:
  - Bearer: []
paths:
  /events/v1beta1/system-webhooks:
    post:
      tags:
        - Webhooks
      operationId: createWebhook
      summary: Register a new webhook
      description: >-
        This endpoint allows clients to create a new webhook to establish a
        callback mechanism for key events on GLCP services.
      requestBody:
        description: Webhook payload
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SystemWebhookInput'
            examples:
              register-webhook:
                summary: Register Webhook
                value:
                  name: License Notification
                  destination: https://example.com/new-endpoint
      responses:
        '201':
          description: Webhook successfully registered.
          headers:
            Location:
              description: URI to get details of the webhook creation operation.
              schema:
                type: string
                format: uri-reference
              examples:
                async-op:
                  summary: URI to retrieve the status of the Webhook Creation Operation
                  value: >-
                    /events/v1beta1/system-webhooks/123e4567-e89b-12d3-a456-426614174000
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemWebhookResponse'
              examples:
                create-webhook-record:
                  summary: Register Webhook
                  value:
                    id: 123e4567-e89b-12d3-a456-426614174000
                    name: License Notification
                    type: events/webhook
                    destination: https://example.com/new-endpoint
                    hpePrincipal: user:<opaque-global-id>
                    resourceUri: >-
                      /events/v1beta1/system-webhooks/123e4567-e89b-12d3-a456-426614174000
                    generation: 1
                    createdBy: sample.user@example.com
                    createdAt: '2024-04-29T15:25:06.194Z'
                    updatedBy: sample.user@example.com
                    updatedAt: '2024-04-29T15:25:06.194Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-req-body:
                  value:
                    errorCode: HPE_GL_ERROR_BAD_REQUEST
                    message: Invalid request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 400
        '401':
          description: Unauthorized - Invalid JWT token in Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-token:
                  summary: Invalid Token Error
                  value:
                    errorCode: HPE_GL_ERROR_UNAUTHORIZED
                    message: Invalid JWT token in Request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 401
        '403':
          description: Forbidden - The operation is forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-permission:
                  summary: Invalid Permission Error
                  value:
                    errorCode: HPE_GL_ERROR_FORBIDDEN
                    message: Invalid Permission Error
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 403
        '422':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-request-body:
                  summary: Invalid request body error
                  value:
                    errorCode: HPE_GL_EVENTS_INVALID_REQUEST_BODY
                    message: Invalid request body
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 422
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Request limit per hour.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: The number of requests left for the time window.
            X-RateLimit-Reset:
              schema:
                type: string
                format: date-time
              description: The UTC date/time at which the current rate limit window resets.
        '500':
          description: >-
            Unexpected Server Error, Please re-try and contact HPE Support if
            the error is not resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                unexpected-error:
                  value:
                    errorCode: HPE_GL_ERROR_INTERNAL_SERVER_ERROR
                    message: >-
                      Unexpected error occurred while creating webhook, if the
                      issue persists, Please contact HPE Support
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 500
    get:
      tags:
        - Webhooks
      operationId: retrieveWebhooks
      summary: Get all webhooks
      description: >-
        Retrieves a list of webhooks, organized in descending order based on
        their creation time. <br><br> **Pagination**: This endpoint exclusively
        supports offset-based pagination.
      parameters:
        - name: limit
          in: query
          description: >-
            Specifies the number of results to be returned. The default value is
            200.
          required: false
          schema:
            maximum: 200
            minimum: 1
            type: integer
            format: int64
            default: 200
        - name: offset
          in: query
          description: >-
            Specifies the zero-based resource offset to start the response from.
            The default value is 0.
          required: false
          schema:
            type: integer
            format: int64
            default: 0
            minimum: 0
      responses:
        '200':
          description: Webhooks retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemWebhookResponseList'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-query-params:
                  summary: Invalid query params
                  value:
                    errorCode: HPE_GL_ERROR_BAD_REQUEST
                    message: Invalid query params
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 400
        '401':
          description: Unauthorized - Invalid JWT token in Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-token:
                  summary: Invalid Token Error
                  value:
                    errorCode: HPE_GL_ERROR_UNAUTHORIZED
                    message: Invalid JWT token in Request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 401
        '403':
          description: Forbidden - The operation is forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-permission:
                  summary: Invalid Permission Error
                  value:
                    errorCode: HPE_GL_ERROR_FORBIDDEN
                    message: Invalid Permission Error
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 403
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Request limit per hour.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: The number of requests left for the time window.
            X-RateLimit-Reset:
              schema:
                type: string
                format: date-time
              description: The UTC date/time at which the current rate limit window resets.
        '500':
          description: >-
            Unexpected Server Error, Please re-try and contact HPE Support if
            the error is not resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                unexpected-error:
                  value:
                    errorCode: HPE_GL_ERROR_INTERNAL_SERVER_ERROR
                    message: >-
                      Unexpected error occurred while retrieving webhook, if the
                      issue persists, Please contact HPE Support
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 500
  /events/v1beta1/system-webhooks/{id}:
    get:
      tags:
        - Webhooks
      operationId: retrieveWebhook
      summary: Get a webhook by ID
      description: >-
        Retrieve detailed information about a specific webhook by its unique
        identifier
      parameters:
        - name: id
          in: path
          required: true
          description: Webhook ID
          schema:
            type: string
            format: uuid
            default: 0908777a-788f-45da-afb8-295c626e4d14
          examples:
            equals:
              summary: Example with specific webhook ID
              description: Get specific webhook
              value: 0908777a-788f-45da-afb8-295c626e4d14
      responses:
        '200':
          description: Webhook retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemWebhookResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-query-params:
                  summary: Invalid query params
                  value:
                    errorCode: HPE_GL_ERROR_BAD_REQUEST
                    message: Invalid query params
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 400
        '401':
          description: Unauthorized - Invalid JWT token in Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-token:
                  summary: Invalid Token Error
                  value:
                    errorCode: HPE_GL_ERROR_UNAUTHORIZED
                    message: Invalid JWT token in Request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 401
        '403':
          description: Forbidden - The operation is forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-permission:
                  summary: Invalid Permission Error
                  value:
                    errorCode: HPE_GL_ERROR_FORBIDDEN
                    message: Invalid Permission Error
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 403
        '404':
          description: Bad Request, A webhook doesn't exist with the given ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                not-found:
                  summary: Not found error
                  value:
                    errorCode: HPE_GL_ERROR_NOT_FOUND
                    message: Webhook not found
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 404
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Request limit per hour.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: The number of requests left for the time window.
            X-RateLimit-Reset:
              schema:
                type: string
                format: date-time
              description: The UTC date/time at which the current rate limit window resets.
        '500':
          description: >-
            Unexpected Server Error, Please re-try and contact HPE Support if
            the error is not resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                unexpected-error:
                  value:
                    errorCode: HPE_GL_ERROR_INTERNAL_SERVER_ERROR
                    message: >-
                      Unexpected error occurred while retrieving webhook, if the
                      issue persists, Please contact HPE Support
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 500
    patch:
      tags:
        - Webhooks
      operationId: updateWebhook
      summary: Update a webhook by ID
      description: >-
        Update an existing webhook's settings, such as its name, description,
        destination, etc
      parameters:
        - name: id
          in: path
          required: true
          description: Webhook ID
          schema:
            type: string
            format: uuid
            default: 0908777a-788f-45da-afb8-295c626e4d14
          examples:
            equals:
              summary: Example with specific webhook ID
              description: Update specific webhook
              value: 0908777a-788f-45da-afb8-295c626e4d14
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/SystemWebhookUpdate'
      responses:
        '200':
          description: Webhook updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemWebhookResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-query-params:
                  summary: Invalid query params
                  value:
                    errorCode: HPE_GL_ERROR_BAD_REQUEST
                    message: Invalid query params
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 400
        '401':
          description: Unauthorized - Invalid JWT token in Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-token:
                  summary: Invalid Token Error
                  value:
                    errorCode: HPE_GL_ERROR_UNAUTHORIZED
                    message: Invalid JWT token in Request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 401
        '403':
          description: Forbidden - The operation is forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-permission:
                  summary: Invalid Permission Error
                  value:
                    errorCode: HPE_GL_ERROR_FORBIDDEN
                    message: Invalid Permission Error
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 403
        '404':
          description: Bad Request, A webhook doesn't exist with the given ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                not-found:
                  summary: Not found error
                  value:
                    errorCode: HPE_GL_ERROR_NOT_FOUND
                    message: Webhook not found
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 404
        '422':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-request-body:
                  summary: Invalid request body error
                  value:
                    errorCode: HPE_GL_EVENTS_INVALID_REQUEST_BODY
                    message: Invalid request body
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 422
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Request limit per hour.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: The number of requests left for the time window.
            X-RateLimit-Reset:
              schema:
                type: string
                format: date-time
              description: The UTC date/time at which the current rate limit window resets.
        '500':
          description: >-
            Unexpected Server Error, Please re-try and contact HPE Support if
            the error is not resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                unexpected-error:
                  value:
                    errorCode: HPE_GL_ERROR_INTERNAL_SERVER_ERROR
                    message: >-
                      Unexpected error occurred while retrieving webhook, if the
                      issue persists, Please contact HPE Support
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 500
    delete:
      tags:
        - Webhooks
      operationId: deleteWebhook
      summary: Delete a webhook by ID
      description: Remove a specific webhook from the system
      parameters:
        - name: id
          in: path
          required: true
          description: Webhook ID
          schema:
            type: string
            format: uuid
            default: 0908777a-788f-45da-afb8-295c626e4d14
          examples:
            equals:
              summary: Example with specific webhook ID
              description: Delete specific webhook
              value: 0908777a-788f-45da-afb8-295c626e4d14
        - name: force
          in: query
          description: >-
            The `force` query parameter is used to force deletion in situations
            where the webhook has one or more subscriptions.
          schema:
            type: boolean
            default: false
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-req-body:
                  value:
                    errorCode: HPE_GL_ERROR_BAD_REQUEST
                    message: Bad Request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 400
        '401':
          description: Unauthorized - Invalid JWT token in Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-token:
                  summary: Invalid Token Error
                  value:
                    errorCode: HPE_GL_ERROR_UNAUTHORIZED
                    message: Invalid JWT token in Request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 401
        '403':
          description: Forbidden - The operation is forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-permission:
                  summary: Invalid Permission Error
                  value:
                    errorCode: HPE_GL_ERROR_FORBIDDEN
                    message: Invalid Permission Error
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 403
        '404':
          description: Bad Request, A webhook doesn't exist with the given ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                not-found:
                  summary: Not found error
                  value:
                    errorCode: HPE_GL_ERROR_NOT_FOUND
                    message: Webhook not found
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 404
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Request limit per hour.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: The number of requests left for the time window.
            X-RateLimit-Reset:
              schema:
                type: string
                format: date-time
              description: The UTC date/time at which the current rate limit window resets.
        '500':
          description: >-
            Unexpected Server Error, Please re-try and contact HPE Support if
            the error is not resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                unexpected-error:
                  value:
                    errorCode: HPE_GL_ERROR_INTERNAL_SERVER_ERROR
                    message: >-
                      Unexpected error occurred while retrieving webhook, if the
                      issue persists, Please contact HPE Support
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 500
  /events/v1beta1/system-subscriptions:
    post:
      tags:
        - Subscriptions
      operationId: createSubscription
      summary: Create a new subscription
      description: >-
        Register a new subscription to start receiving event notifications
        through the configured webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/SystemSubscriptionInput'
      responses:
        '201':
          description: Subscription successfully registered.
          headers:
            Location:
              description: URI to get details of the subscription creation operation.
              schema:
                type: string
                format: uri-reference
              examples:
                get-sub:
                  summary: >-
                    URI to retrieve the status of the Subscription Creation
                    Operation
                  value: >-
                    /events/v1beta1/system-subscriptions/123e4567-e89b-12d3-a456-426614174000
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SystemSubscriptionResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-req-body:
                  value:
                    errorCode: HPE_GL_ERROR_BAD_REQUEST
                    message: Invalid request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 400
        '401':
          description: Unauthorized - Invalid JWT token in Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-token:
                  summary: Invalid Token Error
                  value:
                    errorCode: HPE_GL_ERROR_UNAUTHORIZED
                    message: Invalid JWT token in Request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 401
        '403':
          description: Forbidden - The operation is forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-permission:
                  summary: Invalid Permission Error
                  value:
                    errorCode: HPE_GL_ERROR_FORBIDDEN
                    message: Invalid Permission Error
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 403
        '422':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-request-body:
                  summary: Invalid request body error
                  value:
                    errorCode: HPE_GL_EVENTS_INVALID_REQUEST_BODY
                    message: Invalid request body
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 422
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Request limit per hour.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: The number of requests left for the time window.
            X-RateLimit-Reset:
              schema:
                type: string
                format: date-time
              description: The UTC date/time at which the current rate limit window resets.
        '500':
          description: >-
            Unexpected Server Error, Please re-try and contact HPE Support if
            the error is not resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                unexpected-error:
                  value:
                    errorCode: HPE_GL_ERROR_INTERNAL_SERVER_ERROR
                    message: >-
                      Unexpected error occurred while creating webhook, if the
                      issue persists, Please contact HPE Support
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 500
    get:
      tags:
        - Subscriptions
      operationId: retrieveSubscriptions
      summary: Get all subscriptions for a webhook
      description: >-
        Retrieves a list of subscriptions associated to webhooks, organized in
        descending order based on their creation time. <br><br> **Pagination**:
        This endpoint exclusively supports offset-based pagination. <br><br>
        **Filtering**: Following are the supported filter parameters &#58;
        `webhookId`
      parameters:
        - name: limit
          in: query
          description: >-
            Specifies the number of results to be returned. The default value is
            10.
          required: false
          schema:
            maximum: 10
            minimum: 1
            type: integer
            format: int64
            default: 10
        - name: offset
          in: query
          description: >-
            Specifies the zero-based resource offset to start the response from.
            The default value is 0.
          required: false
          schema:
            type: integer
            format: int64
            default: 0
            minimum: 0
        - name: filter
          in: query
          description: >
            Filter subscriptions events using an [OData
            V4](https://www.odata.org/documentation/) formatted filter string.
          required: true
          schema:
            title: Filter
            type: string
            format: uuid
            description: >
              Filter data using a subset of OData 4.0 and return only the subset
              of resources that match the filter.

              Get list of subscriptions that can be filtered by:

              - webhookId
            default: ''
          examples:
            FilterWithWebhookId:
              summary: Filter with webhookId
              description: Returns subscriptions for a user within a particular webhook.
              value: webhookId eq '123e4567-e89b-12d3-a456-426614174000'
      responses:
        '200':
          description: Subscriptions retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemSubscriptionListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-req-body:
                  value:
                    errorCode: HPE_GL_ERROR_BAD_REQUEST
                    message: Invalid request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 400
        '401':
          description: Unauthorized - Invalid JWT token in Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-token:
                  summary: Invalid Token Error
                  value:
                    errorCode: HPE_GL_ERROR_UNAUTHORIZED
                    message: Invalid JWT token in Request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 401
        '403':
          description: Forbidden - The operation is forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-permission:
                  summary: Invalid Permission Error
                  value:
                    errorCode: HPE_GL_ERROR_FORBIDDEN
                    message: Invalid Permission Error
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 403
        '422':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-request-body:
                  summary: Invalid request body error
                  value:
                    errorCode: HPE_GL_EVENTS_INVALID_REQUEST_BODY
                    message: Invalid request body
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 422
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Request limit per hour.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: The number of requests left for the time window.
            X-RateLimit-Reset:
              schema:
                type: string
                format: date-time
              description: The UTC date/time at which the current rate limit window resets.
        '500':
          description: >-
            Unexpected Server Error, Please re-try and contact HPE Support if
            the error is not resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                unexpected-error:
                  value:
                    errorCode: HPE_GL_ERROR_INTERNAL_SERVER_ERROR
                    message: >-
                      Unexpected error occurred while creating webhook, if the
                      issue persists, Please contact HPE Support
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 500
    delete:
      tags:
        - Subscriptions
      operationId: DeleteSubscription
      summary: Delete subscription for a webhook
      description: >-
        Delete the list of subscriptions by the IDs, stopping further event
        notification linked to the subscriptions
      parameters:
        - in: query
          name: id
          required: true
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              format: uuid
            default: id=0908777a-788f-45da-afb8-295c626e4d14
          examples:
            equals:
              summary: Example with specific subscription ID
              description: Delete all subscriptions based on the IDs
              value:
                - 0908777a-788f-45da-afb8-295c626e4d14
                - 0908777a-788f-45da-afb8-295c626e4d11
                - 0908777a-788f-45da-afb8-295c626e4d12
          description: The ID of the subscription to delete.
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-req-body:
                  value:
                    errorCode: HPE_GL_ERROR_BAD_REQUEST
                    message: Invalid request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 400
        '401':
          description: Unauthorized - Invalid JWT token in Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-token:
                  summary: Invalid Token Error
                  value:
                    errorCode: HPE_GL_ERROR_UNAUTHORIZED
                    message: Invalid JWT token in Request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 401
        '403':
          description: Forbidden - The operation is forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-permission:
                  summary: Invalid Permission Error
                  value:
                    errorCode: HPE_GL_ERROR_FORBIDDEN
                    message: Invalid Permission Error
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 403
        '404':
          description: Bad Request, A subscription doesn't exist with the given ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                not-found:
                  summary: Not found error
                  value:
                    errorCode: HPE_GL_ERROR_NOT_FOUND
                    message: Webhook not found
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 404
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Request limit per hour.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: The number of requests left for the time window.
            X-RateLimit-Reset:
              schema:
                type: string
                format: date-time
              description: The UTC date/time at which the current rate limit window resets.
        '500':
          description: >-
            Unexpected Server Error, Please re-try and contact HPE Support if
            the error is not resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                unexpected-error:
                  value:
                    errorCode: HPE_GL_ERROR_INTERNAL_SERVER_ERROR
                    message: >-
                      Unexpected error occurred while creating subscription, if
                      the issue persists, Please contact HPE Support
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 500
    patch:
      tags:
        - Subscriptions
      operationId: updateSubscription
      summary: Update subscription with specific IDs
      description: Update all subscription identified by the given IDs.
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/SystemPatchSubscriptionInput'
      responses:
        '200':
          description: Successfully updated the given subscription
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SystemSubscriptionResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-req-body:
                  value:
                    errorCode: HPE_GL_ERROR_BAD_REQUEST
                    message: Invalid request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 400
        '401':
          description: Unauthorized - Invalid JWT token in Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-token:
                  summary: Invalid Token Error
                  value:
                    errorCode: HPE_GL_ERROR_UNAUTHORIZED
                    message: Invalid JWT token in Request
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 401
        '403':
          description: Forbidden - The operation is forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-permission:
                  summary: Invalid Permission Error
                  value:
                    errorCode: HPE_GL_ERROR_FORBIDDEN
                    message: Invalid Permission Error
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 403
        '404':
          description: Bad Request, A subscription doesn't exist with the given ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                not-found:
                  summary: Not found error
                  value:
                    errorCode: HPE_GL_ERROR_NOT_FOUND
                    message: Webhook not found
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 404
        '422':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid-request-body:
                  summary: Invalid request body error
                  value:
                    errorCode: HPE_GL_EVENTS_INVALID_REQUEST_BODY
                    message: Invalid request body
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 422
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Request limit per hour.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: The number of requests left for the time window.
            X-RateLimit-Reset:
              schema:
                type: string
                format: date-time
              description: The UTC date/time at which the current rate limit window resets.
        '500':
          description: >-
            Unexpected Server Error, Please re-try and contact HPE Support if
            the error is not resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                unexpected-error:
                  value:
                    errorCode: HPE_GL_ERROR_INTERNAL_SERVER_ERROR
                    message: >-
                      Unexpected error occurred while creating subscription, if
                      the issue persists, Please contact HPE Support
                    debugId: 75d40213-6776-40ff-a959-89a7514ef7fc
                    httpStatusCode: 500
components:
  securitySchemes:
    Bearer:
      description: >-
        Personal access token compliant with RFC8725 issued by the HPE GreenLake
        platform.
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    SystemWebhookInput:
      type: object
      description: Represents the data required to register a new webhook.
      required:
        - name
        - destination
      properties:
        name:
          type: string
          description: The name of the webhook.
          examples:
            - License Notification
        destination:
          type: string
          description: The URL where events will be sent.
          examples:
            - https://example.com/new-endpoint
    SystemWebhookUpdate:
      type: object
      description: Contains fields that can be updated for an existing webhook
      properties:
        name:
          type: string
          description: The name of the webhook.
          examples:
            - License Notification
        destination:
          type: string
          description: The URL where events will be sent.
          examples:
            - https://example.com/new-endpoint
    SystemWebhookResponse:
      type: object
      description: The response schema for webhook operations.
      required:
        - id
        - name
        - type
        - destination
        - hpePrincipal
        - resourceUri
        - generation
        - createdBy
        - createdAt
        - updatedBy
        - updatedAt
      properties:
        id:
          type: string
          description: The unique identifier of the webhook.
          format: uuid
          examples:
            - 123e4567-e89b-12d3-a456-426614174000
        name:
          type: string
          description: The name of the webhook.
          examples:
            - License Notification
        type:
          type: string
          description: The type of the resource.
          const: events/webhook
        destination:
          type: string
          description: The URL where events will be sent.
          examples:
            - https://example.com/new-endpoint
        hpePrincipal:
          type: string
          description: Security principal subject notation.
          examples:
            - user:<opaque-global-id>
        resourceUri:
          type: string
          description: URI to the resource itself (i.e. a self link).
          examples:
            - >-
              /events/v1beta1/system-webhooks/123e4567-e89b-12d3-a456-426614174000
        generation:
          type: integer
          description: Monotonically increasing update counter.
          examples:
            - 1
        createdBy:
          type: string
          description: The user that created the webhook.
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the webhook was created.
        updatedBy:
          type: string
          description: The user that updated the webhook.
        updatedAt:
          type: string
          format: date-time
          description: The timestamp when the webhook was last updated
    SystemWebhookResponseList:
      type: object
      description: A collection of WebhookResponse items.
      required:
        - items
        - count
        - offset
        - total
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/SystemWebhookResponse'
        count:
          type: integer
        offset:
          type: integer
        total:
          type: integer
    SystemWebhookResourceInputRef:
      type: object
      description: >-
        A reference to a specific webhook resource, providing a link (URI)
        directly to the referenced webhook.
      required:
        - resourceUri
      properties:
        resourceUri:
          type: string
          examples:
            - >-
              /events/v1beta1/system-webhooks/123e4567-e89b-12d3-a456-426614174000
          description: URI to the webhook
    SystemWebhookResourceResponseRef:
      type: object
      description: The response schema for WebhookSubscription.
      required:
        - resourceUri
      properties:
        resourceUri:
          type: string
          examples:
            - >-
              /events/v1beta1/system-webhooks/123e4567-e89b-12d3-a456-426614174000
          description: URI to the webhook
    SystemPatchSubscriptionInput:
      type: object
      description: Schema for updating a subscription.
      required:
        - subscriptionId
        - eventType
        - webhook
      properties:
        subscriptionId:
          type: string
          description: Subscription Id to update.
        eventType:
          type: string
          description: >-
            The type of event to subscribe. [Events
            Standard](https://developer.greenlake.hpe.com/docs/greenlake/services/event/public/events/)
          examples:
            - com.hpe.greenlake.sample-publisher.v1beta1.sample-event1
        webhook:
          $ref: '#/components/schemas/SystemWebhookResourceInputRef'
    SystemSubscriptionInput:
      type: object
      description: Schema for creating a new subscription.
      required:
        - eventType
        - webhook
      properties:
        eventType:
          type: string
          description: >-
            The type of event to subscribe. [Events
            Standard](https://developer.greenlake.hpe.com/docs/greenlake/services/event/public/events/)
          examples:
            - com.hpe.greenlake.sample-publisher.v1beta1.sample-event1
        webhook:
          $ref: '#/components/schemas/SystemWebhookResourceInputRef'
    SystemSubscriptionResponse:
      type: object
      description: Outlines the details of a subscription response.
      required:
        - id
        - type
        - eventType
        - resourceUri
        - webhook
        - hpePrincipal
        - generation
        - createdBy
        - createdAt
        - updatedAt
        - updatedBy
      properties:
        id:
          type: string
          description: Unique identifier of the subscription.
          format: uuid
          examples:
            - 0908777a-788f-45da-afb8-295c626e4d14
        type:
          type: string
          description: The type of the resource.
          const: events/subscription
        eventType:
          type: string
          description: The subscription type name.
          examples:
            - com.hpe.greenlake.sample-publisher.v1beta1.sample-event1
        resourceUri:
          type: string
          description: URI to the subscription.
          examples:
            - >-
              /events/v1beta1/system-subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6
        webhook:
          $ref: '#/components/schemas/SystemWebhookResourceResponseRef'
        hpePrincipal:
          type: string
          description: Security principal subject notation.
          examples:
            - user:<opaque-global-id>
        generation:
          type: integer
          minimum: 0
          description: >-
            Monotonically increasing update counter to track the subscription
            version.
          examples:
            - 1
        createdBy:
          type: string
          description: The user that created the subscription.
        createdAt:
          type: string
          format: date-time
          description: The date and time the subscription is created.
        updatedBy:
          type: string
          description: The user that updated the subscription.
        updatedAt:
          type: string
          format: date-time
          description: The last date and time the subscription is updated.
    SystemSubscriptionListResponse:
      type: object
      description: A list response format for subscriptions.
      required:
        - items
        - count
        - offset
        - total
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/SystemSubscriptionResponse'
          description: >-
            An array of subscription objects, each representing a unique
            subscription.
        count:
          type: integer
          description: >-
            The number of subscription objects returned in the `items` array for
            the current request.
        offset:
          type: integer
          description: >-
            The zero-based index in the complete list of retrieved subscriptions
            that marks the beginning of the response.
        total:
          type: integer
          description: >-
            The total number of subscriptions available in the system that match
            the provided query or filters.
    ApiError:
      type: object
      description: A generic error schema used across the API for error handling.
      required:
        - errorCode
        - message
        - debugId
        - httpStatusCode
      properties:
        httpStatusCode:
          type: integer
          description: HTTP equivalent status code
        message:
          type: string
          description: User-friendly error message
        debugId:
          type: string
          format: uuid
          description: Unique identifier for the instance of this error
        errorCode:
          type: string
          description: Unique identifier for the instance of this error
