Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ navigation:

- page: Home
path: index.md
icon: home

- section: Overview
contents:
Expand Down Expand Up @@ -212,4 +213,8 @@ navigation:

- tab: api
layout:
- page: Getting Started
path: openapi/getting_started.md
icon: flower
- api: API Reference
tag-description-pages: true
74 changes: 74 additions & 0 deletions docs/openapi/getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
This section provides a quick overview of the API and how to get started.

### Authentication
The first step is to authenticate using a JWT bearer token. Organization structures and roles depend on the authentication configuration used. For details on authentication, please consult the
NICo REST `auth` module [README](https://github.com/NVIDIA/infra-controller-rest/tree/main/auth).

### API Version
The next step is to be aware of the API version being used. The API version can be retrieved by calling the [Retrieve Metadata endpoint](/infra-controller/rest-api-reference/api-reference/metadata/get-metadata). In general, the API maintains backward
compatibility with the previous versions. Any breaking changes are announced using a deprecation notice. Click on each API resource to see the deprecation notices.

### Service Account Mode
Depending on the auth configuration used, the NICo REST API may be configured in Service Account mode. In this mode, API users can act as both Provider and Tenant as part of the same organization.
If this is the case, the user must first retrieve the Service Account by making a call to the [Retrieve Service Account endpoint](/infra-controller/rest-api-reference/api-reference/service-account/get-current-service-account).
For service accounts, the Tenant entity is initialized as a privileged Tenant with `targetedInstanceCreation` capability enabled.

### Provider or Tenant Mode
If NICo REST API is not configured in Service Account mode, the user should retrieve the Infrastructure Provider by making a call to the [Retrieve Infrastructure Provider endpoint](/infra-controller/rest-api-reference/api-reference/infrastructure-provider/get-current-infrastructure-provider)
or the Tenant by making a call to the [Retrieve Tenant endpoint](/infra-controller/rest-api-reference/api-reference/tenant/get-current-tenant).

In both cases, these calls initialize Provider and Tenant entities for the organization. All resources created are anchored to either the Provider or Tenant entity.

Once the Provider and the Tenant are initialized, the user can create resources by making calls to the appropriate endpoints.

### Creating Site Level IP Blocks
To utilize a NICo Site, the Provider or Service Account holder must create IP Blocks for each network overlay defined in NICo Site configuration toml file.

To create an IP Block, the user must make a call to the [Create IP Block endpoint](/infra-controller/rest-api-reference/api-reference/ip-block/create-ipblock).

> **Note:** From this point onwards, a brief outline is provided for the typical API call flows for various use cases.

### Typical API Call Flow for Service Account

- Retrieve available Sites using the [Retrieve All Sites endpoint](/infra-controller/rest-api-reference/api-reference/site/get-all-site) and choose a Site to create resources in. For _Disconnected_ NICo installations where NICo
REST is deployed alongside NICo Core, typically there will be a single Site available.
- For each Site IP Block, create a Network Allocation for the Tenant entity using the [Create Allocation endpoint](/infra-controller/rest-api-reference/api-reference/allocation/create-allocation) using the full prefix length.
This will create a Tenant IP Block for each Site IP Block.
- Creating an Allocation will create the Tenant in NICo Core.
- Create a VPC using the [Create VPC endpoint](/infra-controller/rest-api-reference/api-reference/vpc/create-vpc).
- Create a VPC Prefix or Subnet referencing the VPC and a Tenant IP Block
- If the Site supports Native Networking (FNN), create a VPC Prefix using the [Create VPC Prefix endpoint](/infra-controller/rest-api-reference/api-reference/vpc-prefix/create-vpc-prefix). Otherwise the user should create a Subnet
using the [Create Subnet endpoint](/infra-controller/rest-api-reference/api-reference/subnet/create-subnet).
- Create an Operating System using the [Create Operating System endpoint](/infra-controller/rest-api-reference/api-reference/operating-system/create-operating-system) specifying iPXE script and user data.
- Retrieve available Machines on Site using the [Retrieve All Machines endpoint](/infra-controller/rest-api-reference/api-reference/machine/get-all-machine)
- Create an Instance specifying the VPC, VPC Prefix or Subnet, Operating System, and Machine

### Typical API Call Flow for Provider

- Create a Tenant Account using the [Create Tenant Account endpoint](/infra-controller/rest-api-reference/api-reference/tenant-account/create-tenant-account). Provider must know the Tenant org name.
- Once the Tenant has accepted the Tenant Account, the Provider can allocate resources to the Tenant.
- Retrieve available Sites using the [Retrieve All Sites endpoint](/infra-controller/rest-api-reference/api-reference/site/get-all-site) and choose a Site to create resources in.
- Create an Instance Type using the [Create Instance Type endpoint](/infra-controller/rest-api-reference/api-reference/instance-type/create-instance-type)
- Retrieve available Machines on Site using the [Retrieve All Machines endpoint](/infra-controller/rest-api-reference/api-reference/machine/get-all-machine)
- Update a Machine's Instance Type using the [Update Machine endpoint](/infra-controller/rest-api-reference/api-reference/machine/update-machine) or assign multiple Machines to an Instance Type using the
[Create Instance Type/Machine Association endpoint](/infra-controller/rest-api-reference/api-reference/instance-type/create-instance-type-machine-association)
- Create a Compute Allocation for Tenant using the [Create Compute Allocation endpoint](/infra-controller/rest-api-reference/api-reference/allocation/create-allocation) referencing the Instance Type
- Creating any type of Allocation for a Tenant will create the Tenant in NICo Core.
- Create a Network Allocation for Tenant using the [Create Allocation endpoint](/infra-controller/rest-api-reference/api-reference/allocation/create-allocation) referencing a Site IP Block
- Creating a Network Allocation will create a Tenant IP Block

### Typical API Call Flow for Tenant

- Accept the Tenant Account using the [Update Tenant Account endpoint](/infra-controller/rest-api-reference/api-reference/tenant-account/update-tenant-account).
- Retrieve available Sites using the [Retrieve All Sites endpoint](/infra-controller/rest-api-reference/api-reference/site/get-all-site) and choose a Site to create resources in. Any Site where the Tenant
has an Allocation will be returned.
- Create a VPC using the [Create VPC endpoint](/infra-controller/rest-api-reference/api-reference/vpc/create-vpc).
- Retrieve available Site IP Blocks using the [Retrieve All IP Blocks endpoint](/infra-controller/rest-api-reference/api-reference/ip-block/get-all-ipblock). Any IP Block for which the Tenant has received
a Network Allocation from the Provider will be returned.
- Create a VPC Prefix or Subnet referencing the VPC and a Tenant IP Block
- Site supports Native Networking (FNN), create a VPC Prefix using the [Create VPC Prefix endpoint](/infra-controller/rest-api-reference/api-reference/vpc-prefix/create-vpc-prefix)
- Otherwise the user should create a Subnet using the [Create Subnet endpoint](/infra-controller/rest-api-reference/api-reference/subnet/create-subnet)
- Create an Operating System using the [Create Operating System endpoint](/infra-controller/rest-api-reference/api-reference/operating-system/create-operating-system) specifying iPXE script and user data.
- Retrieve available Instance Types using the [Retrieve All Instance Types endpoint](/infra-controller/rest-api-reference/api-reference/instance-type/get-all-instance-type). Any Instance Type for which
the Tenant has received a Compute Allocation from the Provider will be returned.
- Create an Instance specifying the VPC, VPC Prefix or Subnet, Operating System, and Instance Type
2 changes: 2 additions & 0 deletions fern/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.fern/
node_modules/
openapi/ai_examples_override.yml
package*.json
pnpm*.yaml
27 changes: 27 additions & 0 deletions fern/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# NICo Fern Documentation

This directory contains the documentation for the NICo Fern API.

## Getting Started

To develop Fern docs make sure you have the following tools installed:

- Node.js v22 or later
- [Fern CLI](https://buildwithfern.com/learn/cli-api-reference/cli-reference/overview#install-fern-cli)
- [pnpm](https://pnpm.io/installation)

## Local Development

To start a local development server, run the following command:

```bash
fern docs dev
```

This will start a local development server at `http://localhost:3000`.

If you have trouble getting `esbuild` approved to install dependencies, you can try the following:

```bash
PNPM_CONFIG_DANGEROUSLY_ALLOW_ALL_BUILDS=true fern docs dev
```
3 changes: 2 additions & 1 deletion fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ css:
navbar-links:
- type: filled
text: GitHub
href: https://github.com/NVIDIA/infra-controller-core
href: https://github.com/NVIDIA/infra-controller

products:
- display-name: NVIDIA Infra Controller
Expand All @@ -88,6 +88,7 @@ redirects:
destination: "infra-controller/documentation/getting-started/quick-start-guide"
- source: "/infra-controller/documentation/getting-started/building-ni-co-containers"
destination: "/infra-controller/documentation/getting-started/building-nico-containers"

experimental:
mdx-components:
- ./components
Expand Down
1 change: 0 additions & 1 deletion fern/generators.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
api:
specs:
- openapi: ../rest-api/openapi/spec.yaml

Loading