-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get all available accounts for a user from the scheduler (#783)
Start the `accounts` API on the adapter interface. Return account info objects for higher layers to stitch together. Co-authored-by: treydock <tdockendorf@osc.edu>
- Loading branch information
Showing
8 changed files
with
196 additions
and
2 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,36 @@ | ||
module OodCore | ||
module Job | ||
|
||
class AccountInfo | ||
|
||
# The name of the account. | ||
attr_reader :name | ||
alias to_s name | ||
|
||
# The QoS values this account can use. | ||
attr_reader :qos | ||
|
||
# The cluster this account is associated with. | ||
attr_reader :cluster | ||
|
||
# The queue this account can use. nil means there is no queue info | ||
# for this account. | ||
attr_reader :queue | ||
|
||
def initialize(**opts) | ||
orig_name = opts.fetch(:name, 'unknown') | ||
@name = OodCore::Job::Adapters::Helper.upcase_accounts? ? orig_name.upcase : orig_name | ||
@qos = opts.fetch(:qos, []) | ||
@cluster = opts.fetch(:cluster, nil) | ||
@queue = opts.fetch(:queue, nil) | ||
end | ||
|
||
def to_h | ||
instance_variables.map do |var| | ||
name = var.to_s.gsub('@', '').to_sym | ||
[name, send(name)] | ||
end.to_h | ||
end | ||
end | ||
end | ||
end |
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,24 @@ | ||
pzs0715|ascend|partition_a|ascend-default | ||
pzs0714|ascend|partition_b|ascend-default | ||
pzs1124|owens||owens-default,staff,phoenix,geophys,hal,gpt | ||
pzs1118|owens||owens-default | ||
pzs1117|owens||owens-default | ||
pzs1010|owens||owens-default | ||
pzs0715|owens||owens-default | ||
pzs0714|owens||owens-default | ||
pde0006|owens||owens-default | ||
pas2051|owens||owens-default | ||
pas1871|owens||owens-default | ||
pas1754|owens||owens-default | ||
pas1604|owens||owens-default | ||
pzs1124|pitzer||pitzer-default | ||
pzs1118|pitzer||pitzer-default | ||
pzs1117|pitzer||pitzer-default | ||
pzs1010|pitzer||pitzer-default | ||
pzs0715|pitzer||pitzer-default | ||
pzs0714|pitzer||pitzer-default | ||
pde0006|pitzer||pitzer-default | ||
pas2051|pitzer||pitzer-default | ||
pas1871|pitzer||pitzer-default | ||
pas1754|pitzer||pitzer-default | ||
pas1604|pitzer||pitzer-default |
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