openapi: 3.0.0
info:
  title: Tenancy Access Controls
  version: 2.0.0
  description: Tenancy Access Controls API Documentation
  contact:
    name: OpsRamp Support
    email: support@opsramp.com
    url: 'https://www.opsramp.com/about-opsramp/contact-us/'
tags:
  - name: tenancy-access-controls
    description: Tenancy Documentation APIs.
    externalDocs:
      url: 'https://develop.opsramp.com/tenancy-access-controls/'
servers:
  - url: 'https://api.opsramp.com'
    description: Partner - All Others
  - url: 'https://{subdomain}.api.opsramp.com'
    description: Partner or Client custom branded sub-domain
    variables:
      subdomain:
        default: demo
        description: Custom sub-domain assigned to the client
paths:
  '/api/v3/tenants/{partnerId}/clients/queries':
    summary: Search Clients
    description: post a query to clients.
    x-new-path: true
    x-internal: true
    post:
      tags:
        - tenancy-access-controls
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: ./models/opsramp-tenancy-access-controls/clients-queries-response-schema.v1.yaml
              examples:
                name-contains-response:
                  $ref: ./models/opsramp-tenancy-access-controls/clients-queries-response-name-contains.v1.yaml
      requestBody:
        content:
          application/json:
            schema:
              $ref: ./models/opsramp-tenancy-access-controls/clients-queries-request-schema.v1.yaml
            examples:
              name-contains-request:
                value:
                  objectType: client
                  fields:
                    - name
                    - activated
                    - updatedTime
                    - createdTime
                    - timeZone
                  filterCriteria: name contains 'acme'
    parameters:
      - name: partnerId
        in: path
        required: true
        schema:
          type: string
        description: Partner Id defined for the tenant
  'tenancy/api/v3/release-version':
   
   description: |
   
     This API retrieves the release version of the portal along with the date when the portal was upgraded.

     **Note**:

     1. Until the upgrade is fully completed, the API will continue to return the previous version. 
     
     2. After each PoD upgrade, the response payload will be updated to reflect the latest version.
   summary: 'release-version'
   x-new-path: true
   get:
      
      summary: Returns the release version of the portal.
      operationId: getLatestReleaseVersion
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  productVersion:
                    type: string
                    description: The current product or portal version.
                    example: "17.0_2024.05-U1"
                  upgradedOn:
                    type: string
                    format: date-time
                    description: The date and time when the PoD was last upgraded.
                    example: "2024-07-08T15:57:08Z"                
              examples:
                example-release-info:
                  value:
                    productVersion: 17.0_2024.05-U1
                    upgradeOn: "2024-07-08T15:57:08Z"
      description: Returns the release version of the portal.
components:
  securitySchemes:
    accessToken:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: 'https://subdomain.api.opsramp.com'
          scopes: {}
  parameters:
    tenantId:
      in: path
      name: tenantId
      schema:
        type: string
      required: true
      description: Describes the clientId or mspId of the tenant
    partnerId:
      name: partnerId
      in: path
      required: true
      schema:
        type: string
      description: Partner Id defined for the tenant
