-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from akamai/release/1.9.0
Release/1.9.0 => Master
- Loading branch information
Showing
132 changed files
with
1,828 additions
and
992 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
let out = require('./lib/out'); | ||
let MatchTarget = require('../../src/matchtarget').matchTarget; | ||
|
||
class CreateApiMatchTargetCommand { | ||
constructor() { | ||
this.flags = 'create-api-match-target'; | ||
this.desc = '(Beta) Creates an API match target.'; | ||
this.setup = this.setup.bind(this); | ||
this.run = this.run.bind(this); | ||
} | ||
|
||
setup(sywac) { | ||
sywac | ||
.usage('Usage: akamai-appsec create-api-match-target --apis <123, 456, 789> [options]') | ||
.numberArray('--apis <apiId1, apiId2, apiId3>', { | ||
desc: 'APIs to add.', | ||
group: 'Required:', | ||
required: true | ||
}) | ||
.number('--config <id>', { | ||
desc: 'Configuration ID. Mandatory if you have more than one configuration.', | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.string('--version <id>', { | ||
desc: | ||
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.", | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.string('--policy <id>', { | ||
desc: | ||
'Policy ID. If not provided, we try to use the policy available on file. If you have more than one policy, this option must be provided.', | ||
group: 'Optional:', | ||
required: false | ||
}); | ||
} | ||
|
||
run(options) { | ||
out.print({ | ||
promise: new MatchTarget(options).createApiMatchTarget(), | ||
args: options, | ||
success: (args, data) => { | ||
return data.targetId; | ||
} | ||
}); | ||
} | ||
} | ||
|
||
module.exports = new CreateApiMatchTargetCommand(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
let out = require('./lib/out'); | ||
let MatchTarget = require('../../src/matchtarget').matchTarget; | ||
let logger = require('../../src/constants').logger('modify-api-match-target'); | ||
|
||
const SUB_CPMMANDS = ['add-api']; | ||
class ModifyAPIMatchTargetCommand { | ||
constructor() { | ||
this.flags = 'modify-api-match-target'; | ||
this.desc = '(Beta) Updates an API match target.'; | ||
this.setup = this.setup.bind(this); | ||
this.run = this.run.bind(this); | ||
} | ||
|
||
setup(sywac) { | ||
sywac | ||
.positional('<match-target>', { | ||
paramsDesc: 'The match target ID.' | ||
}) | ||
.positional('<subcommand>', { | ||
paramsDesc: 'The subcommand. [' + SUB_CPMMANDS.join(',') + ']' | ||
}) | ||
.positional('<api>', { | ||
paramsDesc: 'The api to add to the match target.' | ||
}) | ||
.number('--config <id>', { | ||
desc: 'Configuration ID. Mandatory if you have more than one configuration.', | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.string('--version <id>', { | ||
desc: | ||
"Version Number. It can also take the values 'PROD' or 'PRODUCTION' or 'STAGING'. If not provided, latest version is assumed.", | ||
group: 'Optional:', | ||
required: false | ||
}) | ||
.check((argv, context) => { | ||
if (!SUB_CPMMANDS.includes(argv.subcommand)) { | ||
return context.cliMessage('Could not recognize the command: ' + argv.subcommand); | ||
} | ||
}); | ||
} | ||
|
||
run(options) { | ||
logger.debug(JSON.stringify(options)); | ||
out.print({ | ||
promise: this._getOperation(options), | ||
args: options, | ||
success: (args, data) => { | ||
return data.targetId; | ||
} | ||
}); | ||
} | ||
|
||
_getOperation(options) { | ||
switch (options.subcommand) { | ||
case 'add-api': | ||
return new MatchTarget(options).addApi(); | ||
default: | ||
return null; | ||
} | ||
} | ||
} | ||
|
||
module.exports = new ModifyAPIMatchTargetCommand(); |
Oops, something went wrong.