Skip to content

Commit

Permalink
Merge branch 'main' into file-reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
shainaraskas committed May 23, 2024
2 parents bc9940b + 9dec5b8 commit f0c806c
Show file tree
Hide file tree
Showing 9 changed files with 415 additions and 51 deletions.
17 changes: 16 additions & 1 deletion serverless/nav/serverless-general.docnav.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
{
"pageId": "whatIsServerlessElastic"
},
{
"pageId": "serverlessSignUpTrial"
},
{
"pageId": "serverlessGeneralManageOrganization",
"items": [
Expand All @@ -23,7 +26,13 @@
]
},
{
"pageId": "serverlessGeneralManageProject"
"label": "Manage your projects",
"pageId": "serverlessGeneralManageProject",
"items": [
{
"id": "serverlessGeneralManageProjectRestAPI"
}
]
},
{
"label": "Manage billing",
Expand All @@ -37,9 +46,15 @@
},
{
"id": "serverlessGeneralBillingHistory"
},
{
"id": "serverlessBilling"
}
]
},
{
"pageId": "ServerlessServiceStatus"
},
{
"pageId": "serverlessGeneralUserProfile"
}
Expand Down
45 changes: 45 additions & 0 deletions serverless/pages/manage-billing-pricing-model.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
id: serverlessBilling
slug: /serverless/general/serverless-billing
title: Serverless billing dimensions
description: Understand how usage affects serverless pricing.
tags: [ 'serverless', 'general', 'billing', 'pricing model' ]
---

<DocBadge template="technical preview" />

Elastic Cloud serverless billing is based on your actual usage across these dimensions:

* <DocLink id="serverlessBilling" section="offerings">Offerings</DocLink>
* <DocLink id="serverlessBilling" section="add-ons">Add-ons</DocLink>


<div id="offerings"></div>

## Offerings

To learn about billing dimensions for specific offerings, refer to:

* <DocLink id="serverlessElasticsearchBilling"/>
* <DocLink id="serverlessObservabilityBilling"/>
* <DocLink id="serverlessSecurityBilling"/>

<div id="add-ons"></div>

## Add-ons

### Data out

_Data out_ accounts for all of the traffic coming out of a serverless project.
This includes search results, as well as monitoring data sent from the project.
The same rate applies regardless of the destination of the data, whether to the internet,
another region, or a cloud provider account in the same region.
Data coming out of the project through AWS PrivateLink, GCP Private Service Connect,
or Azure Private Link is also considered data out.


### Support

If your subscription level is Standard, there is no separate charge for Support reflected on your bill.
If your subscription level is Gold, Platinum, or Enterprise, a charge is made for Support as a percentage (%) of the ECUs.
To find out more about our support levels, go to https://www.elastic.co/support.
4 changes: 3 additions & 1 deletion serverless/pages/manage-billing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ tags: [ 'serverless', 'general', 'billing', 'overview' ]

<DocBadge template="technical preview" />

<DocCallOut title="You will not be charged for usage for serverless projects during this preview. Detailed pricing information will be made available in the near future." />
<DocCallOut color="warning" title="Serverless billing starts June 1, 2024">
Until May 31, 2024, your serverless consumption will not incur any charges, but will be visible along with your total Elastic Cloud consumption on the [Billing Usage page](https://cloud.elastic.co/billing/usage?). Unless you are in a trial period, usage on or after June 1, 2024 will be deducted from your existing Elastic Cloud credits or be billed to your active payment method.
</DocCallOut>

You can manage the billing details of your organization directly from the Elastic Cloud console.

Expand Down
170 changes: 170 additions & 0 deletions serverless/pages/manage-your-project-rest-api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
---
id: serverlessGeneralManageProjectRestAPI
slug: /serverless/general/manage-project-with-api
title: Using the Project Management REST API
description: Manage your organization's serverless projects using the REST API.
tags: [ 'serverless', 'project', 'manage', 'rest', 'api']
---

<DocBadge template="technical preview" />

You can manage serverless projects using Elastic Cloud's [Project Management](https://docs.elastic.co/api-reference/project-management) REST API. This API allows you to create, update, and delete projects, as well as manage project features and usage.

<DocCallOut color="success" title="Tip">
More APIs let you interact with data, capabilities, and settings inside of specific projects. Refer to the [Serverless API reference page](https://docs.elastic.co/api-reference).

</DocCallOut>

## API Principles

- The Elastic Cloud REST API is built following REST principles:
- Resources (such as projects) are represented as URIs.
- Standard HTTP response codes and verbs are used (GET, POST, PUT, PATCH and DELETE).
- API calls are stateless. Every request that you make happens in isolation from other calls and must include all the information necessary to fulfill the request.
- JSON is the data interchange format.

## Authentication

API keys are used to authenticate requests to the Elastic Cloud REST API.
Learn how to [create API keys](https://www.elastic.co/guide/en/cloud/current/ec-api-authentication.html).

You must provide the API key for all API requests in the `Authorization` header as follows:

```bash
"Authorization: ApiKey $API_KEY"
```

For example, if you interact with the API using the `curl` command:

```bash
curl -H "Authorization: ApiKey essu_..." https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch
```

## Open API Specification

The Project Management API is documented using the [OpenAPI Specification](https://en.wikipedia.org/wiki/OpenAPI_Specification). The current supported version of the specification is `3.0`.

For details, check the [API reference](https://docs.elastic.co/api-reference) or download the [OpenAPI Specification](https://docs.elastic.co/api-reference/openapi/serverless-project-api.yml).

This specification can be used to generate client SDKs, or on tools that support it, such as the [Swagger Editor](https://editor.swagger.io).


## Examples

To try the examples in this section:

1. [Create an API key](https://www.elastic.co/guide/en/cloud/current/ec-api-authentication.html).

2. Store the generated API key as an environment variable so that you don't need to specify it again for each request:

```bash
export API_KEY="YOUR_GENERATED_API_KEY"
```

### Create a serverless Elasticsearch project

```bash
curl -H "Authorization: ApiKey $API_KEY" \
-H "Content-Type: application/json" \
"https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch" \
-XPOST --data '{
"name": "My project", [^1]
"region_id": "aws-us-east-1" [^2]
}'
```
[^1]: Replace **`My project`** with a more descriptive name in this call.
[^2]: You can <DocLink id="serverlessGeneralManageProjectRestAPI" text="obtain a list of available regions" section="list-available-regions" />.

The response from the create project request will include the created project details, such as the project ID,
the credentials to access the project, and the endpoints to access different apps such as Elasticsearch and Kibana.

Example of `Create project` response:

```json
{
"id": "cace8e65457043698ed3d99da2f053f6",
"endpoints": {
"elasticsearch": "https://sample-project-c990cb.es.us-east-1.aws.elastic.cloud",
"kibana": "https://sample-project-c990cb-c990cb.kb.us-east-1.aws.elastic.cloud"
},
"credentials": {
"username": "admin",
"password": "abcd12345"
}
(...)
}
```

You can store the project ID as an environment variable for the next requests:

```bash
export PROJECT_ID=cace8e65457043698ed3d99da2f053f6
```

### Get project

You can retrieve your project details through an API call:

```bash
curl -H "Authorization: ApiKey $API_KEY" \
"https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch/${PROJECT_ID}"
```

### Get project status

The 'status' endpoint indicates whether the project is initialized and ready to be used. In the response, the project's `phase` will change from "initializing" to "initialized" when it is ready:
```bash
curl -H "Authorization: ApiKey $API_KEY" \
"https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch/${PROJECT_ID}/status"
```
Example response:
```json
{
"phase":"initializing"
}
```
### Reset Credentials
If you lose the credentials provided at the time of the project creation, you can reset the credentials by using the following endpoint:
```bash
curl -H "Authorization: ApiKey $API_KEY" \
-XPOST \
"https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch/${PROJECT_ID}/_reset-credentials"
```
### Delete Project
You can delete your project via the API:
```bash
curl -XDELETE -H "Authorization: ApiKey $API_KEY" \
"https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch/${PROJECT_ID}"
```
### Update Project
You can update your project using a PATCH request. Only the fields included in the body of the request will be updated.
```bash
curl -H "Authorization: ApiKey $API_KEY" \
-H "Content-Type: application/json" \
"https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch/${PROJECT_ID}" \
-XPATCH --data '{
"name": "new name",
"alias": "new-project-alias"
}'
```
### List available regions
You can obtain the list of regions where projects can be created using the API:
```bash
curl -H "Authorization: ApiKey $API_KEY" \
"https://api.elastic-cloud.com/api/v1/serverless/regions"
```
Loading

0 comments on commit f0c806c

Please sign in to comment.