flywheel.models.gear_mixin
Provides gear mixin
GearMixin
Bases: object
Gear mixin that provides additional functionality
add_permission(permission_type, permission_id)
Add an individual permission to gear.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
permisson_type | GearPermissionsType | The type of permission to add. | required |
permission_id | str | The permission ID to add. | required |
create_invocation()
Create a job invocation object
delete_all_permissions()
Delete gear all permissions. Also sets is_restricted on the gear series to False.
delete_permission(permission_type, permission_id)
Delete an individual permission by type and id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
permisson_type | GearPermissionsType | The type of permission to delete. | required |
permission_id | str | The permission ID to delete. | required |
get_default_config()
Get the default configuration for gear
get_series()
Get gear series by gear name.
is_analysis_gear()
Check if this is an analysis gear
modify_gear_series(gear_series_update)
Modify the gear series attributes such as is_restricted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gear_series_update | GearSeriesUpdate | the dictionary specifying the updates to make to the gear series Example:: update_dict = {"is_restricted": True} gear.modify_gear_series(update_dict) | required |
print_details(width=90)
Print details about a gear to stdout
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width | int | The maximum line width for printing | 90 |
propose_batch(containers, config=None, analysis_label=None, tags=None, priority=None, optional_input_policy='ignored')
Propose a batch run of the gear.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
containers | list | The list of targets. | required |
config | dict | The configuration to use, if overriding defaults. | None |
analysis_label | str | The label of the analysis, if running an analysis gear. | None |
tags | list | The list of tags to set for the job. | None |
priority | str | The priority of the job. | None |
optional_input_policy | str | The optional input policy, default is 'ignored' | 'ignored' |
Returns:
| Type | Description |
|---|---|
| The batch proposal, which can be started with proposal.run() |
replace_permissions(permissions)
Replace the existing gear permissions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
permissions | GearPermissions | The new permissions to set for the gear. | required |
run(config=None, analysis_label=None, tags=None, destination=None, inputs=None, priority=None, **kwargs)
Run the gear.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config | dict | The configuration to use, if overriding defaults. | None |
analysis_label | str | The label of the analysis, if running an analysis gear. | None |
tags | list | The list of tags to set for the job. | None |
destination | object | The destination container. | None |
inputs | dict | The list of input containers or files. | None |
priority | str | The priority for the gear run. | None |
Returns:
| Type | Description |
|---|---|
| The id of the job that was created (utility gear) or of the analysis container created (analysis gear). |