Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion exabyte_api_client/endpoints/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,19 @@ def update(self, id_, modifier):
"""
return self.request("PATCH", "/".join((self.name, id_)), data=json.dumps(modifier), headers=self.headers)

def create(self, config):
def create(self, config, owner_id=None):
"""
Creates a new entity.

Args:
config (dict): entity config.
owner_id (str): owner ID. Entity is created under user's default account if not specified.

Returns:
dict: new entity.
"""
if owner_id:
config["owner"] = {"_id": owner_id}
return self.request("PUT", "/".join((self.name, "create")), data=json.dumps(config), headers=self.headers)

def copy(self, id_):
Expand Down
8 changes: 4 additions & 4 deletions exabyte_api_client/endpoints/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,20 @@ def get_compute(self, cluster, ppn=1, nodes=1, queue="D", time_limit="01:00:00",
"arguments": {},
}

def create_by_ids(self, materials, workflow_id, project_id, owner_id, prefix, compute=None):
def create_by_ids(self, materials, workflow_id, project_id, prefix, owner_id=None, compute=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if need to change the api-example that is using this function

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 2 occurrences

"""
Creates jobs from the given materials

Args:
materials (list[dict]): list of materials.
workflow_id (str): workflow ID.
project_id (str): project ID.
owner_id (str): owner ID.
compute (dict): compute configuration.
prefix (str): job prefix.
owner_id (str, optional): owner ID.
compute (dict, optional): compute configuration.

Returns:
list
list: List of created jobs.
"""
jobs = []
for material in materials:
Expand Down
Loading