// NewProvisionCmd builds a "svcat provision" command
NewProvisionCmd builds a "svcat provision" command
// NewProvisionCmd builds a " svcat provision " command
func NewProvisionCmd(cxt *command.Context) *cobra.Command {
	provisionCmd := &provisonCmd{
		Namespaced: command.NewNamespaced(cxt),
		Waitable:   command.NewWaitable(),
	}
	cmd := &cobra.Command{
		Use:   "provision NAME --plan PLAN --class CLASS",
		Short: "Create a new instance of a service",
		Example: command.NormalizeExamples(`
  svcat provision wordpress-mysql-instance --class mysqldb --plan free -p location=eastus -p sslEnforcement=disabled
  svcat provision wordpress-mysql-instance --external-id a7c00676-4398-11e8-842f-0ed5f89f718b --class mysqldb --plan free
  svcat provision wordpress-mysql-instance --class mysqldb --plan free -s mysecret[dbparams]
  svcat provision secure-instance --class mysqldb --plan secureDB --params-json '{
    "encrypt" : true,
    "firewallRules" : [
        {
            "name": "AllowSome",
            "startIPAddress": "75.70.113.50",
            "endIPAddress" : "75.70.113.131"
        }
    ]
  }'
`),
		PreRunE: command.PreRunE(provisionCmd),
		RunE:    command.RunE(provisionCmd),
	}
	provisionCmd.AddNamespaceFlags(cmd.Flags(), false)
	cmd.Flags().StringVar(&provisionCmd.externalID, "external-id", "",
		"The ID of the instance for use with the OSB SB API (Optional)")
	cmd.Flags().StringVar(&provisionCmd.className, "class", "",
		"The class name (Required)")
	cmd.MarkFlagRequired("class")
	cmd.Flags().StringVar(&provisionCmd.planName, "plan", "",
		"The plan name (Required)")
	cmd.MarkFlagRequired("plan")
	cmd.Flags().StringSliceVarP(&provisionCmd.rawParams, "param", "p", nil,
		"Additional parameter to use when provisioning the service, format: NAME=VALUE. Cannot be combined with --params-json, Sensitive information should be placed in a secret and specified with --secret")
	cmd.Flags().StringSliceVarP(&provisionCmd.rawSecrets, "secret", "s", nil,
		"Additional parameter, whose value is stored in a secret, to use when provisioning the service, format: SECRET[KEY]")
	cmd.Flags().StringVar(&provisionCmd.jsonParams, "params-json", "",
		"Additional parameters to use when provisioning the service, provided as a JSON object. Cannot be combined with --param")
	provisionCmd.AddWaitFlags(cmd)
	return cmd
}
func NewProvisionCmd ( cxt * command . Context ) * cobra . Command { provisionCmd := & provisonCmd { Namespaced : command . NewNamespaced ( cxt ) , Waitable : command . NewWaitable ( ) , } cmd := & cobra . Command { Use : " " , Short : " " , Example : command . NormalizeExamples ( `
  svcat provision wordpress-mysql-instance --class mysqldb --plan free -p location=eastus -p sslEnforcement=disabled
  svcat provision wordpress-mysql-instance --external-id a7c00676-4398-11e8-842f-0ed5f89f718b --class mysqldb --plan free
  svcat provision wordpress-mysql-instance --class mysqldb --plan free -s mysecret[dbparams]
  svcat provision secure-instance --class mysqldb --plan secureDB --params-json '{
    "encrypt" : true,
    "firewallRules" : [
        {
            "name": "AllowSome",
            "startIPAddress": "75.70.113.50",
            "endIPAddress" : "75.70.113.131"
        }
    ]
  }'
` ) , PreRunE : command . PreRunE ( provisionCmd ) , RunE : command . RunE ( provisionCmd ) , } provisionCmd . AddNamespaceFlags ( cmd . Flags ( ) , false ) cmd . Flags ( ) . StringVar ( & provisionCmd . externalID , " " , " " , " " ) cmd . Flags ( ) . StringVar ( & provisionCmd . className , " " , " " , " " ) cmd . MarkFlagRequired ( " " ) cmd . Flags ( ) . StringVar ( & provisionCmd . planName , " " , " " , " " ) cmd . MarkFlagRequired ( " " ) cmd . Flags ( ) . StringSliceVarP ( & provisionCmd . rawParams , " " , " " , nil , " " ) cmd . Flags ( ) . StringSliceVarP ( & provisionCmd . rawSecrets , " " , " " , nil , " " ) cmd . Flags ( ) . StringVar ( & provisionCmd . jsonParams , " " , " " , " " ) provisionCmd . AddWaitFlags ( cmd ) return cmd }
NewProvisionCmd builds a "svcat provision" command
NewProvisionCmd builds a " svcat provision " command