Onboarding HTTP API (MOD)

Description

Onboarding API is sub-component under MOD provides following function:

  1. API to add/update data-formats

  2. API to add/update components (component_Spec)

These API can be invoked by MS owners or by Acumos adapter to upload artifact into MOD catalog

API name

Swagger

Inventory

link

Base URL

http:///onboarding

ONBOARDING

Default namespace

GET /components/{component_id}

Description

Get a Component

Parameters

Name

Located in

Required

Type

Format

Properties

Description

component_id

path

Yes

string

Request

Headers
X-Fields: An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html

Responses

200

Success

Type: component fields extended inline

Example:

{
    "componentType": "somestring",
    "componentUrl": "somestring",
    "description": "somestring",
    "id": "somestring",
    "modified": "2015-01-01T15:00:00.000Z",
    "name": "somestring",
    "owner": "somestring",
    "spec": {},
    "status": "somestring",
    "version": "somestring",
    "whenAdded": "2015-01-01T15:00:00.000Z"
}
404

Component not found in Catalog

Type: Error message

Example:

{
    "message": "somestring"
}
500

Internal Server Error

GET /components

Description

Get list of Components in the catalog

Parameters

Name

Located in

Required

Type

Format

Properties

Description

name

query

No

string

Name of component to filter for

version

query

No

string

Version of component to filter for

Request

Headers
X-Fields: An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html

Responses

200

Success

Type: Component List

Example:

{
    "components": [
        {
            "componentType": "somestring",
            "componentUrl": "somestring",
            "description": "somestring",
            "id": "somestring",
            "modified": "2015-01-01T15:00:00.000Z",
            "name": "somestring",
            "owner": "somestring",
            "status": "somestring",
            "version": "somestring",
            "whenAdded": "2015-01-01T15:00:00.000Z"
        },
        {
            "componentType": "somestring",
            "componentUrl": "somestring",
            "description": "somestring",
            "id": "somestring",
            "modified": "2015-01-01T15:00:00.000Z",
            "name": "somestring",
            "owner": "somestring",
            "status": "somestring",
            "version": "somestring",
            "whenAdded": "2015-01-01T15:00:00.000Z"
        }
    ]
}
500

Internal Server Error

GET /dataformats/{dataformat_id}

Description

Get a Data Format

Parameters

Name

Located in

Required

Type

Format

Properties

Description

dataformat_id

path

Yes

string

Request

Headers
X-Fields: An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html

Responses

200

Success

Type: dataformat fields extended inline

Example:

{
    "dataFormatUrl": "somestring",
    "description": "somestring",
    "id": "somestring",
    "modified": "2015-01-01T15:00:00.000Z",
    "name": "somestring",
    "owner": "somestring",
    "spec": {},
    "status": "somestring",
    "version": "somestring",
    "whenAdded": "2015-01-01T15:00:00.000Z"
}
404

Data Format not found in Catalog

Type: Error message

Example:

{
    "message": "somestring"
}
500

Internal Server Error

GET /dataformats

Description

Get list of Data Formats in the catalog

Request

Headers
X-Fields: An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html

Responses

200

Success

Type: Data Format List

Example:

{
    "dataFormats": [
        {
            "dataFormatUrl": "somestring",
            "description": "somestring",
            "id": "somestring",
            "modified": "2015-01-01T15:00:00.000Z",
            "name": "somestring",
            "owner": "somestring",
            "status": "somestring",
            "version": "somestring",
            "whenAdded": "2015-01-01T15:00:00.000Z"
        },
        {
            "dataFormatUrl": "somestring",
            "description": "somestring",
            "id": "somestring",
            "modified": "2015-01-01T15:00:00.000Z",
            "name": "somestring",
            "owner": "somestring",
            "status": "somestring",
            "version": "somestring",
            "whenAdded": "2015-01-01T15:00:00.000Z"
        }
    ]
}
500

Internal Server Error

PATCH /components/{component_id}

Description

Update a Component's status in the Catalog

Parameters

Name

Located in

Required

Type

Format

Properties

Description

component_id

path

Yes

string

Request

Body

Name

Required

Type

Format

Properties

Description

owner

Yes

string

User ID

status

Yes

string

{‘enum’: [‘published’, ‘revoked’]}

… . .[published] is the only status change supported right now

{
    "owner": "somestring",
    "status": "published"
}

Responses

200

Success, Component status updated

400

Bad Request

Type: Error message

Example:

{
    "message": "somestring"
}
403

Forbidden Request

Type: Error message

Example:

{
    "message": "somestring"
}
404

Component not found in Catalog

Type: Error message

Example:

{
    "message": "somestring"
}
500

Internal Server Error

PATCH /dataformats/{dataformat_id}

Description

Update a Data Format's status in the Catalog

Parameters

Name

Located in

Required

Type

Format

Properties

Description

dataformat_id

path

Yes

string

Request

Body

Name

Required

Type

Format

Properties

Description

owner

Yes

string

User ID

status

Yes

string

{‘enum’: [‘published’, ‘revoked’]}

… . .[published] is the only status change supported right now

{
    "owner": "somestring",
    "status": "published"
}

Responses

200

Success, Data Format status updated

400

Bad Request

Type: Error message

Example:

{
    "message": "somestring"
}
403

Forbidden Request

Type: Error message

Example:

{
    "message": "somestring"
}
404

Data Format not found in Catalog

Type: Error message

Example:

{
    "message": "somestring"
}
500

Internal Server Error

POST /components

Description

Add a Component to the Catalog

Request

Headers
X-Fields: An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html
Body

Name

Required

Type

Format

Properties

Description

owner

No

string

spec

No

spec

The Component Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json

Spec schema:

The Component Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json

{
    "owner": "somestring",
    "spec": {}
}

Responses

200

Success

Type: Component post

Example:

{
    "componentUrl": "somestring"
}
400

Bad Request

Type: Error message

Example:

{
    "message": "somestring"
}
409

Component already exists

Type: Error message

Example:

{
    "message": "somestring"
}
500

Internal Server Error

POST /dataformats

Description

Add a Data Format to the Catalog

Request

Headers
X-Fields: An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html
Body

Name

Required

Type

Format

Properties

Description

owner

No

string

spec

No

spec

The Data Format Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json

Spec schema:

The Data Format Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json

{
    "owner": "somestring",
    "spec": {}
}

Responses

200

Success

Type: Data Format post

Example:

{
    "dataFormatUrl": "somestring"
}
400

Bad Request

Type: Error message

Example:

{
    "message": "somestring"
}
409

Data Format already exists

Type: Error message

Example:

{
    "message": "somestring"
}
500

Internal Server Error

PUT /components/{component_id}

Description

Replace a Component Spec in the Catalog

Parameters

Name

Located in

Required

Type

Format

Properties

Description

component_id

path

Yes

string

Request

Body

Name

Required

Type

Format

Properties

Description

owner

No

string

spec

No

spec

The Component Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json

Spec schema:

The Component Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json

{
    "owner": "somestring",
    "spec": {}
}

Responses

200

Success, Component replaced

400

Bad Request

Type: Error message

Example:

{
    "message": "somestring"
}
404

Component not found in Catalog

Type: Error message

Example:

{
    "message": "somestring"
}
500

Internal Server Error

PUT /dataformats/{dataformat_id}

Description

Replace a Data Format Spec in the Catalog

Parameters

Name

Located in

Required

Type

Format

Properties

Description

dataformat_id

path

Yes

string

Request

Body

Name

Required

Type

Format

Properties

Description

owner

No

string

spec

No

spec

The Data Format Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json

Spec schema:

The Data Format Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json

{
    "owner": "somestring",
    "spec": {}
}

Responses

200

Success, Data Format added

400

Bad Request

Type: Error message

Example:

{
    "message": "somestring"
}
404

Data Format not found in Catalog

Type: Error message

Example:

{
    "message": "somestring"
}
500

Internal Server Error

Data Structures

Component List Model Structure

Name

Required

Type

Format

Properties

Description

components

No

array of component fields

Component Spec Model Structure

Name

Required

Type

Format

Properties

Description

owner

No

string

spec

No

spec

The Component Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json

Spec schema:

The Component Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json

Component post Model Structure

Name

Required

Type

Format

Properties

Description

componentUrl

Yes

string

… . Url to the Component Specification

Data Format List Model Structure

Name

Required

Type

Format

Properties

Description

dataFormats

No

array of dataformat fields

Data Format Spec Model Structure

Name

Required

Type

Format

Properties

Description

owner

No

string

spec

No

spec

The Data Format Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json

Spec schema:

The Data Format Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json

Data Format post Model Structure

Name

Required

Type

Format

Properties

Description

dataFormatUrl

Yes

string

… . Url to the Data Format Specification

Error message Model Structure

Name

Required

Type

Format

Properties

Description

message

No

string

… . .Details about the unsuccessful API request

Patch Spec Model Structure

Name

Required

Type

Format

Properties

Description

owner

Yes

string

User ID

status

Yes

string

{‘enum’: [‘published’, ‘revoked’]}

… . .[published] is the only status change supported right now

component fields Model Structure

Name

Required

Type

Format

Properties

Description

componentType

Yes

string

… . only ‘docker’

componentUrl

Yes

string

… . Url to the Component Specification

description

Yes

string

… . Description of the component

id

Yes

string

… . ID of the component

modified

Yes

string

date-time

… . When component was last modified

name

Yes

string

… . Name of the component

owner

Yes

string

… . ID of who added the component

status

Yes

string

… . Status of the component

version

Yes

string

… . Version of the component

whenAdded

Yes

string

date-time

… . When component was added to the Catalog

component fields by id Model Structure

component fields extended inline

Inline schema:

Name

Required

Type

Format

Properties

Description

componentType

Yes

string

… . only ‘docker’

componentUrl

Yes

string

… . Url to the Component Specification

description

Yes

string

… . Description of the component

id

Yes

string

… . ID of the component

modified

Yes

string

date-time

… . When component was last modified

name

Yes

string

… . Name of the component

owner

Yes

string

… . ID of who added the component

spec

Yes

spec

The Component Specification (json)

status

Yes

string

… . Status of the component

version

Yes

string

… . Version of the component

whenAdded

Yes

string

date-time

… . When component was added to the Catalog

Spec schema:

The Component Specification (json)

dataformat fields Model Structure

Name

Required

Type

Format

Properties

Description

dataFormatUrl

Yes

string

… . Url to the Data Format Specification

description

Yes

string

… . Description of the data format

id

Yes

string

… . ID of the data format

modified

Yes

string

date-time

… . When data format was last modified

name

Yes

string

… . Name of the data format

owner

Yes

string

… . ID of who added the data format

status

Yes

string

… . Status of the data format

version

Yes

string

… . Version of the data format

whenAdded

Yes

string

date-time

… . When data format was added to the Catalog

dataformat fields by id Model Structure

dataformat fields extended inline

Inline schema:

Name

Required

Type

Format

Properties

Description

dataFormatUrl

Yes

string

… . Url to the Data Format Specification

description

Yes

string

… . Description of the data format

id

Yes

string

… . ID of the data format

modified

Yes

string

date-time

… . When data format was last modified

name

Yes

string

… . Name of the data format

owner

Yes

string

… . ID of who added the data format

spec

Yes

spec

The Data Format Specification (json)

status

Yes

string

… . Status of the data format

version

Yes

string

… . Version of the data format

whenAdded

Yes

string

date-time

… . When data format was added to the Catalog

Spec schema:

The Data Format Specification (json)