Skip to content

Commit 1a03ffc

Browse files
authored
api basic (#198)
1 parent 478ca35 commit 1a03ffc

File tree

4 files changed

+150
-1
lines changed

4 files changed

+150
-1
lines changed

apps/docs/content/references/api.mdx

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: REST API Reference
3+
desc: Overview of Zerops REST API endpoints and authentication, designed to help you integrate with Zerops programmatically
4+
---
5+
6+
The Zerops REST API allows you to programmatically interact with Zerops platform by providing access to resources like projects, services, users, billing, and configurations.
7+
8+
## Base URL
9+
10+
All API requests should be made to:
11+
```
12+
https://api.app-prg1.zerops.io/api/rest/public
13+
```
14+
15+
## Authentication
16+
17+
The API uses Bearer token authentication. You can obtain your Personal access token from the **Access Token management** section in the Zerops GUI.
18+
19+
Include the token in the Authorization header:
20+
```
21+
Authorization: Bearer <your-token>
22+
```
23+
24+
## API Resources
25+
26+
:::note
27+
Some resource groups have non-obvious naming:
28+
- `/service-stack` endpoints handle services management
29+
- `/user-data` endpoints handle environment variables management
30+
:::
31+
32+
View the [full Swagger documentation](https://api.app-prg1.zerops.io/api/rest/public/swagger) or jump to a specific resource group:
33+
34+
<table className="w-full">
35+
<thead className="rounded-lg">
36+
<tr>
37+
<th className="w-auto"><strong>Group</strong></th>
38+
<th className="w-full"><strong>Description</strong></th>
39+
</tr>
40+
</thead>
41+
<tbody>
42+
<tr>
43+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicAppVersion">/app-version</a></strong></td>
44+
<td className="w-fit">Manage application versions, builds, and deployments</td>
45+
</tr>
46+
<tr>
47+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicAuth">/auth</a></strong></td>
48+
<td className="w-fit">Authentication and token management</td>
49+
</tr>
50+
<tr>
51+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicBilling">/billing</a></strong></td>
52+
<td className="w-fit">Billing operations and payment management</td>
53+
</tr>
54+
<tr>
55+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicClient">/client</a></strong></td>
56+
<td className="w-fit">Client account management</td>
57+
</tr>
58+
<tr>
59+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicClientUser">/client-user</a></strong></td>
60+
<td className="w-fit">User management within client accounts</td>
61+
</tr>
62+
<tr>
63+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicGithub">/github</a></strong></td>
64+
<td className="w-fit">GitHub repository connections and authorization</td>
65+
</tr>
66+
<tr>
67+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicGitlab">/gitlab</a></strong></td>
68+
<td className="w-fit">GitLab repository connections and authorization</td>
69+
</tr>
70+
<tr>
71+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicProject">/project</a></strong></td>
72+
<td className="w-fit">Project management operations</td>
73+
</tr>
74+
<tr>
75+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicProjectEnv">/project-env</a></strong></td>
76+
<td className="w-fit">Project environment variables management</td>
77+
</tr>
78+
<tr>
79+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicPublicHttpRouting">/public-http-routing</a></strong></td>
80+
<td className="w-fit">HTTP routing configuration</td>
81+
</tr>
82+
<tr>
83+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicPublicPortRouting">/public-port-routing</a></strong></td>
84+
<td className="w-fit">Port routing and firewall rules configuration</td>
85+
</tr>
86+
<tr>
87+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicServiceStack">/service-stack</a></strong></td>
88+
<td className="w-fit">Service stack operations and configuration</td>
89+
</tr>
90+
<tr>
91+
<td className="w-fit"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicSettings">/settings</a></strong></td>
92+
<td className="w-fit">System settings and configurations</td>
93+
</tr>
94+
<tr>
95+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicUser">/user</a></strong></td>
96+
<td className="w-fit">User account management</td>
97+
</tr>
98+
<tr>
99+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicUserData">/user-data</a></strong></td>
100+
<td className="w-fit">Environment variables management</td>
101+
</tr>
102+
<tr>
103+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicUserNotification">/user-notification</a></strong></td>
104+
<td className="w-fit">User notifications management</td>
105+
</tr>
106+
<tr>
107+
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicUserToken">/user-token</a></strong></td>
108+
<td className="w-fit">Personal access tokens management</td>
109+
</tr>
110+
</tbody>
111+
</table>

apps/docs/sidebars.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,15 @@ module.exports = {
643643
},
644644
className: 'homepage-sidebar-item',
645645
},
646+
{
647+
type: 'doc',
648+
id: 'references/api',
649+
label: 'API',
650+
customProps: {
651+
sidebar_icon: 'curly-braces',
652+
},
653+
className: 'homepage-sidebar-item',
654+
},
646655
{
647656
type: 'html',
648657
value: 'Help',
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { IconProps } from '@medusajs/icons/dist/types';
2+
import clsx from 'clsx';
3+
import React from 'react';
4+
5+
const IconCurlyBraces = (props: IconProps) => {
6+
return (
7+
<svg
8+
width={props.width || 20}
9+
height={props.height || 20}
10+
viewBox="0 0 24 24"
11+
fill="none"
12+
xmlns="http://www.w3.org/2000/svg"
13+
{...props}
14+
className={clsx('text-ui-fg-subtle ${className}', props.className)}
15+
>
16+
<path
17+
stroke="currentColor"
18+
strokeLinecap="round"
19+
strokeLinejoin="round"
20+
strokeWidth={2}
21+
d="M9.5 5H9a2 2 0 0 0-2 2v2c0 1-.6 3-3 3 1 0 3 .6 3 3v2a2 2 0 0 0 2 2h.5m5-14h.5a2 2 0 0 1 2 2v2c0 1 .6 3 3 3-1 0-3 .6-3 3v2a2 2 0 0 1-2 2h-.5"
22+
/>
23+
</svg>
24+
);
25+
};
26+
27+
export default IconCurlyBraces;

apps/docs/src/theme/Icon/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
ComputerDesktopSolid,
4242
CreditCardSolid,
4343
CubeSolid,
44+
CurlyBraces,
4445
CurrencyDollar,
4546
CurrencyDollarSolid,
4647
Discord,
@@ -150,7 +151,7 @@ import IconCloudOk from './CloudOk';
150151
import IconGitlab from './Gitlab';
151152
import IconTypesense from './Typesense';
152153
import IconDocker from './Docker';
153-
154+
import IconCurlyBraces from './CurlyBraces';
154155

155156
export default {
156157
'academic-cap-solid': AcademicCapSolid,
@@ -306,4 +307,5 @@ export default {
306307
database: IconDatabase,
307308
cloudok: IconCloudOk,
308309
typesense: IconTypesense,
310+
'curly-braces': IconCurlyBraces,
309311
};

0 commit comments

Comments
 (0)