UNPKG

@lifeomic/cli

Version:

CLI for interacting with the LifeOmic PHC API.

16 lines (12 loc) 418 B
'use strict'; const { post } = require('../../api'); const print = require('../../print'); const read = require('../../read'); exports.command = 'create'; exports.desc = 'Create a policy. The policy is read from stdin'; exports.builder = yargs => {}; exports.handler = async argv => { const policy = await read(argv); const response = await post(argv, `/v1/policies`, policy); print(response.data, argv); };