3 @qhc@sddlmZddlmZddlmZddlmZmZmZddl m Z m Z m Z m Z mZdddd d d d d gZGdddeZGddde eZGdddee eZGdd d e eZGdd d e eZGdd d e eZGdd d e eZGdd d e eZdS))cli) exceptions)types)RequiredOptional RESTManager RESTObject) CRUDMixin ListMixin NoUpdateMixinObjectDeleteMixin SaveMixin RunnerJobRunnerJobManagerRunner RunnerManager GroupRunnerGroupRunnerManager ProjectRunnerProjectRunnerManagerc@s eZdZdS)r N)__name__ __module__ __qualname__rrX/home/ec2-user/environment/venv/lib/python3.6/dist-packages/gitlab/v4/objects/runners.pyr sc@s eZdZdZeZddiZdZdS)rz/runners/%(runner_id)s/jobs runner_ididstatusN)r)rrr_pathr _obj_cls_from_parent_attrs _list_filtersrrrrrsc@seZdZdZdS)rjobsrNr!r)r")rrrZ _managersrrrrr$sc @s~eZdZdZeZeddd Zedd ZdZ de j iZ e jdedejejdddZe jddejejddZdS)rz/runnerstoken descriptioninfoactivelocked run_untaggedtag_list access_levelmaximum_timeout)requiredoptional)r-scopeNc s<d}i}|dk r||d<jj||f|}fdd|DS)a9List all the runners. Args: scope (str): The scope of runners to show, one of: specific, shared, active, paused, online all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts with page 1) as_list (bool): If set to False and no pagination option is defined, return a generator instead of a list **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabListError: If the server failed to perform the request Returns: list(Runner): a list of runners matching the scope. z /runners/allNr.csg|]}j|qSr)r).0item)selfrr asz%RunnerManager.all..)gitlabZ http_list)r1r.kwargspathZ query_dataobjr)r1rallFs zRunnerManager.allcKs(d}d|i}|jj|fd|i|dS)awValidates authentication credentials for a registered Runner. Args: token (str): The runner's authentication token **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabVerifyError: If the server failed to verify the token z/runners/verifyr# post_dataN)r3Z http_post)r1r#r4r5r8rrrverifycs zRunnerManager.verify)r#)r$r%r&r'r(r)r*r+)r$r&r)r(r'r*r+)r.r))r.)N)r#)rrrrrrr _create_attrsZ _update_attrsr r ListAttribute_typesrZregister_custom_actiontupleexcZ on_http_errorZGitlabListErrorr7ZGitlabVerifyErrorr9rrrrr(s6   c@s eZdZdS)rN)rrrrrrrrusc@s4eZdZdZeZddiZed dZd Z de j iZ dS) rz/groups/%(group_id)s/runnersZgroup_idrr)r,r.r)N)r)r.r)) rrrrrrrrr:r rr;r<rrrrrys  c@s eZdZdS)rN)rrrrrrrrsc@s4eZdZdZeZddiZed dZd Z de j iZ dS) rz /projects/%(project_id)s/runnersZ project_idrr)r,r.r)N)r)r.r)) rrrrrrrrr:r rr;r<rrrrrs  N)r3rrr>rZ gitlab.baserrrZ gitlab.mixinsrr r r r __all__r rrrrrrrrrrrs(    M