Skip to content

Commit

Permalink
Added environ var check for batch size
Browse files Browse the repository at this point in the history
  • Loading branch information
edglynes committed Oct 23, 2020
1 parent e153415 commit bb50406
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ Flags:
--file FILE Read JSON formatted input from FILE
```

NOTE: The CLI currently limits the number of zones in a submit request to 1000. If an invocation presents more than 1000 zones, the zones will be submitted in batches of 1000 and multiple Request Ids will be returned.
NOTE: The CLI currently limits the number of zones in a submit request to 1000. If an invocation presents more than 1000 zones, the zones will be submitted in batches of 1000 and multiple Request Ids will be returned. The batch size can be changed by setting the environment variable AKAMAI_ZONES_BATCH_SIZE.

An example create submit request would be as follows:

Expand Down
11 changes: 11 additions & 0 deletions command_submit_bulkzones.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ func cmdSubmitBulkZones(c *cli.Context) error {
outputPath = c.String("output")
outputPath = filepath.FromSlash(outputPath)
}

val, ok := os.LookupEnv("AKAMAI_ZONES_BATCH_SIZE")
if ok {
batchsize, err := strconv.Atoi(val)
if err != nil {
akamai.StopSpinnerFail()
return cli.NewExitError(color.RedString(" Environ variable AKAMAI_ZONEBATCH has invalid value"), 1)
}
maxNumZones = batchsize
}

// Read in json file
data, err := ioutil.ReadFile(inputPath)
if err != nil {
Expand Down

0 comments on commit bb50406

Please sign in to comment.