Check the response for the X-Total-Pages header. As long as page is smaller than total pages, you have to call the api again and increment the page variable. https://docs.gitlab.com/ee/api/rest/index.html#pagination-link-header

Answer from Sascha Frinken on Stack Overflow
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › gitlab pages
Pages API | GitLab Docs
Retrieves Pages settings for a specified project. ... You must have the Maintainer or Owner role for the project. ... curl --request GET \ --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/2/pages"
REST API
The following cURL example limits ... the second page (page=2) of comments of the issue with ID 8 which belongs to the project with ID 9: curl --request GET \ --head \ --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/9/issues...
Commits
The commit status API for use with GitLab. ... List the statuses of a commit in a project. The pagination parameters page and per_page can be used to restrict the list of references.
Resources
GitLab REST API resources organized by context (project, group, standalone, and templates) with endpoint paths.
Webhooks
Configure and manage project and group webhooks in GitLab.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › pages domains
Pages domains API | GitLab Docs
Lists all Pages domains in the specified project. The user must have permissions to view Pages domains. ... curl --request GET \ --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/5/pages/domains"
Discussions

Gitlab Pages with an HTTP POST?
Yes 100%. I actually built and maintain a GitLab pages website and CLI tool that are both wrappers around the GitLab api to parameterize and trigger pipelines on behalf of my teammates. In order to do this on the GitLab pages side, we need a few things: Create a GitLab application in Preferences -> Applications, and configure it to allow OAUTH and whichever permissions you need for yourself/teammates. Set the website up to login with OAUTH to get an access token for the user that logged in Using that access token, you can now access the GitLab API and can use it to call the GitLab triggers api endpoint. Given you mention Hugo, you'll need to write your own JavaScript modules to handle the API calls and letting the user know about success/failure statuses. One simple way is to have your inputs all within a ``, and then intercept the submit call, make the API call to trigger your GitLab pipeline, and then open the running pipeline page in a new tab (part of the Trigger pipeline response). Another Consideration: - Since GitLab pages can be protected behind private organizations (i.e. GitLab will protect your site from anyone who doesn't have access to your GitLab account), you can skip the OAUTH part and create an AccessToken that you deploy with the site. The access token can be used to call the GitLab API directly without having people login. This solution assumes some familiarity with JavaScript, web technologies, and authenticated web apps/apis. Let me know if you need help with any of these! More on reddit.com
🌐 r/gitlab
18
5
February 2, 2022
curl - Pagination in Gitlab API only returns 100 per_page max - Stack Overflow
I am currently using GitLab API to return all projects within a group. The question I have is, how do I return all projects if there are over 100 projects in the group? The curl command I'm using is More on stackoverflow.com
🌐 stackoverflow.com
GitLab Rest API set GitLab Pages visibility to 'Everyone' - Stack Overflow
I have a program that allows me to automatically create a new GitLab project with the GitLab API and I would like to be able via this API to set the visibility of Pages to 'Everyone', which default... More on stackoverflow.com
🌐 stackoverflow.com
GitLab API Pagination
I've managed to retrieve the number of pages with the following command: echo $(curl --head "https://gitlab.xxxxxxx/api/v4/projects?per_page=100" | grep X-Total-Pages | grep -o -e [0-9]*) But I don't really know how to use it inside my Logstash input, which is a curl command within exec input. More on discuss.elastic.co
🌐 discuss.elastic.co
11
0
July 9, 2018
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api
REST API | GitLab Docs
Use the GitLab REST API for programmatic interaction with GitLab. Includes requests, rate limits, pagination, encoding, versioning, and response handling.
🌐
Reddit
reddit.com › r/gitlab › gitlab pages with an http post?
r/gitlab on Reddit: Gitlab Pages with an HTTP POST?
February 2, 2022 -

Rather than spend a few hours digging into this, I just wanted to ask the question to the community for some guidance.

I need to create a web page for the purposes of kicking off a pipeline with parameters passed to it. Originally, I wanted to use Gitlab Pages, host a site that had drop-down boxes and text boxes, and the like, but reading through Hugo (the most starred example on Gitlab Pages), I don't think I can do an HTTP Post.

Is there anything I can run in Gitlab Pages to make this work? Or am I screwed and I need to just get something up and running on a flask server?

Top answer
1 of 3
5
Yes 100%. I actually built and maintain a GitLab pages website and CLI tool that are both wrappers around the GitLab api to parameterize and trigger pipelines on behalf of my teammates. In order to do this on the GitLab pages side, we need a few things: Create a GitLab application in Preferences -> Applications, and configure it to allow OAUTH and whichever permissions you need for yourself/teammates. Set the website up to login with OAUTH to get an access token for the user that logged in Using that access token, you can now access the GitLab API and can use it to call the GitLab triggers api endpoint. Given you mention Hugo, you'll need to write your own JavaScript modules to handle the API calls and letting the user know about success/failure statuses. One simple way is to have your inputs all within a ``, and then intercept the submit call, make the API call to trigger your GitLab pipeline, and then open the running pipeline page in a new tab (part of the Trigger pipeline response). Another Consideration: - Since GitLab pages can be protected behind private organizations (i.e. GitLab will protect your site from anyone who doesn't have access to your GitLab account), you can skip the OAUTH part and create an AccessToken that you deploy with the site. The access token can be used to call the GitLab API directly without having people login. This solution assumes some familiarity with JavaScript, web technologies, and authenticated web apps/apis. Let me know if you need help with any of these!
2 of 3
2
Do you need to have random people do it? Maybe a HTML form would be enough to make it possible. You just need to make sure the api token is there but no one can do more with it than you intended.
🌐
GitLab
docs.gitlab.com › gitlab docs › administer › update your settings › gitlab pages
GitLab Pages administration | GitLab Docs
Each request to view a resource in a private site is authenticated by Pages using that token. For each request it receives, Pages makes a request to the GitLab API to check that the user is authorized to read that site.
🌐
GitLab
docs.gitlab.com › charts › advanced › external-gitlab-pages
Configure the GitLab chart with external GitLab Pages | GitLab Docs
global: pages: path: '/srv/gitlab/shared/pages' host: <Pages root domain> port: '80' # Set to 443 if Pages is served over HTTPS https: false # Set to true if Pages is served over HTTPS artifactsServer: true objectStore: enabled: true bucket: 'gitlab-pages' apiSecret: secret: gitlab-pages-api-key key: shared_secret extraEnv: PAGES_UPDATE_LEGACY_STORAGE: true # Bypass automatic disabling of disk storage
Find elsewhere
🌐
GitLab
about.gitlab.com › blog › engineering › how gitlab pages uses the gitlab api to serve content
How GitLab Pages uses the GitLab API to serve content
August 3, 2020 - With API-based configuration, the daemon will start serving content in just a few seconds after booting. For example, for a particular Pages node on GitLab.com, it usually is ready to serve content within one minute after starting.
🌐
Rust
docs.rs › gitlab › latest › gitlab › api › projects › pages › index.html
gitlab::api::projects::pages - Rust
gitlab:: api:: projects · Source · Expand description · Project Pages API endpoints. These endpoints are used for managing Pages. Edit · Pages · List Pages settings for the project. Edit · Pages · Builder · Builder for EditPages. Pages · List Pages settings for the project.
🌐
Stack Overflow
stackoverflow.com › questions › 70246914 › gitlab-rest-api-set-gitlab-pages-visibility-to-everyone
GitLab Rest API set GitLab Pages visibility to 'Everyone' - Stack Overflow
There's an attribute in the Create Project API to change the Pages visibility level. The attribute is called pages_access_level and the available options are disabled, private, enabled, or public.
🌐
Python GitLab
python-gitlab.readthedocs.io › en › stable › api-usage.html
Using the REST API - python-gitlab v8.5.0
You can define the per_page value globally to avoid passing it to every list() method call: ... Gitlab allows to also use keyset pagination. You can supply it to your project listing, but you can also do so globally. Be aware that GitLab then also requires you to only use supported order options.
🌐
Gentoo Wiki
wiki.gentoo.org › wiki › GitLab › Pages
GitLab/Pages - Gentoo wiki
March 23, 2022 - user $gitlab-pages -listen-http=:8090 -pages-root=/opt/gitlab/gitlab/shared/pages api-secret-key=/opt/gitlab/gitlab/.gitlab_pages_secret -pages-domain=example.io -internal-gitlab-server=https://gitlab.example.com
🌐
GitLab
docs.gitlab.com › gitlab docs › administer › update your settings › gitlab pages › gitlab pages for source installations
GitLab Pages administration for self-compiled installations | GitLab Docs
Each request to view a resource in a private site is authenticated by Pages using that token. For each request it receives, Pages makes a request to the GitLab API to check that the user is authorized to read that site.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › gitlab cli (glab) › commands › glab api
glab api | GitLab Docs
Defaults to gitlab.com, or the authenticated host in the current Git directory. -i, --include Include HTTP response headers in the output. --input string The file to use as the body for the HTTP request. -X, --method string The HTTP method for the request. (default "GET") --output string Format output as: json, ndjson. (default "json") --paginate Make additional HTTP requests to fetch all pages of results.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › projects › wikis
Project wikis API | GitLab Docs
To interact with them, use the notes API. Lists all wiki pages for a specified project. ... curl --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/1/wikis?with_content=1"
🌐
GitLab
docs.gitlab.com › gitlab docs › use gitlab › deploy and release your application › gitlab pages
GitLab Pages | GitLab Docs
Pages also supports websites written directly in plain HTML, CSS, JavaScript, and Wasm. Dynamic server-side processing (like .php and .asp) is not supported. For more information, see Static vs dynamic websites. ... To use GitLab Pages, you must create a project in GitLab to upload your website’s files to.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources
REST API resources | GitLab Docs
The GitLab REST API gives you programmatic control over GitLab resources. Build integrations with your existing tools, automate repetitive tasks, and extract data for custom reports.
🌐
GitLab
docs.gitlab.com › gitlab docs › administer › update your settings › gitlab pages › troubleshooting
Troubleshooting GitLab Pages administration | GitLab Docs
The Pages daemon proxies artifact requests to the GitLab API at artifacts_server_url. Those requests use the URL-encoded path of the project, so the project path contains an encoded slash (/). If a reverse proxy in front of GitLab decodes that character, the URL no longer matches an API route.
🌐
Elastic
discuss.elastic.co › elastic stack › logstash
GitLab API Pagination - Logstash - Discuss the Elastic Stack
July 9, 2018 - I've managed to retrieve the number of pages with the following command: echo $(curl --head "https://gitlab.xxxxxxx/api/v4/projects?per_page=100" | grep X-Total-Pages | grep -o -e [0-9]*) But I don't really know how to use it inside my Logstash input, which is a curl command within exec input.