openapi: 3.0.1
info:
  title: LDAP Divvy Cloud Synchronizer REST API
  description: |
    # The LDAP DivvyCloud Synchronization API provides the following features

    - Automated synchronization of LDAP groups to groups, roles, and mappings in DivvyCloud.
    - Health & Status support in PagerDuty

    ### Release Notes

    v1.0.0
    - Initial Release
  version: 1.0.0
  termsOfService: 'https://neo.pearson.com/docs/DOC-786058'
  contact:
    email: io-divvycloud-support@pearson.com
  license:
    name: Pearson Proprietary
    url: 'https://neo.pearson.com/docs/DOC-786058'
servers:
  - url: 'https://api.pearsoncloudmanagement.com/divvycloud'
    description: Production LDAP Divvy Sync Environment (Live)
  - url: 'https://api-dev.pearsoncloudmanagement.com/divvycloud'
    description: Development LDAP Divvy Sync Environment (Development)
  - url: 'http://localhost:3000'
    description: localhost testing
tags:
  - name: synchronize
    description: Synchronization of ldap to divvy cloud
    externalDocs:
      description: Synchronization documentation
      url: 'https://neo.pearson.com/docs/DOC-786058'
  - name: healthstatus
    description: Information for health and status of synchronizer
    externalDocs:
      description: Health & Status Documentation
      url: 'https://neo.pearson.com/docs/DOC-786058'
x-amazon-apigateway-request-validators:
  all:
    validateRequestBody: true
    validateRequestParameters: true
  params-only:
    validateRequestBody: false
    validateRequestParameters: true
paths:
  /healthstatus:
    get:
      tags:
        - healthstatus
      summary: Retrieve health and status
      description: Retrive health and status
      operationId: getHealthStatus
      responses:
        '200':
          description: successful operation
          headers:
            Content-Type:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  api_version:
                    type: string
                    default: 2.0.0
                  db_version:
                    type: string
                    default: unknown
                  release_date:
                    type: string
                    default: '2020-12-01'
                  release_notes:
                    type: string
                    default: Post-MVP Release
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Server error.  Try again.
      x-amazon-apigateway-request-validator: params-only
      x-amazon-apigateway-integration:
        type: aws_proxy
        uri: 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:DivvyGroupRolesSyncHealthStatusFunction/invocations'
        httpMethod: POST
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        responses:
          default:
            statusCode: 200
            responseParameters:
              method.response.header.Access-Control-Allow-Headers: '''Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token'''
              method.response.header.Access-Control-Allow-Methods: '''*'''
              method.response.header.Access-Control-Allow-Origin: '''*'''
  /synchronize:
    get:
      tags:
        - synchronize
      summary: Synchronize LDAP with Divvy Cloud
      description: |
        Activate the synchronization process to reflect joiners and leavers in LDAP in Divvy Cloud.
      operationId: synchronize
      responses:
        '200':
          description: successful operation
          headers:
            Content-Type:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Server error.  Try again.
      x-amazon-apigateway-request-validator: params-only
      x-amazon-apigateway-integration:
        type: aws_proxy
        uri: 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:DivvyGroupsRolesSyncFunction/invocations'
        httpMethod: POST
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        responses:
          default:
            statusCode: 200
            responseParameters:
              method.response.header.Access-Control-Allow-Headers: '''Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token'''
              method.response.header.Access-Control-Allow-Methods: '''*'''
              method.response.header.Access-Control-Allow-Origin: '''*'''
  /:
    get:
      summary: API landing page
      operationId: APILandingPage
      responses:
        '200':
          description: Default 200 response for CORS method
          headers:
            Content-Type:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content: {}
      x-amazon-apigateway-integration:
        responses:
          default:
            statusCode: '200'
            responseParameters:
              method.response.header.Content-Type: '''text/html'''
              method.response.header.Access-Control-Allow-Headers: '''Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token'''
              method.response.header.Access-Control-Allow-Methods: '''*'''
              method.response.header.Access-Control-Allow-Origin: '''*'''
            responseTemplates:
              text/html: |
                <!DOCTYPE html>
                <html lang="en">
                  <head>
                    <meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 charecters -->
                    <script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
                  </head>
                  <body>
                    <!-- Swagger build propagates info.version. Change the version in openapi.yaml, not here. v0.0.0 is a placeholder. -->
                    <rapi-doc spec-url = "https://downloads.pearsoncloudmanagement.com/divvycloud/$context.stage/api/openapi_bundled_v1.0.0.yaml"/>
                  </body>
                </html>
        requestTemplates:
          application/json: '{"statusCode": 200}'
        passthroughBehavior: when_no_match
        type: mock
externalDocs:
  description: Find out more about LDAP Divvy Sync and its Capabilities
  url: 'https://neo.pearson.com/docs/DOC-786058'
