Skip to content

Commit df02a8d

Browse files
shelley.besscehoffman
authored andcommitted
Documentation for new datasource/resource
Signed-off-by: shelley.bess <[email protected]>
1 parent 154000f commit df02a8d

File tree

4 files changed

+152
-0
lines changed

4 files changed

+152
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
layout: "gitlab"
3+
page_title: "GitLab: gitlab_datasource_project"
4+
sidebar_current: "docs-gitlab-data-source-project"
5+
description: |-
6+
View information about a project
7+
---
8+
9+
# gitlab\_datasource_project
10+
11+
datasource_project provides details about a specific project in the gitlab provider. The results include the name of the project, path, description, default branch, etc.
12+
13+
## Example Usage
14+
15+
```hcl
16+
data "gitlab_project" "test" {
17+
name = "Test Project"
18+
}
19+
```
20+
21+
## Argument Reference
22+
23+
The following arguments are supported:
24+
25+
* `name` - (Required) The name of the project.
26+
27+
## Attributes Reference
28+
29+
The following attributes are exported:
30+
31+
* `path` - The path of the repository.
32+
33+
* `namespace_id` - The namespace (group or user) of the project. Defaults to your user.
34+
See [`gitlab_group`](group.html) for an example.
35+
36+
* `description` - A description of the project.
37+
38+
* `default_branch` - The default branch for the project.
39+
40+
* `issues_enabled` - Enable issue tracking for the project.
41+
42+
* `merge_requests_enabled` - Enable merge requests for the project.
43+
44+
* `wiki_enabled` - Enable wiki for the project.
45+
46+
* `snippets_enabled` - Enable snippets for the project.
47+
48+
* `visibility_level` - Repositories are created as private by default.
49+
50+
* `id` - Integer that uniquely identifies the project within the gitlab install.
51+
52+
* `ssh_url_to_repo` - URL that can be provided to `git clone` to clone the
53+
repository via SSH.
54+
55+
* `http_url_to_repo` - URL that can be provided to `git clone` to clone the
56+
repository via HTTP.
57+
58+
* `web_url` - URL that can be used to find the project in a browser.
59+
60+
61+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
layout: "gitlab"
2+
page_title: "GitLab: gitlab_datasource_user"
3+
sidebar_current: "docs-gitlab-data-source-user"
4+
description: |-
5+
Looks up a gitlab user
6+
---
7+
8+
# gitlab\_datasource_user
9+
10+
datasource_user provides details about a specific user in the gitlab provier. The results include username, id, name, etc.
11+
12+
## Example Usage
13+
14+
```hcl
15+
data "gitlab_user" "test" {
16+
17+
}
18+
```
19+
20+
## Argument Reference
21+
22+
The following arguments are supported:
23+
24+
* `email` - (Required) The e-mail address of the user.
25+
26+
## Attributes Reference
27+
28+
The following attributes are exported:
29+
30+
* `name` - (Required) The name of the user.
31+
32+
* `username` - (Required) The username of the user.
33+
34+
* `email` - (Required) The e-mail address of the user.
35+
36+
* `id` - The unique id assigned to the user by the GitLab server.
37+
38+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: "gitlab"
3+
page_title: "GitLab: gitlab_project_membership"
4+
sidebar_current: "docs-gitlab-resource-project-membership"
5+
description: |-
6+
Adds a user to a project as a member
7+
---
8+
9+
# gitlab\_project_membership
10+
11+
This resource allows you to add a current user to an existing project with a set access level.
12+
13+
## Example Usage
14+
15+
```hcl
16+
resource "gitlab_project_membership" "test" {
17+
project_id = "Test Project"
18+
user_id = "Test User"
19+
access_level = "guest"
20+
}
21+
```
22+
23+
## Argument Reference
24+
25+
The following arguments are supported:
26+
27+
* `project_id` - (Required) The id of the project.
28+
29+
* `user_id` - (Required) The id of the user.
30+
31+
* `access_level` - (Required) One of five levels of access to the project.
32+
33+
## Attributes Reference
34+
35+
The resource exports the following attributes:
36+
37+
* `id` - The unique id assigned to the membership by the GitLab server.
38+

website/gitlab.erb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@
1010
<a href="/docs/providers/gitlab/index.html">Gitlab Provider</a>
1111
</li>
1212

13+
<li<%= sidebar_current("docs-gitlab-data-source") %>>
14+
<a href="#">Data Sources</a>
15+
<ul class="nav nav-visible">
16+
<li<%= sidebar_current("docs-gitlab-data-source-project") %>>
17+
<a href="/docs/providers/gitlab/r/datasource_project.html">gitlab_project</a>
18+
</li>
19+
<li<%= sidebar_current("docks-gitlab-data-source-user") %>>
20+
<a href="/docs/providers/gitlab/r/datasource_user.html">gitlab_user</a>
21+
</li>
22+
</ul>
23+
</li>
24+
1325
<li<%= sidebar_current("docs-gitlab-resource") %>>
1426
<a href="#">Resources</a>
1527
<ul class="nav nav-visible">
@@ -28,6 +40,9 @@
2840
<li<%= sidebar_current("docs-gitlab-resource-project-x") %>>
2941
<a href="/docs/providers/gitlab/r/project.html">gitlab_project</a>
3042
</li>
43+
<li<%= sidebar_current("docs-gitlab-resource-project-membership") %>>
44+
<a href="/docs/providers/gitlab/r/project-membership.html">gitlab_project_membership</a>
45+
</li>
3146
<li<%= sidebar_current("docs-gitlab-resource-user") %>>
3247
<a href="/docs/providers/gitlab/r/user.html">gitlab_user</a>
3348
</li>

0 commit comments

Comments
 (0)