This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated vendoring for new gocomposeapi and added set scale, set note …
…and set code commands.
- Loading branch information
Showing
166 changed files
with
11,470 additions
and
11,808 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright © 2017 Compose, an IBM company | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
composeAPI "github.com/compose/gocomposeapi" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// setNotesCmd represents the set command | ||
var setCodeCmd = &cobra.Command{ | ||
Use: "code [deployment id] [notcodee]", | ||
Short: "Set customer billing code for a deployment", | ||
Long: `Sets the customer billing code for a deployment.`, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
if len(args) != 2 { | ||
log.Fatal("Need a deployment id and new billing code value") | ||
} | ||
c := getComposeAPI() | ||
|
||
params := composeAPI.PatchDeploymentParams{} | ||
params.DeploymentID = args[0] | ||
params.CustomerBillingCode = args[1] | ||
deployment, errs := c.PatchDeployment(params) | ||
|
||
bailOnErrs(errs) | ||
if !outputJSON { | ||
printDeployment(*deployment) | ||
fmt.Println() | ||
} else { | ||
printAsJSON(*deployment) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
setCmd.AddCommand(setCodeCmd) | ||
} |
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,54 @@ | ||
// Copyright © 2017 Compose, an IBM company | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
composeAPI "github.com/compose/gocomposeapi" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// setNotesCmd represents the set command | ||
var setNotesCmd = &cobra.Command{ | ||
Use: "notes [deployment id] [note]", | ||
Short: "Set notes for a deployment", | ||
Long: `Sets the customer notes for a deployment.`, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
if len(args) != 2 { | ||
log.Fatal("Need a deployment id and new notes value") | ||
} | ||
c := getComposeAPI() | ||
|
||
params := composeAPI.PatchDeploymentParams{} | ||
params.DeploymentID = args[0] | ||
params.Notes = args[1] | ||
deployment, errs := c.PatchDeployment(params) | ||
|
||
bailOnErrs(errs) | ||
if !outputJSON { | ||
printDeployment(*deployment) | ||
fmt.Println() | ||
} else { | ||
printAsJSON(*deployment) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
setCmd.AddCommand(setNotesCmd) | ||
} |
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,63 @@ | ||
// Copyright © 2017 Compose, an IBM company | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"strconv" | ||
|
||
composeAPI "github.com/compose/gocomposeapi" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// setScaleCmd represents the set command | ||
var setScaleCmd = &cobra.Command{ | ||
Use: "scale [deployment id] [scale in integer units]", | ||
Short: "Set scale for a deployment", | ||
Long: `Sets the number of resource units (storage/memory) that should be available.`, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
if len(args) != 2 { | ||
log.Fatal("Need a deployment id and new units value") | ||
} | ||
c := getComposeAPI() | ||
|
||
params := composeAPI.ScalingsParams{} | ||
params.DeploymentID = args[0] | ||
scaleval, err := strconv.Atoi(args[1]) | ||
if err != nil { | ||
log.Fatal("Scale units must be integer") | ||
} | ||
|
||
params.Units = scaleval | ||
recipe, errs := c.SetScalings(params) | ||
bailOnErrs(errs) | ||
if !outputJSON { | ||
printRecipe(*recipe) | ||
fmt.Println() | ||
} else { | ||
printAsJSON(*recipe) | ||
} | ||
|
||
if recipewatch { | ||
watchRecipeTillComplete(c, recipe.ID) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
setCmd.AddCommand(setScaleCmd) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package: github.com/compose/bach | ||
import: | ||
- package: github.com/compose/gocomposeapi | ||
version: master | ||
version: 0.1 | ||
- package: github.com/spf13/cobra | ||
- package: github.com/spf13/viper |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.