Movatterモバイル変換


[0]ホーム

URL:


ContentsMenuExpandLight modeDark modeAuto light/dark, in light modeAuto light/dark, in dark modeSkip to content
python-gitlabv6.1.0
python-gitlabv6.1.0

Table of Contents

Back to top

Project Access Tokens

Get a list of project access tokens

References

Examples

List project access tokens:

access_tokens=gl.projects.get(1,lazy=True).access_tokens.list(get_all=True)print(access_tokens[0].name)

Get a project access token by id:

token=project.access_tokens.get(123)print(token.name)

Create project access token:

access_token=gl.projects.get(1).access_tokens.create({"name":"test","scopes":["api"],"expires_at":"2023-06-06"})

Revoke a project access token:

gl.projects.get(1).access_tokens.delete(42)# oraccess_token.delete()

Rotate a project access token and retrieve its new value:

token=project.access_tokens.get(42,lazy=True)token.rotate()print(token.token)# or directly using a token IDnew_token=project.access_tokens.rotate(42)print(new_token.token)

Self-Rotate the project access token you are using to authenticate the request and retrieve its new value:

token=project.access_tokens.get(42,lazy=True)token.rotate(self_rotate=True)print(new_token.token)
On this page

[8]ページ先頭

©2009-2025 Movatter.jp