-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added upstream:list name filter, organization field (#1747)
- Loading branch information
1 parent
8a14e8b
commit a20082e
Showing
40 changed files
with
1,715 additions
and
306 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Pantheon\Terminus\Collections; | ||
|
||
use Pantheon\Terminus\Models\OrganizationUpstream; | ||
|
||
/** | ||
* Class OrganizationUpstreams | ||
* @package Pantheon\Terminus\Collections | ||
*/ | ||
class OrganizationUpstreams extends OrganizationOwnedCollection | ||
{ | ||
public static $pretty_name = 'upstreams'; | ||
/** | ||
* @var string | ||
*/ | ||
protected $collected_class = OrganizationUpstream::class; | ||
/** | ||
* @var string | ||
*/ | ||
protected $url = 'organizations/{organization_id}/upstreams'; | ||
|
||
/** | ||
* Filters an array of Upstreams by their label | ||
* | ||
* @param string $regex Non-delimited PHP regex to filter site names by | ||
* @return Upstreams | ||
*/ | ||
public function filterByName($regex = '(.*)') | ||
{ | ||
return $this->filterByRegex('label', $regex); | ||
} | ||
} |
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,42 @@ | ||
<?php | ||
|
||
namespace Pantheon\Terminus\Commands\Org\Upstream; | ||
|
||
use Consolidation\OutputFormatters\StructuredData\RowsOfFields; | ||
use Pantheon\Terminus\Commands\Upstream\ListCommand as UserListCommand; | ||
|
||
/** | ||
* Class ListCommand | ||
* @package Pantheon\Terminus\Commands\Org\Upstream | ||
*/ | ||
class ListCommand extends UserListCommand | ||
{ | ||
/** | ||
* Displays the list of upstreams belonging to an organization. | ||
* | ||
* @command org:upstream:list | ||
* @aliases org:upstreams | ||
* | ||
* @field-labels | ||
* id: ID | ||
* label: Name | ||
* machine_name: Machine Name | ||
* category: Category | ||
* type: Type | ||
* framework: Framework | ||
* @param string $organization Organization name, label, or ID | ||
* @option all Show all upstreams | ||
* @option framework Framework filter | ||
* @option name Name filter | ||
* @return RowsOfFields | ||
* | ||
* @usage Displays the list of upstreams accessible to the currently logged-in user. | ||
* @usage --all Displays upstreams of all types, including product. | ||
* @usage --framework=<framework> Displays a list of accessible upstreams using the <framework> framework. | ||
* @usage --name=<regex> Displays a list of accessible upstreams with a name that matches <regex>. | ||
*/ | ||
public function listOrgUpstreams($organization, $options = ['all' => false, 'framework' => null, 'name' => null,]) | ||
{ | ||
return $this->listUpstreams(array_merge($options, ['org' => $organization,])); | ||
} | ||
} |
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
Oops, something went wrong.