Skip to content

Commit d3ec758

Browse files
committed
fix(mnq): split
1 parent ec9d4d1 commit d3ec758

File tree

11 files changed

+292
-64
lines changed

11 files changed

+292
-64
lines changed

bin/check_anchors_script.ipynb

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 122,
6+
"id": "1f19b09f",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"import os"
11+
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": 123,
16+
"id": "5d9eaf32",
17+
"metadata": {},
18+
"outputs": [],
19+
"source": [
20+
"BASE_DIR = \"../serverless/messaging/how-to/\""
21+
]
22+
},
23+
{
24+
"cell_type": "code",
25+
"execution_count": 124,
26+
"id": "6cb56242",
27+
"metadata": {},
28+
"outputs": [],
29+
"source": [
30+
"def get_markdown_files(base_dir):\n",
31+
" md_files = []\n",
32+
" for root, dirs, files in os.walk(base_dir):\n",
33+
" for file in files:\n",
34+
" if file.endswith(\".mdx\"):\n",
35+
" md_files.append(os.path.join(root, file))\n",
36+
" return md_files"
37+
]
38+
},
39+
{
40+
"cell_type": "code",
41+
"execution_count": 125,
42+
"id": "d9ec5c2b",
43+
"metadata": {},
44+
"outputs": [],
45+
"source": [
46+
"md_files = get_markdown_files(BASE_DIR)"
47+
]
48+
},
49+
{
50+
"cell_type": "code",
51+
"execution_count": 126,
52+
"id": "0de47c9f",
53+
"metadata": {},
54+
"outputs": [
55+
{
56+
"name": "stdout",
57+
"output_type": "stream",
58+
"text": [
59+
"['../serverless/messaging/how-to/create-credentials.mdx', '../serverless/messaging/how-to/monitor-mnq-cockpit.mdx', '../serverless/messaging/how-to/create-manage-queues.mdx', '../serverless/messaging/how-to/get-started.mdx', '../serverless/messaging/how-to/manage-credentials.mdx', '../serverless/messaging/how-to/deactivate-delete-messaging.mdx', '../serverless/messaging/how-to/create-manage-topics.mdx', '../serverless/messaging/how-to/create-manage-subscriptions.mdx', '../serverless/messaging/how-to/index.mdx']\n"
60+
]
61+
}
62+
],
63+
"source": [
64+
"print(md_files)"
65+
]
66+
},
67+
{
68+
"cell_type": "code",
69+
"execution_count": 127,
70+
"id": "cb145406",
71+
"metadata": {},
72+
"outputs": [],
73+
"source": [
74+
"def clean_string(input_string):\n",
75+
" # Remove everything before the first '/'\n",
76+
" first_slash_index = input_string.find('/')\n",
77+
" if first_slash_index != -1:\n",
78+
" cleaned_string = input_string[first_slash_index + 1:] # Get the substring after the first '/'\n",
79+
" else:\n",
80+
" cleaned_string = input_string # If '/' not found, use the original string\n",
81+
" \n",
82+
" # Remove all occurrences of '.mdx'\n",
83+
" cleaned_string = cleaned_string.replace('.mdx', '')\n",
84+
"\n",
85+
" return cleaned_string"
86+
]
87+
},
88+
{
89+
"cell_type": "code",
90+
"execution_count": 136,
91+
"id": "996ea396",
92+
"metadata": {},
93+
"outputs": [
94+
{
95+
"name": "stdout",
96+
"output_type": "stream",
97+
"text": [
98+
"Checking file ../serverless/messaging/how-to/create-credentials.mdx\n",
99+
"Checking file ../serverless/messaging/how-to/monitor-mnq-cockpit.mdx\n",
100+
"Checking file ../serverless/messaging/how-to/create-manage-queues.mdx\n",
101+
"Checking file ../serverless/messaging/how-to/get-started.mdx\n",
102+
"Checking file ../serverless/messaging/how-to/manage-credentials.mdx\n",
103+
"Checking file ../serverless/messaging/how-to/deactivate-delete-messaging.mdx\n",
104+
"Checking file ../serverless/messaging/how-to/create-manage-topics.mdx\n",
105+
"Checking file ../serverless/messaging/how-to/create-manage-subscriptions.mdx\n",
106+
"Checking file ../serverless/messaging/how-to/index.mdx\n"
107+
]
108+
}
109+
],
110+
"source": [
111+
"## FIND HEADERS\n",
112+
"\n",
113+
"\n",
114+
"\n",
115+
"for md_file in md_files:\n",
116+
" \n",
117+
" headers_in_file = []\n",
118+
" anchor_links_in_file = []\n",
119+
" \n",
120+
" with open(md_file, 'r', encoding='utf-8') as file:\n",
121+
" lines = file.readlines()\n",
122+
" filename = str(md_file)\n",
123+
" print(\"Checking file\", filename)\n",
124+
" \n",
125+
" for line in lines:\n",
126+
" line = line.strip()\n",
127+
" \n",
128+
" ## Extract headers in anchor form\n",
129+
" if line.startswith(\"##\"):\n",
130+
" header = line.lstrip('#').strip()\n",
131+
" header = header.lower().replace(' ', '-').replace('.', '').replace('\\'', '')\n",
132+
" header = \"#\" + header\n",
133+
" # rebuild anchor link so its a complete link\n",
134+
" header = filename + header\n",
135+
" header = clean_string(header)\n",
136+
" headers_in_file.append(header)\n",
137+
"\n",
138+
" ## Extract internal links to anchors on the page\n",
139+
" if '](#' in line and ')' in line:\n",
140+
" # Extract text inside the brackets [] and the link inside parentheses ()\n",
141+
" start_link = line.find('](#') + 2\n",
142+
" sep = ')'\n",
143+
" anchor_link = line[start_link:].split(sep,1)[0]\n",
144+
" # rebuild anchor link so its a complete link\n",
145+
" anchor_link = filename + anchor_link\n",
146+
" anchor_link = clean_string(anchor_link)\n",
147+
" anchor_links_in_file.append(anchor_link)\n",
148+
" \n",
149+
" ## Extract internal links to anchors on other doc pages\n",
150+
" if '](/' in line and ')' in line:\n",
151+
" #continue here\n",
152+
"\n",
153+
" ## Check whether there are links that aren't anchors in the file\n",
154+
" for anchor_link in anchor_links_in_file:\n",
155+
" if anchor_link not in headers_in_file:\n",
156+
" print(\"In file\", [md_file], \"there is an internal link to non-existant anchor:\", anchor_link)\n"
157+
]
158+
},
159+
{
160+
"cell_type": "code",
161+
"execution_count": 134,
162+
"id": "18a22ba3",
163+
"metadata": {},
164+
"outputs": [
165+
{
166+
"name": "stdout",
167+
"output_type": "stream",
168+
"text": [
169+
"[]\n"
170+
]
171+
}
172+
],
173+
"source": [
174+
"print(headers_in_file)"
175+
]
176+
},
177+
{
178+
"cell_type": "code",
179+
"execution_count": null,
180+
"id": "d781eb6d",
181+
"metadata": {},
182+
"outputs": [],
183+
"source": []
184+
},
185+
{
186+
"cell_type": "code",
187+
"execution_count": null,
188+
"id": "b8933c87",
189+
"metadata": {},
190+
"outputs": [],
191+
"source": []
192+
}
193+
],
194+
"metadata": {
195+
"kernelspec": {
196+
"display_name": "Python 3 (ipykernel)",
197+
"language": "python",
198+
"name": "python3"
199+
},
200+
"language_info": {
201+
"codemirror_mode": {
202+
"name": "ipython",
203+
"version": 3
204+
},
205+
"file_extension": ".py",
206+
"mimetype": "text/x-python",
207+
"name": "python",
208+
"nbconvert_exporter": "python",
209+
"pygments_lexer": "ipython3",
210+
"version": "3.10.9"
211+
}
212+
},
213+
"nbformat": 4,
214+
"nbformat_minor": 5
215+
}

serverless/messaging/how-to/create-credentials.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Credentials for NATS accounts are not granular: they necessarily give full read
3232

3333
2. Use the drop-down menu to select the [region](/serverless/messaging/concepts/#region) of the NATS account for which you want to create credentials.
3434

35+
this is good
36+
3537
3. Click **NATS**. The list of your NATS accounts in the pre-selected region displays.
3638

3739
4. Click the NATS account you want to generate credentials for. The account's **Overview** page displays.

serverless/messaging/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
meta:
3-
title: Messaging and Queuing Documentation
4-
description: Explore Scaleway Messaging and Queuing. Simplify your microservice workflows with scalable, reliable, and cost-effective message handling solutions.
3+
title: NATS, Queues, and Topics and Events Documentation
4+
description: Explore Scaleway NATS, Queues, and Topics and Events. Simplify your microservice workflows with scalable, reliable, and cost-effective message handling solutions.
55
---
66

77
<Alert
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
meta:
3-
title: Messaging and Queuing - Additional content
4-
description: Messaging and Queuing additional content
3+
title: NATS, Queues, and Topics and Events - Additional content
4+
description: NATS, Queues, and Topics and Events additional content
55
content:
6-
h1: Messaging and Queuing - Additional content
7-
paragraph: Messaging and Queuing additional content
6+
h1: NATS, Queues, and Topics and Events - Additional content
7+
paragraph: NATS, Queues, and Topics and Events additional content
88
---
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
22
meta:
3-
title: Messaging and Queuing Limitations
4-
description: Learn about the current limitations of Scaleway Messaging and Queuing
3+
title: NATS, Queues, and Topics and Events Limitations
4+
description: Learn about the current limitations of Scaleway NATS, Queues, and Topics and Events
55
content:
66
h1: Limitations
7-
paragraph: Learn about the current limitations of Scaleway Messaging and Queuing
7+
paragraph: Learn about the current limitations of Scaleway NATS, Queues, and Topics and Events
88
tags: messaging limitations space size storage payload max-streams max-consumers max-subscribers max-topics max-queues visibility-timeout
99
dates:
10-
validation: 2024-04-19
10+
validation: 2024-10-18
1111
posted: 2023-01-04
1212
categories:
1313
- serverless
1414
---
1515

1616
## Usage limits
1717

18-
For the usage limits that apply when using Messaging and Queuing, see the dedicated section on our [Organization quotas](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#messaging-and-queuing) page. Limits (quotas) apply to, for example, the maximum number of queues, streams, topics and consumers/subscribers, as well as to message retention duration and storage.
18+
For the usage limits that apply when using Scaleway NATS, Queues, and Topics and Events, see the dedicated section on our [Organization quotas](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#messaging-and-queuing) page. Limits (quotas) apply to, for example, the maximum number of queues, streams, topics and consumers/subscribers, as well as to message retention duration and storage.
1919

2020
## VPC
2121

22-
Messaging and Queuing is not currently compatible with [Scaleway VPC](https://www.scaleway.com/en/docs/network/vpc/quickstart/).
22+
NATS, Queues, and Topics and Events are not currently compatible with [Scaleway VPC](https://www.scaleway.com/en/docs/network/vpc/quickstart/).

serverless/messaging/reference-content/migration.mdx

Lines changed: 0 additions & 1 deletion
This file was deleted.

serverless/messaging/reference-content/nats-overview.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tags: nats overview neural-autonomic-transport-system publish-subscribe jetstre
99
categories:
1010
- serverless
1111
dates:
12-
validation: 2024-04-09
12+
validation: 2024-10-18
1313
posted: 2023-01-04
1414
---
1515

@@ -19,21 +19,25 @@ NATS (**N**eural **A**utonomic **T**ransport **S**ystem) is a messaging system t
1919

2020
NATS is a [Cloud Native Computing Foundation](https://www.cncf.io/) project supported by a strong community, and can also be integrated in a Kubernetes cluster.
2121

22+
## Scaleway NATS
23+
24+
Scaleway NATS is a managed messaging service that enable seamless communication between distributed applications, which leverages the NATS protocol.
25+
2226
## NATS accounts
2327

2428
You can easily create a NATS account from the [Scaleway console](https://console.scaleway.com/), via the [Scaleway API](https://www.scaleway.com/en/developers/api/messaging-and-queuing/nats-api/) or via [Terraform](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/guides/mnq_with_nats_terraform_provider).
2529

2630
## NATS credentials
2731

28-
When you create your NATS account, you next need to [create credentials](/serverless/messaging/how-to/create-credentials/). On the NATS side, these credentials are the equivalent of a 'user'. We configured Scaleway Messaging and Queuing to use the most secure connection type offered by NATS: [NKeys](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth). NKeys are a public-key signature system based on [Ed25519](https://ed25519.cr.yp.to/).
32+
When you create your NATS account, you next need to [create credentials](/serverless/messaging/how-to/create-credentials/). On the NATS side, these credentials are the equivalent of a 'user'. We use the most secure connection type offered by NATS: [NKeys](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth). NKeys are a public-key signature system based on [Ed25519](https://ed25519.cr.yp.to/).
2933

3034
Your credentials are provided in the form of a downloadable `.creds` file. Each set of credentials gives you full access to your NATS account, but does not enable you to generate new users with specific rights or fine-grained permissions.
3135

3236
## Further actions: NATS CLI & NATS SDK
3337

3438
All further actions related to publishing, processing and managing messages, subjects and streams can be done via one of the tools described below.
3539

36-
Note that the Scaleway Messaging and Queuing NATS server is configured with TLS, and as such will require all clients to connect with TLS. In the case of the NATS SDK however, the SDK abstracts this and handles the TLS connection itself.
40+
Note that the Scaleway NATS server is configured with TLS, and as such will require all clients to connect with TLS. In the case of the NATS SDK however, the SDK abstracts this and handles the TLS connection itself.
3741

3842
### NATS CLI
3943

@@ -65,7 +69,7 @@ The following documents may help you get started using the above SDKs:
6569
- [Python: Using Jetstream](https://github.com/nats-io/nats.py#jetstream)
6670
- [Go: Using Jetstream](https://github.com/nats-io/nats.go#jetstream-basic-usage)
6771

68-
The main difference you will find between the standard NATS documentation and Scaleway Messaging and Queuing is that we require you to provide a specific NATS URL and credentials to access the service. Refer to our [developers documentation](https://www.scaleway.com/en/developers/api/messaging-and-queuing/nats-api/) for further information.
72+
The main difference you will find between the standard NATS documentation and Scaleway NATS is that we require you to provide a specific NATS URL and credentials to access the service. Refer to our [developers documentation](https://www.scaleway.com/en/developers/api/messaging-and-queuing/nats-api/) for further information.
6973

7074
## NATS resources
7175

@@ -74,4 +78,4 @@ The main difference you will find between the standard NATS documentation and Sc
7478
- [Publish/Subscribe in pure NATS (no message retention)](https://docs.nats.io/nats-concepts/core-nats/pubsub/pubsub_walkthrough)
7579
- [Introduction to JetStream](https://docs.nats.io/nats-concepts/jetstream)
7680
- [Learn NATS by Example](https://natsbyexample.com/)
77-
- [How to use Scaleway Messaging and Queuing with the Terraform NATS Jetstream provider](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/guides/mnq_with_nats_terraform_provider)
81+
- [How to use Scaleway NATS with the Terraform NATS Jetstream provider](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/guides/mnq_with_nats_terraform_provider)

0 commit comments

Comments
 (0)