Ejemplo n.º 1
0
 public function setUp()
 {
     parent::setUp();
     $input = json_decode(file_get_contents('tests/data/env1_create.json'), true);
     $this->stack_model = Stack::make($input);
     $this->stack_model->assign(Environment::make(['name' => 'integration', 'parameters' => [["id" => "key_name", "value" => "highcore-testing"], ["id" => "template_bucket", "value" => "highcore-templates"], ["id" => "cloud_credentials", "sensitive" => true, "value" => ["access_key" => "ZA8X506GX7X93K2VLH7M", "secret_key" => "ekc5dmdQZwsd2X8O11Fu64i9puzZXIaEfsaoVO5OK55LcBLaTGgavguVuF78h25PlQBir0vKKfYSuTCFLr7eVyrAaC29G6Fdp5yO6779oa3lK7cCuNlb1wmKrxlFLZd5WddmZDu1c8XPHAtF4DS8OUaDNNJeU9KGhbGC1XqLRmWTs82XKVO3HZ2i1nBXeJA8bMOlrkXaTeQzwo5t8EwzEWFM7z84VR7sZyL8Yt7mrgRq9Wnt5QQnXV4aSn0P1R66jRCUAkzrPqKy9VjRjLgNyDme"]]], 'project' => ['name' => 'highcore']]));
 }
 /**
  * Store a newly created resource in storage.
  * @SWG\Post(
  *     path="/environments",
  *     summary="Store environment",
  *     @SWG\Parameter(ref="#/parameters/source"),
  *     @SWG\Parameter(ref="#/parameters/Environment"),
  *     @SWG\Response(response="default", ref="#/responses/Environment"),
  *     security={{"highcore_auth":{}}},
  * )
  * @return Response
  */
 public function store()
 {
     $source = Input::get('source', false);
     if ($source) {
         $request = Request::create($source, 'GET');
         /** @var Environment $environment */
         $environment = Route::dispatch($request)->getOriginalContent()->fill(Input::all());
         $environment->id = null;
     } else {
         $environment = Environment::make(Input::all());
     }
     return Persistence::saveEnvironment($environment);
 }
 /**
  * Store a newly created resource in storage.
  * @SWG\Post(
  *     path="/projects/{project_key}/environments",
  *     summary="Store project environment",
  *     @SWG\Parameter(ref="#/parameters/project_key"),
  *     @SWG\Parameter(ref="#/parameters/key"),
  *     @SWG\Parameter(ref="#/parameters/Environment"),
  *     @SWG\Response(response="default", ref="#/responses/Environments"),
  *     security={{"highcore_auth":{}}},
  * )
  * @param  int|string  $project_key
  * @return Response
  */
 public function store($project_key)
 {
     return Persistence::saveEnvironment(Environment::make(Input::all())->assign(Persistence::getProject(['key' => $project_key]), Input::get('key', 'id')));
 }