swagger: '2.0'
info:
    title: puppet
    version: '3'
    description: Puppet API documentation
    license:
        name: Apache 2.0
        url: 'https://www.apache.org/licenses/LICENSE-2.0'
consumes:
    - application/json
produces:
    - application/json
paths:
    '/catalog/{nodename}':
        get:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - Catalog
            parameters:
                -
                    name: nodename
                    description: Node name
                    in: path
                    required: true
                    type: string
                -
                    name: environment
                    description: the environment name.
                    in: query
                    required: true
                    type: string
                -
                    name: facts_format
                    description: must be 'application/json' or 'pson'.
                    in: query
                    required: true
                    type: string
                -
                    name: facts
                    description: >-
                        serialized JSON or PSON of the facts hash. Since facts can contain &, which is also
                        the HTTP query parameter delimiter, facts are doubly-escaped.
                    in: query
                    required: true
                    type: string
                -
                    name: transaction_uuid
                    description: a transaction uuid identifying the entire transaction.
                    in: query
                    required: true
                    type: string
                -
                    name: static_catalog
                    description: a boolean requesting a static catalog if available; should always be true.
                    in: query
                    type: boolean
                -
                    name: checksum_type
                    description: a dot-separated list of checksum types supported by the agent.
                    in: query
                    type: string
                -
                    name: configured_environment
                    description: the environment configured on the client.
                    in: query
                    type: string
                -
                    name: job_id
                    description: which orchestration job triggered this catalog request.
                    in: query
                    type: string
            responses:
                '200':
                    description: Success
                    schema:
                        $ref: '#/definitions/Catalog'
            operationId: getCatalogNodename
            summary: Retrieve a catalog.
            description: Retrieve a catalog.
        post:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - Catalog
            parameters:
                -
                    name: nodename
                    description: Node name
                    in: path
                    required: true
                    type: string
                -
                    name: body
                    schema:
                        $ref: '#/definitions/CatalogPostRequest'
                    in: body
                    required: true
            responses:
                '200':
                    description: Success
                    schema:
                        $ref: '#/definitions/Catalog'
            operationId: postCatalogNodename
            summary: Retrieve a catalog.
            description: Retrieve a catalog.
        parameters:
            -
                name: nodename
                description: Node name
                in: path
                required: true
                type: string
    '/node/{certname}':
        get:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - Node
            parameters:
                -
                    name: certname
                    description: cert name
                    in: path
                    required: true
                    type: string
                -
                    name: environment
                    description: the environment name.
                    in: query
                    required: true
                    type: string
                -
                    name: transaction_uuid
                    description: a transaction uuid identifying the entire transaction.
                    in: query
                    required: true
                    type: string
                -
                    name: configured_environment
                    description: the environment configured on the client.
                    in: query
                    type: string
            responses:
                '200':
                    description: Success
                    schema:
                        $ref: '#/definitions/Node'
            operationId: getNodeCertname
            summary: Retrieve data for a node.
            description: Retrieve data for a node.
    /environments:
        get:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - Environments
            responses:
                '200':
                    description: Success
                    schema:
                        $ref: '#/definitions/Environment'
            operationId: getEnvironments
            summary: Get the list of known environments.
            description: Get the list of known environments.
    '/report/{nodename}':
        put:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - Report
            parameters:
                -
                    name: nodename
                    description: Node name
                    in: path
                    required: true
                    type: integer
                -
                    name: environment
                    description: environment name
                    in: query
                    required: true
                    type: string
                -
                    name: body
                    schema:
                        $ref: '#/definitions/ReportPutRequest'
                    in: body
                    required: true
            responses:
                '200':
                    description: Success
                    schema:
                        $ref: '#/definitions/Report'
            operationId: putReportNodename
            summary: Allows clients to send reports to the master
            description: Allows clients to send reports to the master
    '/status/{name}':
        get:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - Status
            parameters:
                -
                    name: name
                    description: 'Name of a running master '
                    in: path
                    required: true
                    type: string
                -
                    name: environment
                    description: environment name
                    in: query
                    required: true
                    type: string
            responses:
                '200':
                    description: Success
                    schema:
                        $ref: '#/definitions/Status'
            operationId: getStatusName
            summary: Provides information about a running master.
            description: Provides information about a running master.
    '/file_content/{mount_point}/{name}':
        get:
            consumes:
                - application/json
                - text/xml
            produces:
                - application/json
                - text/xml
            tags:
                - FileContent
            parameters:
                -
                    name: mount_point
                    description: mount point
                    in: path
                    required: true
                    type: string
                -
                    name: name
                    description: the path to the file within the mount_point that is requested.
                    in: path
                    required: true
                    type: string
            responses:
                '200':
                    description: Success
            operationId: getFilecontentMountpointName
            summary: Retrieve the contents of the specified file.
            description: Retrieve the contents of the specified file.
    '/file_metadata/{mount}/{path}':
        get:
            consumes:
                - application/json
                - text/xml
            produces:
                - application/json
                - text/xml
            tags:
                - FileMetadata
            parameters:
                -
                    name: environment
                    description: environment name
                    in: query
                    required: true
                    type: string
                -
                    name: mount
                    description: mount name
                    in: path
                    required: true
                    type: string
                -
                    name: path
                    description: path to file
                    in: path
                    required: true
                    type: string
                -
                    name: links
                    description: either manage (default) or follow.
                    in: query
                    type: string
                -
                    name: checksum_type
                    description: the checksum type to calculate the checksum value for the result metadata.
                    in: query
                    type: string
                -
                    name: source_permissions
                    description: 'whether (and how) Puppet should copy owner, group, and mode permissions.'
                    in: query
                    type: string
            responses:
                '200':
                    description: Success
                    schema:
                        $ref: '#/definitions/FileMetadata'
            operationId: getFilemetadataMountPath
            summary: Returns select metadata for a single file or many files.
            description: Returns select metadata for a single file or many files.
    '/file_bucket_file/md5/{checksum}':
        get:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - FileBucketfile
            parameters:
                -
                    name: checksum
                    description: checksum md5 value
                    in: path
                    required: true
                    type: string
                -
                    name: environment
                    description: environment name
                    in: query
                    required: true
                    type: string
            responses:
                '200':
                    description: Success
            operationId: getFilebucketfileMd5Checksum
            summary: Retrieve the contents of a file.
            description: Retrieve the contents of a file.
        put:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - FileBucketfile
            parameters:
                -
                    name: checksum
                    description: Checksum md5 value
                    in: path
                    required: true
                    type: string
                -
                    name: environment
                    description: environment name
                    in: query
                    required: true
                    type: string
                -
                    name: body
                    schema:
                        $ref: '#/definitions/FilebucketfilePutRequest'
                    in: body
                    required: true
            responses:
                '200':
                    description: Success
            operationId: putFilebucketfileMd5Checksum
            summary: Save a file to the filebucket.
            description: Save a file to the filebucket.
        head:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - FileBucketfile
            parameters:
                -
                    name: checksum
                    description: checksum md5 value
                    in: path
                    required: true
                    type: string
                -
                    name: environment
                    description: environment name
                    in: query
                    required: true
                    type: string
            responses:
                '200':
                    description: Success
            operationId: headFilebucketfileMd5Checksum
            summary: Check if a file is present in the filebucket.
            description: Check if a file is present in the filebucket.
    '/file_bucket_file/md5/{checksum}/{originalPath}':
        get:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - FileBucketfile
            parameters:
                -
                    name: checksum
                    description: checksum md5 value
                    in: path
                    required: true
                    type: string
                -
                    name: originalPath
                    description: the full absolute path of the file on the client system.
                    in: path
                    required: true
                    type: string
                -
                    name: environment
                    description: environment name
                    in: query
                    required: true
                    type: string
            responses:
                '200':
                    description: Success
            operationId: getFilebucketfileMd5ChecksumOriginalPath
            summary: Retrieve the contents of a file.
            description: Retrieve the contents of a file.
        put:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - FileBucketfile
            parameters:
                -
                    name: checksum
                    description: Checksum md5 value
                    in: path
                    required: true
                    type: string
                -
                    name: originalPath
                    description: the full absolute path of the file on the client system.
                    in: path
                    required: true
                    type: string
                -
                    name: environment
                    description: environment name
                    in: query
                    required: true
                    type: string
                -
                    name: body
                    schema:
                        $ref: '#/definitions/FilebucketfilePutRequest'
                    in: body
                    required: true
            responses:
                '200':
                    description: Success
            operationId: putFilebucketfileMd5ChecksumOriginalPath
            summary: Save a file to the filebucket.
            description: Save a file to the filebucket.
        head:
            consumes:
                - application/json
            produces:
                - application/json
            tags:
                - FileBucketfile
            parameters:
                -
                    name: checksum
                    description: checksum md5 value
                    in: path
                    required: true
                    type: string
                -
                    name: originalPath
                    description: the full absolute path of the file on the client system.
                    in: path
                    required: true
                    type: string
                -
                    name: environment
                    description: environment name
                    in: query
                    required: true
                    type: string
            responses:
                '200':
                    description: Success
            operationId: headFilebucketfileMd5ChecksumOriginalPath
            summary: Check if a file is present in the filebucket.
            description: Check if a file is present in the filebucket.
definitions:
    Catalog:
        title: Root Type for Catalog
        description: ''
        type: object
        properties:
            tags:
                type: array
                items:
                    type: string
            name:
                type: string
            version:
                format: int32
                type: integer
            code_id:
                type: string
            catalog_uuid:
                type: string
            catalog_format:
                format: int32
                type: integer
            environment:
                type: string
            resources:
                type: array
                items:
                    type: object
                    properties:
                        type:
                            type: string
                        title:
                            type: string
                        tags:
                            type: array
                            items:
                                type: string
                        exported:
                            type: boolean
                        parameters:
                            type: object
                            properties:
                                name:
                                    type: string
            edges:
                type: array
                items:
                    type: object
                    properties:
                        source:
                            type: string
                        target:
                            type: string
            classes:
                type: array
                items:
                    type: string
        example:
            tags:
                - settings
                - multi_param_class
                - class
            name: elmo.mydomain.com
            version: 1377473054
            code_id: 'null'
            catalog_uuid: 827a74c8-cf98-44da-9ff7-18c5e4bee41e
            catalog_format: 1
            environment: production
            resources:
                -
                    type: Stage
                    title: main
                    tags:
                        - stage
                    exported: false
                    parameters:
                        name: main
                -
                    type: Class
                    title: Settings
                    tags:
                        - class
                        - settings
                    exported: false
                -
                    type: Class
                    title: main
                    tags:
                        - class
                    exported: false
                    parameters:
                        name: main
                -
                    type: Class
                    title: Multi_param_class
                    tags:
                        - class
                        - multi_param_class
                    line: 10
                    exported: false
                    parameters:
                        one: hello
                        two: world
                -
                    type: Notify
                    title: foo
                    tags:
                        - notify
                        - foo
                        - class
                        - multi_param_class
                    line: 4
                    exported: false
                    parameters:
                        message: 'One is hello, two is world'
            edges:
                -
                    source: 'Stage[main]'
                    target: 'Class[Settings]'
                -
                    source: 'Stage[main]'
                    target: 'Class[main]'
                -
                    source: 'Stage[main]'
                    target: 'Class[Multi_param_class]'
                -
                    source: 'Class[Multi_param_class]'
                    target: 'Notify[foo]'
            classes:
                - settings
                - multi_param_class
    Node:
        title: Root Type for Node
        description: ''
        type: object
        properties:
            name:
                type: string
            parameters:
                type: object
                properties:
                    architecture:
                        type: string
                    kernel:
                        type: string
                    blockdevices:
                        type: string
                    clientversion:
                        type: string
                    clientnoop:
                        type: string
                    environment:
                        type: string
            environment:
                type: string
        example:
            name: thinky.corp.puppetlabs.net
            parameters:
                architecture: amd64
                kernel: Linux
                blockdevices: 'sda,sr0'
                clientversion: 3.3.1
                clientnoop: 'false'
                environment: production
            environment: production
    Environment:
        title: Root Type for Environment
        description: ''
        type: object
        properties:
            search_paths:
                type: array
                items:
                    type: string
            environments:
                type: object
                properties:
                    production:
                        type: object
                        properties:
                            settings:
                                type: object
                                properties:
                                    modulepath:
                                        type: array
                                        items:
                                            type: string
                                    manifest:
                                        type: array
                                        items:
                                            type: string
                                    environment_timeout:
                                        format: int32
                                        type: integer
                                    config_version:
                                        type: string
        example:
            search_paths:
                - /etc/puppetlabs/code/environments
            environments:
                production:
                    settings:
                        modulepath:
                            - /etc/puppetlabs/code/environments/production/modules
                            - /etc/puppetlabs/code/environments/development/modules
                        manifest:
                            - /etc/puppetlabs/code/environments/production/manifests
                        environment_timeout: 180
                        config_version: /version/of/config
    Report:
        title: Root Type for Report
        description: ''
        type: object
        properties:
            host:
                type: string
            time:
                type: string
            configuration_version:
                format: int32
                type: integer
            transaction_uuid:
                type: string
            code_id:
                type: string
            job_id:
                type: string
            catalog_uuid:
                type: string
            catalog_format:
                format: int32
                type: integer
            report_format:
                format: int32
                type: integer
            puppet_version:
                type: string
            status:
                type: string
            transaction_completed:
                type: boolean
            noop:
                type: boolean
            noop_pending:
                type: boolean
            environment:
                type: string
            logs:
                type: array
                items:
                    type: object
                    properties:
                        level:
                            type: string
                        message:
                            type: string
                        source:
                            type: string
                        tags:
                            type: array
                            items:
                                type: string
                        time:
                            type: string
                        file:
                            type: string
                        line:
                            type: string
            metrics:
                type: object
                properties:
                    resources:
                        type: object
                        properties:
                            name:
                                type: string
                            label:
                                type: string
                            values:
                                type: array
                                items:
                                    type: array
                                    items:
                                        type: string
                    time:
                        type: object
                        properties:
                            name:
                                type: string
                            label:
                                type: string
                            values:
                                type: array
                                items:
                                    type: array
                                    items:
                                        type: string
                    changes:
                        type: object
                        properties:
                            name:
                                type: string
                            label:
                                type: string
                            values:
                                type: array
                                items:
                                    type: array
                                    items:
                                        type: string
                    events:
                        type: object
                        properties:
                            name:
                                type: string
                            label:
                                type: string
                            values:
                                type: array
                                items:
                                    type: array
                                    items:
                                        type: string
            resource_statuses:
                type: object
                properties:
                    'Notify[a resource]':
                        type: object
                        properties:
                            title:
                                type: string
                            file:
                                type: string
                            line:
                                type: string
                            resource:
                                type: string
                            resource_type:
                                type: string
                            provider_used:
                                type: string
                            containment_path:
                                type: array
                                items:
                                    type: string
                            evaluation_time:
                                type: string
                            tags:
                                type: array
                                items:
                                    type: string
                            time:
                                type: string
                            failed:
                                type: boolean
                            changed:
                                type: boolean
                            out_of_sync:
                                type: boolean
                            skipped:
                                type: boolean
                            change_count:
                                format: int32
                                type: integer
                            out_of_sync_count:
                                format: int32
                                type: integer
                            events:
                                type: array
                                items: {}
            cached_catalog_status:
                type: string
        example:
            host: kermit.com
            time: '2013-09-12T03:50:59.009301000+02:00'
            configuration_version: 1357986
            transaction_uuid: df34516e-4050-402d-a166-05b03b940749
            code_id: 'null'
            job_id: 'null'
            catalog_uuid: 827a74c8-cf98-44da-9ff7-18c5e4bee41e
            catalog_format: 1
            report_format: 9
            puppet_version: 5.0.0
            status: unchanged
            transaction_completed: true
            noop: false
            noop_pending: false
            environment: test_environment
            logs:
                -
                    level: warning
                    message: log message
                    source: Puppet
                    tags:
                        - warning
                    time: '2013-09-12T03:50:59.009328000+02:00'
                    file: nil
                    line: nil
            metrics:
                resources:
                    name: resources
                    label: Resources
                    values:
                        -
                            - total
                            - Total
                            - 1
                        -
                            - skipped
                            - Skipped
                            - 0
                        -
                            - failed
                            - Failed
                            - 0
                        -
                            - failed_to_restart
                            - Failed to restart
                            - 0
                        -
                            - restarted
                            - Restarted
                            - 0
                        -
                            - changed
                            - Changed
                            - 1
                        -
                            - out_of_sync
                            - Out of sync
                            - 0
                        -
                            - scheduled
                            - Scheduled
                            - 0
                time:
                    name: time
                    label: Time
                    values:
                        -
                            - timing
                            - Timing
                            - 4
                        -
                            - total
                            - Total
                            - 4
                changes:
                    name: changes
                    label: Changes
                    values:
                        -
                            - total
                            - Total
                            - 0
                events:
                    name: events
                    label: Events
                    values:
                        -
                            - total
                            - Total
                            - 0
                        -
                            - failure
                            - Failure
                            - 0
                        -
                            - success
                            - Success
                            - 0
            resource_statuses:
                'Notify[a resource]':
                    title: a resource
                    file: nil
                    line: nil
                    resource: 'Notify[a resource]'
                    resource_type: Notify
                    provider_used: nil
                    containment_path:
                        - 'Notify[a resource]'
                    evaluation_time: nil
                    tags:
                        - notify
                    time: '2013-09-12T03:50:59.009238000+02:00'
                    failed: false
                    changed: true
                    out_of_sync: false
                    skipped: false
                    change_count: 0
                    out_of_sync_count: 0
                    events: []
            cached_catalog_status: not_used
    Status:
        title: Root Type for Status
        description: ''
        type: object
        properties:
            is_alive:
                type: boolean
            version:
                type: string
        example:
            is_alive: true
            version: 3.3.2
    FileMetadata:
        title: Root Type for FileMetadata
        description: ''
        type: object
        properties:
            checksum:
                type: object
                properties:
                    type:
                        type: string
                    value:
                        type: string
            destination:
                type: string
            group:
                format: int32
                type: integer
            links:
                type: string
            mode:
                format: int32
                type: integer
            owner:
                format: int32
                type: integer
            path:
                type: string
            relative_path:
                type: string
            type:
                type: string
        example:
            checksum:
                type: md5
                value: '{md5}d0a10f45491acc8743bc5a82b228f89e'
            destination: 'null'
            group: 20
            links: manage
            mode: 420
            owner: 501
            path: /etc/puppetlabs/code/modules/example/files/just_a_file.txt
            relative_path: 'null'
            type: file
    FilebucketfilePutRequest:
        title: Root Type for FilebucketfilePutRequest
        description: ''
        type: object
        example: {}
    ReportPutRequest:
        title: Root Type for ReportRequestBody
        description: ''
        type: object
        properties:
            environment:
                type: string
        example: {}
    CatalogPostRequest:
        title: Root Type for CatalogRequestBody
        description: ''
        type: object
        properties:
            facts_format:
                type: string
            facts:
                type: string
            transaction_uuid:
                type: string
            static_catalog:
                type: string
            checksum_type:
                type: string
            configured_environment:
                type: string
            job_id:
                type: string
            environment:
                type: string
        example:
            environment: string
            facts_format: string
            facts: string
            transaction_uuid: string
            static_catalog: boolean
            checksum_type: string
            configured_environment: string
            job_id: string
