swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model.
  title: PostgreSQLManagementClient
  version: 2018-06-01-privatepreview
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2018-06-01-privatepreview/PrivateEndpointConnections.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: postgresql-PrivateEndpointConnections
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters:
  ApiVersionParameter:
    description: The API version to use for the request.
    in: query
    name: api-version
    required: true
    type: string
    x-ms-parameter-location: client
  ResourceGroupParameter:
    description: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    in: path
    name: resourceGroupName
    required: true
    type: string
    x-ms-parameter-location: method
  ServerNameParameter:
    description: The name of the server.
    in: path
    name: serverName
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionIdParameter:
    description: The subscription ID that identifies an Azure subscription.
    in: path
    name: subscriptionId
    required: true
    type: string
    x-ms-parameter-location: client
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections":
    get:
      description: Gets all private endpoint connections on a server.
      operationId: PrivateEndpointConnections_ListByServer
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved private endpoint connections.
          schema:
            $ref: "#/definitions/PrivateEndpointConnectionListResult"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - PrivateEndpointConnections
      x-ms-examples:
        Gets list of private endpoint connections on a server.:
          parameters:
            api-version: 2018-06-01-privatepreview
            resourceGroupName: Default
            serverName: test-svr
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2
                    name: private-endpoint-connection-name
                    properties:
                      privateEndpoint:
                        id: /subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name
                      privateLinkServiceConnectionState:
                        actionsRequired: None
                        description: Auto-approved
                        status: Approved
                      provisioningState: Ready
                    type: Microsoft.DBforPostgreSQL/servers/privateEndpointConnections
                  - id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2
                    name: private-endpoint-connection-name-2
                    properties:
                      privateEndpoint:
                        id: /subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2
                      privateLinkServiceConnectionState:
                        actionsRequired: None
                        description: Auto-approved
                        status: Approved
                      provisioningState: Ready
                    type: Microsoft.DBforPostgreSQL/servers/privateEndpointConnections
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}":
    delete:
      description: Deletes a private endpoint connection with a given name.
      operationId: PrivateEndpointConnections_Delete
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - in: path
          name: privateEndpointConnectionName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully deleted private endpoint connection.
        "202":
          description: Accepted
        "204":
          description: Private endpoint connection does not exist.
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - PrivateEndpointConnections
      x-ms-examples:
        Deletes a private endpoint connection with a given name.:
          parameters:
            api-version: 2018-06-01-privatepreview
            privateEndpointConnectionName: private-endpoint-connection-name
            resourceGroupName: Default
            serverName: test-svr
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200": {}
            "202": {}
            "204": {}
      x-ms-long-running-operation: true
    get:
      description: Gets a private endpoint connection.
      operationId: PrivateEndpointConnections_Get
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - description: The name of the private endpoint connection.
          in: path
          name: privateEndpointConnectionName
          required: true
          type: string
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully retrieved a specified private endpoint connection.
          schema:
            $ref: "#/definitions/PrivateEndpointConnection"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - PrivateEndpointConnections
      x-ms-examples:
        Gets private endpoint connection.:
          parameters:
            api-version: 2018-06-01-privatepreview
            privateEndpointConnectionName: private-endpoint-connection-name
            resourceGroupName: Default
            serverName: test-svr
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name
                name: private-endpoint-connection-name
                properties:
                  privateEndpoint:
                    id: /subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name
                  privateLinkServiceConnectionState:
                    actionsRequired: None
                    description: Auto-approved
                    status: Approved
                  provisioningState: Ready
                type: Microsoft.DBforPostgreSQL/servers/privateEndpointConnections
    patch:
      description: Updates private endpoint connection with the specified tags.
      operationId: PrivateEndpointConnections_UpdateTags
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - in: path
          name: privateEndpointConnectionName
          required: true
          type: string
        - description: Parameters supplied to the Update private endpoint connection Tags operation.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/TagsObject"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/PrivateEndpointConnection"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      summary: Updates tags on private endpoint connection.
      tags:
        - PrivateEndpointConnections
      x-ms-examples:
        Update private endpoint connection Tags:
          parameters:
            api-version: 2018-06-01-privatepreview
            parameters:
              tags:
                key1: val1
                key2: val2
                key3: val3
            privateEndpointConnectionName: private-endpoint-connection-name
            resourceGroupName: Default
            serverName: test-svr
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name
                name: private-endpoint-connection-name
                properties:
                  privateEndpoint:
                    id: /subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name
                  privateLinkServiceConnectionState:
                    actionsRequired: None
                    description: Approved by johndoe@contoso.com
                    status: Approved
                  provisioningState: Ready
                type: Microsoft.DBforPostgreSQL/servers/privateEndpointConnections
      x-ms-long-running-operation: true
    put:
      description: Approve or reject a private endpoint connection with a given name.
      operationId: PrivateEndpointConnections_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/ResourceGroupParameter"
        - $ref: "#/parameters/ServerNameParameter"
        - in: path
          name: privateEndpointConnectionName
          required: true
          type: string
        - in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/PrivateEndpointConnection"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Successfully approved or rejected private endpoint connection.
          schema:
            $ref: "#/definitions/PrivateEndpointConnection"
        "202":
          description: Accepted
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/CloudError"
      tags:
        - PrivateEndpointConnections
      x-ms-examples:
        Approve or reject a private endpoint connection with a given name.:
          parameters:
            api-version: 2018-06-01-privatepreview
            parameters:
              properties:
                privateLinkServiceConnectionState:
                  description: Approved by johndoe@contoso.com
                  status: Approved
            privateEndpointConnectionName: private-endpoint-connection-name
            resourceGroupName: Default
            serverName: test-svr
            subscriptionId: 00000000-1111-2222-3333-444444444444
          responses:
            "200":
              body:
                id: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name
                name: private-endpoint-connection-name
                properties:
                  privateEndpoint:
                    id: /subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name
                  privateLinkServiceConnectionState:
                    actionsRequired: None
                    description: Approved by johndoe@contoso.com
                    status: Approved
                  provisioningState: Ready
                type: Microsoft.DBforPostgreSQL/servers/privateEndpointConnections
            "202": {}
      x-ms-long-running-operation: true
definitions:
  CloudError:
    description: An error response from the Batch service.
    properties:
      error:
        $ref: "#/definitions/CloudErrorBody"
    x-ms-external: true
  CloudErrorBody:
    description: An error response from the Batch service.
    properties:
      code:
        description: An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
        type: string
      details:
        description: A list of additional details about the error.
        items:
          $ref: "#/definitions/CloudErrorBody"
        type: array
      message:
        description: A message describing the error, intended to be suitable for display in a user interface.
        type: string
      target:
        description: The target of the particular error. For example, the name of the property in error.
        type: string
    x-ms-external: true
  PrivateEndpointConnection:
    allOf:
      - $ref: "#/definitions/ProxyResource"
    description: A private endpoint connection
    properties:
      properties:
        $ref: "#/definitions/PrivateEndpointConnectionProperties"
        description: Resource properties.
        x-ms-client-flatten: true
    type: object
  PrivateEndpointConnectionListResult:
    description: A list of private endpoint connections.
    properties:
      nextLink:
        description: Link to retrieve next page of results.
        readOnly: true
        type: string
      value:
        description: Array of results.
        items:
          $ref: "#/definitions/PrivateEndpointConnection"
        readOnly: true
        type: array
    type: object
  PrivateEndpointConnectionProperties:
    description: Properties of a private endpoint connection.
    properties:
      privateEndpoint:
        $ref: "#/definitions/PrivateEndpointProperty"
        description: Private endpoint which the connection belongs to.
      privateLinkServiceConnectionState:
        $ref: "#/definitions/PrivateLinkServiceConnectionStateProperty"
        description: Connection state of the private endpoint connection.
      provisioningState:
        description: State of the private endpoint connection.
        readOnly: true
        type: string
    type: object
  PrivateEndpointProperty:
    properties:
      id:
        description: Resource id of the private endpoint.
        type: string
    type: object
    x-ms-azure-resource: true
  PrivateLinkServiceConnectionStateProperty:
    properties:
      actionsRequired:
        description: The actions required for private link service connection.
        readOnly: true
        type: string
      description:
        description: The private link service connection description.
        type: string
      status:
        description: The private link service connection status.
        type: string
    required:
      - status
      - description
    type: object
  ProxyResource:
    allOf:
      - $ref: "#/definitions/Resource"
    description: ARM proxy resource.
    properties: {}
    type: object
  Resource:
    description: ARM resource.
    properties:
      id:
        description: Resource ID.
        readOnly: true
        type: string
      name:
        description: Resource name.
        readOnly: true
        type: string
      type:
        description: Resource type.
        readOnly: true
        type: string
    type: object
    x-ms-azure-resource: true
  TagsObject:
    description: Tags object for patch operations.
    properties:
      tags:
        additionalProperties:
          type: string
        description: Resource tags.
        type: object
