Skip to content
153 changes: 143 additions & 10 deletions specs/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1334,18 +1334,24 @@ paths:
description: Microservice Uuid
required: true
type: string
- in: query
name: withCleanUp
description: Delete with cleanup
required: true
type: boolean
- in: body
name: WithCleanupOption
description: Delete option
required: false
schema:
type: object
properties:
withCleanup:
type: boolean
responses:
'204':
description: Success
headers:
X-Timestamp:
type: number
description: FogController server timestamp
'400':
description: Bad Request
'401':
description: Not Authorized
'404':
Expand Down Expand Up @@ -1532,6 +1538,119 @@ paths:
description: Not Found
'500':
description: Internal Server Error
'/microservices/{uuid}/volume-mapping':
post:
tags:
- Microservices
description: Creates a volume mapping for microservice
operationId: createMicroserviceVolumeMapping
parameters:
- in: header
name: Authorization
description: User Token
required: true
type: string
- in: path
name: uuid
description: Microservice Uuid
required: true
type: string
- in: body
name: volumeMappingData
description: information about volume mapping
required: true
schema:
$ref: '#/definitions/VolumeMapping'
responses:
'201':
description: Created
schema:
type: object
properties:
id:
type: number
headers:
X-Timestamp:
type: number
description: FogController server timestamp
'400':
description: Not Valid
'401':
description: Not Authorized
'404':
description: Not Found
'500':
description: Internal Server Error
get:
tags:
- Microservices
description: Get a volume mapping list for microservice
operationId: getMicroserviceVolumeMapping
parameters:
- in: header
name: Authorization
description: User Token
required: true
type: string
- in: path
name: uuid
description: Microservice Uuid
required: true
type: string
responses:
'200':
description: Success
schema:
type: array
items:
$ref: '#/definitions/VolumeMappingRequest'
headers:
X-Timestamp:
type: number
description: FogController server timestamp
'401':
description: Not Authorized
'404':
description: Not Found
'500':
description: Internal Server Error
'/microservices/{uuid}/volume-mapping/{id}':
delete:
tags:
- Microservices
description: Deletes a volume mapping for microservice
operationId: deleteMicroserviceVolumeMapping
parameters:
- in: header
name: Authorization
description: User Token
required: true
type: string
- in: path
name: uuid
description: Microservice Uuid
required: true
type: string
- in: path
name: id
description: Volume id
required: true
type: string
responses:
'204':
description: Success
headers:
X-Timestamp:
type: number
description: FogController server timestamp
'400':
description: Not Valid
'401':
description: Not Authorized
'404':
description: Not Found
'500':
description: Internal Server Error
'/microservices/{id}/image-snapshot':
post:
tags:
Expand Down Expand Up @@ -2634,7 +2753,7 @@ definitions:
VolumeMappings:
type: array
items:
$ref: '#/definitions/VolumeMappingAgentRequest'
$ref: '#/definitions/VolumeMapping'
imageSnapshot:
type: string
removeWithCleanUp:
Expand All @@ -2645,7 +2764,7 @@ definitions:
type: array
items:
type: string
VolumeMappingAgentRequest:
VolumeMapping:
type: object
properties:
hostDestination:
Expand All @@ -2657,6 +2776,20 @@ definitions:
accessMode:
type: string
example: rw
VolumeMappingRequest:
type: object
properties:
id:
type: number
hostDestination:
type: string
example: /var/dest
containerDestination:
type: string
example: /var/dest
accessMode:
type: string
example: rw
PortMappingsResponse:
type: object
properties:
Expand Down Expand Up @@ -2889,7 +3022,7 @@ definitions:
volumeMappings:
type: array
items:
$ref: '#/definitions/VolumeMappingAgentRequest'
$ref: '#/definitions/VolumeMappingRequest'
ports:
type: array
items:
Expand All @@ -2916,7 +3049,7 @@ definitions:
volumeMappings:
type: array
items:
$ref: '#/definitions/VolumeMappingAgentRequest'
$ref: '#/definitions/VolumeMapping'
ports:
type: array
items:
Expand All @@ -2943,7 +3076,7 @@ definitions:
volumeMappings:
type: array
items:
$ref: '#/definitions/VolumeMappingAgentRequest'
$ref: '#/definitions/VolumeMapping'
IOFogNodeTunnelStatusInfoResponse:
type: object
properties:
Expand Down
2 changes: 1 addition & 1 deletion src/cli/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const _deleteCatalogItem = async function (obj) {

const _listCatalogItems = async function () {
const result = await CatalogItemService.listCatalogItems({}, true);
logger.info(JSON.stringify(result));
logger.info(JSON.stringify(result, null, 2));
logger.info('Catalog items have been successfully retrieved.');
};

Expand Down
2 changes: 1 addition & 1 deletion src/cli/connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ async function _deleteConnector(obj) {

async function _getConnectorList(obj) {
const list = await ConnectorService.getConnectorList()
logger.info(JSON.stringify(list, null, 2));
logger.info('Connector list has been gotten successfully');
logger.info(JSON.stringify(list));
}

function _createConnectorObject(cliData) {
Expand Down
7 changes: 4 additions & 3 deletions src/cli/diagnostics.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,22 @@ const _getMicroserviceStraceData = async function (obj) {
logger.info(JSON.stringify(obj));

const result = await DiagnosticService.getMicroserviceStraceData(obj.microserviceId, {format: obj.format}, {}, true);
logger.info(JSON.stringify(result));
logger.info(JSON.stringify(result, null, 2));
logger.info('Microservice strace data has been retrieved successfully.');
};

const _postMicroserviceStraceDataToFtp = async function (obj) {
logger.info(JSON.stringify(obj));

await DiagnosticService.postMicroserviceStraceDatatoFtp(obj.microserviceId, obj, {}, true);
logger.info('Strace data has been posted to ftp successfully');
logger.info('Strace data has been posted to ftp successfully.');
};

const _postMicroserviceImageSnapshotCreate = async function (obj) {
logger.info(JSON.stringify(obj));

await DiagnosticService.postMicroserviceImageSnapshotCreate(obj.microserviceId, {}, true);
logger.info('Microservice image snapshot has been created successfully');
logger.info('Microservice image snapshot has been created successfully.');
};

const _getMicroserviceImageSnapshot = async function (obj) {
Expand Down
8 changes: 5 additions & 3 deletions src/cli/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ const _deleteFlow = async function (flowData) {
logger.info('Flow removed successfully.');
};

const _getAllFlows = async function (emptyObj) {
const _getAllFlows = async function () {
const flows = await FlowService.getAllFlows(true);
logger.info(JSON.stringify(flows));
logger.info(JSON.stringify(flows, null, 2));
logger.info('All flows have been retrieved successfully.');
};

const _getFlow = async function (flowData) {
Expand All @@ -145,7 +146,8 @@ const _getFlow = async function (flowData) {
const flowId = flowData.flowId;

const flow = await FlowService.getFlowWithTransaction(flowId, {}, true);
logger.info(JSON.stringify(flow));
logger.info(JSON.stringify(flow, null, 2));
logger.info(`Flow with id ${flowId} has been retrieved successfully.`)
};

function _createFlowObject(data) {
Expand Down
18 changes: 10 additions & 8 deletions src/cli/iofog.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,23 +193,23 @@ async function _deleteFog(obj, user) {
async function _getFogList(obj, user) {
const emptyFilters = []
const list = await FogService.getFogList(emptyFilters, user, true);
logger.info('Fog list has been gotten successfully');
logger.info(JSON.stringify(list));
logger.info(JSON.stringify(list, null, 2));
logger.info('Fog list has been gotten successfully.');
}

async function _getFog(obj, user) {
const fog = _createFogObject(obj);
const res = await FogService.getFogWithTransaction(fog, user, true);
logger.info('Fog has been gotten successfully');
logger.info(JSON.stringify(res));
logger.info(JSON.stringify(res, null, 2));
logger.info('Fog has been gotten successfully.');
}

async function _generateProvision(obj, user) {
const fog = _createFogObject(obj);
logger.info(JSON.stringify(fog));
const res = await FogService.generateProvisioningKey(fog, user, true);
logger.info('Fog provisioning key has been generated successfully');
logger.info('Provisioning key: '+ JSON.stringify(res));
logger.info('Provisioning key: '+ JSON.stringify(res, null, 2));
logger.info('Fog provisioning key has been generated successfully.');
}

async function _setFogRebootCommand(obj, user) {
Expand Down Expand Up @@ -237,7 +237,8 @@ async function _getHalHardwareInfo(obj) {
logger.info("Parameters" + JSON.stringify(uuidObj));

const info = await FogService.getHalHardwareInfo(uuidObj, {}, true);
logger.info(JSON.stringify(info));
logger.info(JSON.stringify(info, null, 2));
logger.info('Hardware info has been retrieved successfully.')
}

async function _getHalUsbInfo(obj) {
Expand All @@ -248,7 +249,8 @@ async function _getHalUsbInfo(obj) {
logger.info("Parameters" + JSON.stringify(uuidObj));

const info = await FogService.getHalHardwareInfo(uuidObj, {}, true);
logger.info(JSON.stringify(info));
logger.info(JSON.stringify(info, null, 2));
logger.info('Usb info has been retrieved successfully.')
}

function _createFogObject(cliData) {
Expand Down
Loading