ngetchell / psgitlab Goto Github PK
View Code? Open in Web Editor NEWAn interface for administering GitLab from the PowerShell command line.
License: MIT License
An interface for administering GitLab from the PowerShell command line.
License: MIT License
Creates a new project owned by the specified user. Available only for admins.
POST /projects/user/:user_id
Parameters:
user_id
(required) - user_id of ownername
(required) - new project namedescription
(optional) - short project descriptiondefault_branch
(optional) - 'master' by defaultissues_enabled
(optional)merge_requests_enabled
(optional)wiki_enabled
(optional)snippets_enabled
(optional)public
(optional) - if true
same as setting visibility_level = 20visibility_level
(optional)import_url
(optional)Get a list of all GitLab projects (admin only).
GET /projects/all
Parameters:
archived
(optional) - if passed, limit by archived statusorder_by
(optional) - Return requests ordered by id
, name
, path
, created_at
, updated_at
or last_activity_at
fields. Default is created_at
sort
(optional) - Return requests sorted in asc
or desc
order. Default is desc
search
(optional) - Return list of authorized projects according to a search criteriaci_enabled_first
- Return projects ordered by ci_enabled flag. Projects with enabled GitLab CI go firstCreates a new label for given repository with given name and color.
POST /projects/:id/labels
Parameters:
id
(required) - The ID of a projectname
(required) - The name of the labelcolor
(required) - Color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB)It returns 200 and the newly created label, if the operation succeeds.
If the label already exists, 409 and an error message is returned.
If label parameters are invalid, 400 and an explaining error message is returned.
All Get-* functions should have an output type.
Add PSGitLab to Applications page on about.gitlab.com. Should be as easy as issuing a MR.
Right now my name is the only name on PSGitLab but I'd like to add others. I'd like to add the contributor's names to the following places:
Let me know if you want your name added or just your GitHub handle. If you have any personal sites you'd like to have added I think the README would be a perfect place for it.
$RootPath = get-item $psscriptroot
$ModuleName = ($rootPath.BaseName -split "-")[1]
$ModulePath = "$psscriptroot/$ModuleName"
$release = "$psscriptroot/Release/$ModuleName"
$PublicFunctions = @()
$AliasToExports = @()
$FileList = @()
$manifest = "$release$modulename.psd1"
if(test-path $release) {
Remove-Item -Recurse -Force -Confirm:$false -Path $release
}
new-item $release -Force -ItemType directory
copy-item "$ModulePath$modulename.psd1" $manifest -Force
$FileList += "$modulename.psd1"
$FileList += "$modulename.psm1"
"########################" | Add-Content "$release$ModuleName.psm1"
"### Public Functions ###" | Add-Content "$release$ModuleName.psm1"
"########################" | Add-Content "$release$ModuleName.psm1"
foreach($function in (get-childitem $ModulePath\Public\ -Recurse)) {
$PublicFunctions += $function.basename
$content = Get-Content $function.fullname
$content | Add-Content "$release$ModuleName.psm1"
if($content -match '[Alias(([^)]*)') {
foreach($alias in ($matches[1] -split ",") -replace ("`"",'')) {
$AliasToExports += $alias
}
}
}
"#########################" | Add-Content "$release$ModuleName.psm1"
"### Private Functions ###" | Add-Content "$release$ModuleName.psm1"
"#########################" | Add-Content "$release$ModuleName.psm1"
foreach($function in (get-childitem $ModulePath\Private\ -Recurse)) {
Get-Content $function.fullname | Add-Content "$release$ModuleName.psm1"
}
Update-ModuleManifest -Path $manifest -FunctionsToExport $PublicFunctions -AliasesToExport $AliasToExports -FileList $FileList
Convert to https://github.com/PowerShell/platyPS help instead of just MAML or comment-based help. This should enhance what help looks like at the console and should allow for better collaboration with the community.
I need a way to import the configurations.
Removes a project including all associated resources (issues, merge requests etc.)
DELETE /projects/:id
Parameters:
id
(required) - The ID of a projectThe following build should have resulted in a build failure through AppVeyor.
https://ci.appveyor.com/project/ngetchell/psgitlab/build/1.0.1.126
Get the events for the specified project.
Sorted from newest to latest
GET /projects/:id/events
Parameters:
id
(required) - The ID or NAMESPACE/PROJECT_NAME of a project[
{
"title": null,
"project_id": 15,
"action_name": "closed",
"target_id": 830,
"target_type": "Issue",
"author_id": 1,
"author_username": "john",
"data": null,
"target_title": "Public project search field"
},
{
"title": null,
"project_id": 15,
"action_name": "opened",
"target_id": null,
"target_type": null,
"author_id": 1,
"author_username": "john",
"data": {
"before": "50d4420237a9de7be1304607147aec22e4a14af7",
"after": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
"ref": "refs/heads/master",
"user_id": 1,
"user_name": "Dmitriy Zaporozhets",
"repository": {
"name": "gitlabhq",
"url": "[email protected]:gitlab/gitlabhq.git",
"description": "GitLab: self hosted Git management software. \r\nDistributed under the MIT License.",
"homepage": "https://dev.gitlab.org/gitlab/gitlabhq"
},
"commits": [
{
"id": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
"message": "Add simple search to projects in public area",
"timestamp": "2013-05-13T18:18:08+00:00",
"url": "https://dev.gitlab.org/gitlab/gitlabhq/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428",
"author": {
"name": "Dmitriy Zaporozhets",
"email": "[email protected]"
}
}
],
"total_commits_count": 1
},
"target_title": null
},
{
"title": null,
"project_id": 15,
"action_name": "closed",
"target_id": 840,
"target_type": "Issue",
"author_id": 1,
"author_username": "john",
"data": null,
"target_title": "Finish & merge Code search PR"
}
]
The README should provide proper attribution to collaborators, examples on using the software, and much better documentation.
Gets currently authenticated user.
GET /user
{
"id": 1,
"username": "john_smith",
"email": "[email protected]",
"name": "John Smith",
"private_token": "dd34asd13as",
"state": "active",
"created_at": "2012-05-23T08:00:58Z",
"bio": null,
"skype": "",
"linkedin": "",
"twitter": "",
"website_url": "",
"theme_id": 1,
"color_scheme_id": 2,
"is_admin": false,
"can_create_group": true,
"can_create_project": true,
"projects_limit": 100
}
Get a single user.
GET /users/:id
Parameters:
id
(required) - The ID of a user{
"id": 1,
"username": "john_smith",
"name": "John Smith",
"state": "active",
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
}
GET /users/:id
Parameters:
id
(required) - The ID of a user{
"id": 1,
"username": "john_smith",
"email": "[email protected]",
"name": "John Smith",
"state": "active",
"created_at": "2012-05-23T08:00:58Z",
"bio": null,
"skype": "",
"linkedin": "",
"twitter": "",
"website_url": "",
"extern_uid": "john.smith",
"provider": "provider_name",
"theme_id": 1,
"color_scheme_id": 2,
"is_admin": false,
"can_create_group": true,
"can_create_project": true,
"projects_limit": 100
}
A helper function to actually QueryGitLab.
Updates an existing label with new name or now color. At least one parameter
is required, to update the label.
PUT /projects/:id/labels
Parameters:
id
(required) - The ID of a projectname
(required) - The name of the existing labelnew_name
(optional) - The new name of the labelcolor
(optional) - New color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB)On success, this method returns 200 with the updated label.
If required parameters are missing or parameters are invalid, 400 is returned.
If the label to be updated is missing, 404 is returned.
In case of an error, additionally an error message is returned.
Get a list of users.
This function takes pagination parameters page
and per_page
to restrict the list of users.
GET /users
[
{
"id": 1,
"username": "john_smith",
"name": "John Smith",
"state": "active",
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
},
{
"id": 2,
"username": "jack_smith",
"name": "Jack Smith",
"state": "blocked",
"avatar_url": "http://gravatar.com/../e32131cd8.jpeg",
}
]
GET /users
[
{
"id": 1,
"username": "john_smith",
"email": "[email protected]",
"name": "John Smith",
"state": "active",
"created_at": "2012-05-23T08:00:58Z",
"bio": null,
"skype": "",
"linkedin": "",
"twitter": "",
"website_url": "",
"extern_uid": "john.smith",
"provider": "provider_name",
"theme_id": 1,
"color_scheme_id": 2,
"is_admin": false,
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
"can_create_group": true,
"current_sign_in_at": "2014-03-19T13:12:15Z",
"two_factor_enabled": true
},
{
"id": 2,
"username": "jack_smith",
"email": "[email protected]",
"name": "Jack Smith",
"state": "blocked",
"created_at": "2012-05-23T08:01:01Z",
"bio": null,
"skype": "",
"linkedin": "",
"twitter": "",
"website_url": "",
"extern_uid": "jack.smith",
"provider": "provider_name",
"theme_id": 1,
"color_scheme_id": 3,
"is_admin": false,
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
"can_create_group": true,
"can_create_project": true,
"projects_limit": 100,
"current_sign_in_at": "2014-03-19T17:54:13Z",
"two_factor_enabled": false
}
]
You can search for users by email or username with: /users?search=John
Also see def search query
in app/models/user.rb
.
After we complete #46 we should look into better pester tests around help. An example would be June Blender's PesterTDD Module Help.
Get a list of a specified user's SSH keys. Available only for admin
GET /users/:uid/keys
Parameters:
uid
(required) - id of specified userThere are password restrictions that don't meet the minimum length requirement. This should be easy to fix with parameter validation.
The only restriction I can find is that the password must be 8 characters in length.
The function New-GitLabFork
uses the not existing function Get-GitlabSingleProject
.
It seems that the function Get-GitlabSingleProject
is replaced by the function Get-GitlabProject
....
The URL is not added to the profile when running new-gitlabuser. Could be a web encoding issue since the characters in a URL could cause issues in JSON.
Note: Get-Gitlabuser retrieves the field if you set it in the web app.
Creates a new user. Note only administrators can create new users.
POST /users
Parameters:
email
(required) - Emailpassword
(required) - Passwordusername
(required) - Usernamename
(required) - Nameskype
(optional) - Skype IDlinkedin
(optional) - LinkedIntwitter
(optional) - Twitter accountwebsite_url
(optional) - Website URLprojects_limit
(optional) - Number of projects user can createextern_uid
(optional) - External UIDprovider
(optional) - External provider namebio
(optional) - User's biographyadmin
(optional) - User is admin - true or false (default)can_create_group
(optional) - User can create groups - true or falseconfirm
(optional) - Require confirmation - true (default) or falseDeletes a label given by its name.
DELETE /projects/:id/labels
id
(required) - The ID of a projectname
(required) - The name of the label to be deletedIt returns 200 if the label successfully was deleted, 400 for wrong parameters
and 404 if the label does not exist.
In case of an error, additionally an error message is returned.
Deletes key owned by a specified user. Available only for admin.
DELETE /users/:uid/keys/:id
Parameters:
uid
(required) - id of specified userid
(required) - SSH key IDWill return 200 OK
on success, or 404 Not found
if either user or key cannot be found.
Creates a new project owned by the authenticated user.
POST /projects
Parameters:
name
(required) - new project namepath
(optional) - custom repository name for new project. By default generated based on namenamespace_id
(optional) - namespace for the new project (defaults to user)description
(optional) - short project descriptionissues_enabled
(optional)merge_requests_enabled
(optional)wiki_enabled
(optional)snippets_enabled
(optional)public
(optional) - if true
same as setting visibility_level = 20visibility_level
(optional)import_url
(optional)Updates an existing project
PUT /projects/:id
Parameters:
id
(required) - The ID of a projectname
(optional) - project namepath
(optional) - repository name for projectdescription
(optional) - short project descriptiondefault_branch
(optional)issues_enabled
(optional)merge_requests_enabled
(optional)wiki_enabled
(optional)snippets_enabled
(optional)public
(optional) - if true
same as setting visibility_level = 20visibility_level
(optional)On success, method returns 200 with the updated project. If parameters are
invalid, 400 is returned.
The API does not use URL encoding f.e. in function Get-GitlabNamespace
.
This could end up in erros f.e. when I search for chars like &?#
(ok, maybe not the best example but this is an issue!
URL encoding can be done with
[uri]::EscapeDataString($myString)
Get a single key.
GET /user/keys/:id
Parameters:
id
(required) - The ID of an SSH key{
"id": 1,
"title": "Public key",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
"created_at": "2014-08-01T14:47:39.080Z"
}
This need to be protected, it should not be in cleartext.
also the token should be using secure string, so it's also protected in memory.
this also for the SSH key then it's implemented.
When I run the build function without administrative privileges, i get the following errors:
C:\git\PSGitLab [master ≡]> .\build.ps1
Install-Module : Zur Installation von Modulen in "C:\Program Files\WindowsPowerShell\Modules" sind Administratorrechte
erforderlich. Melden Sie sich unter einem Konto mit Administratorrechten beim Computer an, wiederholen Sie den
Vorgang, oder installieren Sie "C:\Users\leonhard.schick\Documents\WindowsPowerShell\Modules", indem Sie Ihrem Befehl
"-Scope CurrentUser" hinzufügen. Sie können auch versuchen, die Windows PowerShell-Sitzung mit erhöhten Rechten (Als
Administrator) auszuführen.
At C:\git\PSGitLab\build.ps1:39 char:17
+ ... Install-Module -Name $ModuleName -Verbose:$false -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Install-Module], ArgumentException
+ FullyQualifiedErrorId : InstallModuleNeedsCurrentUserScopeParameterForNonAdminUser,Install-Module
Import-Module : The specified module 'BuildHelpers' was not loaded because no valid module file was found in any
module directory.
At C:\git\PSGitLab\build.ps1:40 char:17
+ ... Import-Module -Name $ModuleName -Verbose:$false -Force -R ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (BuildHelpers:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Install-Module : Zur Installation von Modulen in "C:\Program Files\WindowsPowerShell\Modules" sind Administratorrechte
erforderlich. Melden Sie sich unter einem Konto mit Administratorrechten beim Computer an, wiederholen Sie den
Vorgang, oder installieren Sie "C:\Users\leonhard.schick\Documents\WindowsPowerShell\Modules", indem Sie Ihrem Befehl
"-Scope CurrentUser" hinzufügen. Sie können auch versuchen, die Windows PowerShell-Sitzung mit erhöhten Rechten (Als
Administrator) auszuführen.
At C:\git\PSGitLab\build.ps1:39 char:17
+ ... Install-Module -Name $ModuleName -Verbose:$false -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Install-Module], ArgumentException
+ FullyQualifiedErrorId : InstallModuleNeedsCurrentUserScopeParameterForNonAdminUser,Install-Module
Import-Module : The specified module 'psake' was not loaded because no valid module file was found in any module
directory.
At C:\git\PSGitLab\build.ps1:40 char:17
+ ... Import-Module -Name $ModuleName -Verbose:$false -Force -R ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (psake:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Install-Module : Zur Installation von Modulen in "C:\Program Files\WindowsPowerShell\Modules" sind Administratorrechte
erforderlich. Melden Sie sich unter einem Konto mit Administratorrechten beim Computer an, wiederholen Sie den
Vorgang, oder installieren Sie "C:\Users\leonhard.schick\Documents\WindowsPowerShell\Modules", indem Sie Ihrem Befehl
"-Scope CurrentUser" hinzufügen. Sie können auch versuchen, die Windows PowerShell-Sitzung mit erhöhten Rechten (Als
Administrator) auszuführen.
At C:\git\PSGitLab\build.ps1:39 char:17
+ ... Install-Module -Name $ModuleName -Verbose:$false -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Install-Module], ArgumentException
+ FullyQualifiedErrorId : InstallModuleNeedsCurrentUserScopeParameterForNonAdminUser,Install-Module
Import-Module : The specified module 'Pester' was not loaded because no valid module file was found in any module
directory.
At C:\git\PSGitLab\build.ps1:40 char:17
+ ... Import-Module -Name $ModuleName -Verbose:$false -Force -R ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (Pester:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Install-Module : Zur Installation von Modulen in "C:\Program Files\WindowsPowerShell\Modules" sind Administratorrechte
erforderlich. Melden Sie sich unter einem Konto mit Administratorrechten beim Computer an, wiederholen Sie den
Vorgang, oder installieren Sie "C:\Users\leonhard.schick\Documents\WindowsPowerShell\Modules", indem Sie Ihrem Befehl
"-Scope CurrentUser" hinzufügen. Sie können auch versuchen, die Windows PowerShell-Sitzung mit erhöhten Rechten (Als
Administrator) auszuführen.
At C:\git\PSGitLab\build.ps1:39 char:17
+ ... Install-Module -Name $ModuleName -Verbose:$false -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Install-Module], ArgumentException
+ FullyQualifiedErrorId : InstallModuleNeedsCurrentUserScopeParameterForNonAdminUser,Install-Module
Import-Module : The specified module 'PSDeploy' was not loaded because no valid module file was found in any module
directory.
At C:\git\PSGitLab\build.ps1:40 char:17
+ ... Import-Module -Name $ModuleName -Verbose:$false -Force -R ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (PSDeploy:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Install-Module : Zur Installation von Modulen in "C:\Program Files\WindowsPowerShell\Modules" sind Administratorrechte
erforderlich. Melden Sie sich unter einem Konto mit Administratorrechten beim Computer an, wiederholen Sie den
Vorgang, oder installieren Sie "C:\Users\leonhard.schick\Documents\WindowsPowerShell\Modules", indem Sie Ihrem Befehl
"-Scope CurrentUser" hinzufügen. Sie können auch versuchen, die Windows PowerShell-Sitzung mit erhöhten Rechten (Als
Administrator) auszuführen.
At C:\git\PSGitLab\build.ps1:39 char:17
+ ... Install-Module -Name $ModuleName -Verbose:$false -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Install-Module], ArgumentException
+ FullyQualifiedErrorId : InstallModuleNeedsCurrentUserScopeParameterForNonAdminUser,Install-Module
Import-Module : The specified module 'PSScriptAnalyzer' was not loaded because no valid module file was found in any
module directory.
At C:\git\PSGitLab\build.ps1:40 char:17
+ ... Import-Module -Name $ModuleName -Verbose:$false -Force -R ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (PSScriptAnalyzer:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Set-BuildEnvironment : The term 'Set-BuildEnvironment' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At C:\git\PSGitLab\build.ps1:51 char:1
+ Set-BuildEnvironment
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-BuildEnvironment:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Invoke-psake : The term 'Invoke-psake' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\git\PSGitLab\build.ps1:53 char:1
+ Invoke-psake -buildFile "$PSScriptRoot\psake.ps1" -taskList $Task -no ...
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Invoke-psake:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
It would be nice when the build script would check first if i have administrative privileges and if not throws a single error.
Get all labels for given project.
GET /projects/:id/labels
[
{
"name": "Awesome",
"color": "#DD10AA"
},
{
"name": "Documentation",
"color": "#1E80DD"
},
{
"name": "Feature",
"color": "#11FF22"
},
{
"name": "Bug",
"color": "#EE1122"
}
]
Deletes a user. Available only for administrators.
This is an idempotent function, calling this function for a non-existent user id
still returns a status code 200 OK
.
The JSON response differs if the user was actually deleted or not.
In the former the user is returned and in the latter not.
DELETE /users/:id
Parameters:
id
(required) - The ID of the userGet a list of currently authenticated user's SSH keys.
GET /user/keys
[
{
"id": 1,
"title": "Public key",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
"created_at": "2014-08-01T14:47:39.080Z"
},
{
"id": 3,
"title": "Another Public key",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
"created_at": "2014-08-01T14:47:39.080Z"
}
]
Parameters:
Test-GitLabAPI
Invoke-WebRequest : The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configuration is
not complete. Specify the UseBasicParsing parameter and try again.
At C:\Users\ngetchell\Documents\Git\PSGitLab\PSGitLab\Public\Configuration\Test-GitLabAPI.ps1:14 char:15
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get a list of projects accessible by the authenticated user.
GET /projects
Parameters:
archived
(optional) - if passed, limit by archived statusorder_by
(optional) - Return requests ordered by id
, name
, path
, created_at
, updated_at
or last_activity_at
fields. Default is created_at
sort
(optional) - Return requests sorted in asc
or desc
order. Default is desc
search
(optional) - Return list of authorized projects according to a search criteriaci_enabled_first
- Return projects ordered by ci_enabled flag. Projects with enabled GitLab CI go first[
{
"id": 4,
"description": null,
"default_branch": "master",
"public": false,
"visibility_level": 0,
"ssh_url_to_repo": "[email protected]:diaspora/diaspora-client.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
"web_url": "http://example.com/diaspora/diaspora-client",
"tag_list": [
"example",
"disapora client"
],
"owner": {
"id": 3,
"name": "Diaspora",
"created_at": "2013-09-30T13: 46: 02Z"
},
"name": "Diaspora Client",
"name_with_namespace": "Diaspora / Diaspora Client",
"path": "diaspora-client",
"path_with_namespace": "diaspora/diaspora-client",
"issues_enabled": true,
"merge_requests_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"created_at": "2013-09-30T13: 46: 02Z",
"last_activity_at": "2013-09-30T13: 46: 02Z",
"creator_id": 3,
"namespace": {
"created_at": "2013-09-30T13: 46: 02Z",
"description": "",
"id": 3,
"name": "Diaspora",
"owner_id": 1,
"path": "diaspora",
"updated_at": "2013-09-30T13: 46: 02Z"
},
"archived": false,
"avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png"
},
{
"id": 6,
"description": null,
"default_branch": "master",
"public": false,
"visibility_level": 0,
"ssh_url_to_repo": "[email protected]:brightbox/puppet.git",
"http_url_to_repo": "http://example.com/brightbox/puppet.git",
"web_url": "http://example.com/brightbox/puppet",
"tag_list": [
"example",
"puppet"
],
"owner": {
"id": 4,
"name": "Brightbox",
"created_at": "2013-09-30T13:46:02Z"
},
"name": "Puppet",
"name_with_namespace": "Brightbox / Puppet",
"path": "puppet",
"path_with_namespace": "brightbox/puppet",
"issues_enabled": true,
"merge_requests_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"created_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"creator_id": 3,
"namespace": {
"created_at": "2013-09-30T13:46:02Z",
"description": "",
"id": 4,
"name": "Brightbox",
"owner_id": 1,
"path": "brightbox",
"updated_at": "2013-09-30T13:46:02Z"
},
"archived": false,
"avatar_url": null
}
]
Modifies an existing user. Only administrators can change attributes of a user.
PUT /users/:id
Parameters:
email
- Emailusername
- Usernamename
- Namepassword
- Passwordskype
- Skype IDlinkedin
- LinkedIntwitter
- Twitter accountwebsite_url
- Website URLprojects_limit
- Limit projects each user can createextern_uid
- External UIDprovider
- External provider namebio
- User's biographyadmin
(optional) - User is admin - true or false (default)can_create_group
(optional) - User can create groups - true or falseNote, at the moment this method does only return a 404 error,
even in cases where a 409 (Conflict) would be more appropriate,
e.g. when renaming the email address to some existing one.
Forks a project into the user namespace of the authenticated user.
POST /projects/fork/:id
Parameters:
id
(required) - The ID of the project to be forkedGet a list of projects which are owned by the authenticated user.
GET /projects/owned
Parameters:
archived
(optional) - if passed, limit by archived statusorder_by
(optional) - Return requests ordered by id
, name
, path
, created_at
, updated_at
or last_activity_at
fields. Default is created_at
sort
(optional) - Return requests sorted in asc
or desc
order. Default is desc
search
(optional) - Return list of authorized projects according to a search criteriaci_enabled_first
- Return projects ordered by ci_enabled flag. Projects with enabled GitLab CI go firstDeletes key owned by currently authenticated user.
This is an idempotent function and calling it on a key that is already deleted
or not available results in 200 OK
.
DELETE /user/keys/:id
Parameters:
id
(required) - SSH key IDThe APIs don't follow the powershell parameter naming conventions but when piping you my need to match the website_url to WebsiteURL properties. Setting up aliases that match the api properties should fix this.
Remove-GitLabProject says it supports pipeline parameters but only removes the first one you give it. This has to be fixed.
Create new key owned by specified user. Available only for admin
POST /users/:id/keys
Parameters:
id
(required) - id of specified usertitle
(required) - new SSH Key's titlekey
(required) - new SSH keyWill return created key with status 201 Created
on success, or 404 Not found
on fail.
Configurations should be stored in the roaming appdata to travel with the user.
$env:appdata\PSGitLab\PSGitLabConfiguration.xml
It would be really nice to have automated unit testing.
That could be realised with a gitlab docker image and a continuous integration tool into this repo.
The idea behind that is to avoid bugs like #85
Get a specific project, identified by project ID or NAMESPACE/PROJECT_NAME, which is owned by the authenticated user.
If using namespaced projects call make sure that the NAMESPACE/PROJECT_NAME is URL-encoded, eg. /api/v3/projects/diaspora%2Fdiaspora
(where /
is represented by %2F
).
GET /projects/:id
Parameters:
id
(required) - The ID or NAMESPACE/PROJECT_NAME of a project{
"id": 3,
"description": null,
"default_branch": "master",
"public": false,
"visibility_level": 0,
"ssh_url_to_repo": "[email protected]:diaspora/diaspora-project-site.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
"web_url": "http://example.com/diaspora/diaspora-project-site",
"tag_list": [
"example",
"disapora project"
],
"owner": {
"id": 3,
"name": "Diaspora",
"created_at": "2013-09-30T13: 46: 02Z"
},
"name": "Diaspora Project Site",
"name_with_namespace": "Diaspora / Diaspora Project Site",
"path": "diaspora-project-site",
"path_with_namespace": "diaspora/diaspora-project-site",
"issues_enabled": true,
"merge_requests_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"created_at": "2013-09-30T13: 46: 02Z",
"last_activity_at": "2013-09-30T13: 46: 02Z",
"creator_id": 3,
"namespace": {
"created_at": "2013-09-30T13: 46: 02Z",
"description": "",
"id": 3,
"name": "Diaspora",
"owner_id": 1,
"path": "diaspora",
"updated_at": "2013-09-30T13: 46: 02Z"
},
"permissions": {
"project_access": {
"access_level": 10,
"notification_level": 3
},
"group_access": {
"access_level": 50,
"notification_level": 3
}
},
"archived": false,
"avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png"
}
Creates a new key owned by the currently authenticated user.
POST /user/keys
Parameters:
title
(required) - new SSH Key's titlekey
(required) - new SSH key{
"created_at": "2015-01-21T17:44:33.512Z",
"key": "ssh-dss AAAAB3NzaC1kc3MAAACBAMLrhYgI3atfrSD6KDas1b/3n6R/HP+bLaHHX6oh+L1vg31mdUqK0Ac/NjZoQunavoyzqdPYhFz9zzOezCrZKjuJDS3NRK9rspvjgM0xYR4d47oNZbdZbwkI4cTv/gcMlquRy0OvpfIvJtjtaJWMwTLtM5VhRusRuUlpH99UUVeXAAAAFQCVyX+92hBEjInEKL0v13c/egDCTQAAAIEAvFdWGq0ccOPbw4f/F8LpZqvWDydAcpXHV3thwb7WkFfppvm4SZte0zds1FJ+Hr8Xzzc5zMHe6J4Nlay/rP4ewmIW7iFKNBEYb/yWa+ceLrs+TfR672TaAgO6o7iSRofEq5YLdwgrwkMmIawa21FrZ2D9SPao/IwvENzk/xcHu7YAAACAQFXQH6HQnxOrw4dqf0NqeKy1tfIPxYYUZhPJfo9O0AmBW2S36pD2l14kS89fvz6Y1g8gN/FwFnRncMzlLY/hX70FSc/3hKBSbH6C6j8hwlgFKfizav21eS358JJz93leOakJZnGb8XlWvz1UJbwCsnR2VEY8Dz90uIk1l/UqHkA= loic@call",
"title": "ABC",
"id": 4
}
Will return created key with status 201 Created
on success. If an
error occurs a 400 Bad Request
is returned with a message explaining the error:
{
"message": {
"fingerprint": [
"has already been taken"
],
"key": [
"has already been taken"
]
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.