Skip to content

Commit ae50039

Browse files
committed
Update wasm functions docs for v0.4 plugin
Signed-off-by: Caleb Schoepp <[email protected]>
1 parent 6d55797 commit ae50039

15 files changed

+251
-91
lines changed

content/wasm-functions/app-linking.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
title = "Link Applications"
2+
template = "functions_main"
3+
date = "2025-01-16T00:22:56Z"
4+
enable_shortcodes = true
5+
6+
---
7+
- [Upgrade Your Application](#upgrade-your-application)
8+
- [Specifying Variables](#specifying-variables)
9+
- [Next Steps](#next-steps)
10+
TODO
11+
12+
Your local workspace can be linked to an application running in _Fermyon Wasm Functions_. This is a convenience so that you don't always have to specify the `--app-name` when running commands.
13+
14+
{{ details "What is a workspace?" "A workspace is a directory on your local machine that contains the Spin application code and manifest file. It is where you develop and test your application before deploying it to _Fermyon Wasm Functions_. Any child directory of where the Spin manifest is located is also considered part of the workspace." }}
15+
16+
## Inspecting Your Workspace
17+
18+
You can see information about the current workspace by navigating to the directory where your Spin application is located and running the following command:
19+
20+
<!-- @selectiveCpy -->
21+
22+
```console
23+
$ spin aka info
24+
```
25+
26+
Among other things this will tell if your workspace is linked to an application on _Fermyon Wasm Functions_ and if so which one.
27+
28+
<!-- @nocpy -->
29+
30+
```console
31+
Auth Info
32+
Accounts: your-account
33+
Workspace Info
34+
Root dir: /Users/user/src/hello-spin
35+
Linked app: hello-spin
36+
```
37+
38+
If you ran `spin aka deploy` for the first time it will have automatically linked your workspace to the application you just deployed.
39+
40+
## Linking Your Workspace
41+
42+
If your workspace is not linked to an application, you can link it by running the following command:
43+
44+
<!-- @selectiveCpy -->
45+
46+
```console
47+
$ spin aka link
48+
```
49+
50+
This command will prompt you to select an application to link to. You can also specify the application name directly:
51+
52+
<!-- @selectiveCpy -->
53+
54+
```console
55+
$ spin aka link --app-name <app-name>
56+
```
57+
58+
This will link your workspace to the specified application. You can verify that the workspace is linked by running the `spin aka info` command again.
59+
60+
## Running Commands
61+
62+
Now anytime you run a command in this workspace it will automatically assume that you want to run it against the linked application. For example if you run `spin aka deploy` it will upgrade that application. If you run `spin aka logs` it will show the logs for that application and so on.
63+
64+
## Unlinking Your Workspace
65+
66+
If you wish to unlink your workspace from the currently linked application, you can do so by running the following command:
67+
68+
<!-- @selectiveCpy -->
69+
70+
```console
71+
$ spin aka unlink
72+
```
73+
74+
You can run `spin aka info` again to verify that the workspace is no longer linked to an application.
75+
76+
{{ details "Note" "Unlinking your workspace does not delete the application on _Fermyon Wasm Functions_. It simply removes the link between your local workspace and the application." }}
77+
78+
## Next Steps
79+
80+
- [List and Inspect Applications](list-and-inspect)

content/wasm-functions/delete.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ It’s easy to delete an Spin application from _Fermyon Wasm Functions_. This ca
1212

1313
## Find the Application You Want to Delete
1414

15-
First, you may want to find the application you want to delete, you could use the `spin aka apps list` command to retrieve a list of all Spin applications deployed to your _Fermyon Wasm Functions_ account:
15+
First, you may want to find the application you want to delete, you could use the `spin aka app list` command to retrieve a list of all Spin applications deployed to your _Fermyon Wasm Functions_ account:
1616

1717
<!-- @selectiveCpy -->
1818

1919
```console
20-
$ spin aka apps list
20+
$ spin aka app list
2121
```
2222

23-
<!-- @nocpy -->
23+
<!-- @nocpy -->
2424

2525
```console
2626
hello-fermyon-wasm-functions
@@ -30,15 +30,15 @@ query-external-database
3030

3131
## Delete Your Application
3232

33-
Use the `spin aka apps delete` command to delete a particular Spin application from your _Fermyon Wasm Functions_ account:
33+
Use the `spin aka app delete` command to delete a particular Spin application from your _Fermyon Wasm Functions_ account:
3434

3535
<!-- @selectiveCpy -->
3636

3737
```console
38-
$ spin aka apps delete --name validate-jwt-tokens
38+
$ spin aka app delete --app-name validate-jwt-tokens
3939
```
4040

41-
The `spin aka apps` command, will ask you to confirm deleting the application of choice. Once confirmed, the application will be removed from your _Fermyon Wasm Functions_ account.
41+
The `spin aka app delete` command, will ask you to confirm deleting the application of choice. Once confirmed, the application will be removed from your _Fermyon Wasm Functions_ account.
4242

4343
<!-- @nocpy -->
4444

@@ -51,4 +51,4 @@ That’s all about deleting your Spin Application from _Fermyon Wasm Functions_!
5151

5252
## Next Steps
5353

54-
- Make sure to check the [FAQ and Known Limitations](faq) article
54+
- Make sure to check the [FAQ and Known Limitations](faq) article

content/wasm-functions/deploy.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,15 @@ $ spin aka deploy
8484
<!-- @nocpy -->
8585

8686
```console
87-
App 'myapp' initialized successfully.
88-
Deploying application to Fermyon Wasm Functions on Akamai..
89-
Waiting for application to be ready... ready
90-
91-
View application: https://c8769081-7ae5-4041-a10f-61d344a67da2.aka.fermyon.tech/
87+
Name of new app: myapp
88+
Creating new app myapp in account your-account
89+
Note: If you would instead like to deploy to an existing app, cancel this deploy and link this workspace to the app with `spin aka app link`
90+
OK to continue? yes
91+
Workspace linked to app myapp
92+
Waiting for app to be ready... ready
93+
94+
App Routes:
95+
- myapp: https://ec8a19d8-6d10-4056-bb69-cc864306b489.aka.fermyon.tech (wildcard)
9296
```
9397

9498
### Specifying Variables
@@ -115,10 +119,12 @@ $ spin aka deploy --variable compression_level=3
115119
<!-- @nocpy -->
116120

117121
```console
118-
Deploying application to Fermyon Wasm Functions on Akamai..
119-
Waiting for application to be ready... ready
122+
Deploying updated version of app my-app in account your-account (version 1 → 2)
123+
OK to continue? yes
124+
Waiting for app to be ready... ready
120125

121-
View application: https://c8769081-7ae5-4041-a10f-61d344a67da2.aka.fermyon.tech/
126+
App Routes:
127+
- my-app: https://ec8a19d8-6d10-4056-bb69-cc864306b489.aka.fermyon.tech (wildcard)
122128
```
123129

124130
---

content/wasm-functions/get-logs.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,18 @@ enable_shortcodes = true
88
- [Retrieving Logs of Your Application](#retrieving-logs-of-your-application)
99
- [Next Steps](#next-steps)
1010

11-
Retrieving logs of your Spin applications at runtime is crucial to understand runtime behavior and for gathering insights.
11+
Retrieving logs of your Spin applications at runtime is crucial to understand runtime behavior and for gathering insights.
1212

1313
## Retrieving Logs of Your Application
1414

1515
Use the `spin aka logs` command, to retrieve logs of your Spin application deployed to _Fermyon Wasm Functions_.
1616

17-
If you invoke the command from within the directory of your Spin application (the directory in which your `spin.toml` file is located), it will - by default - load all logs of the current Spin application.
18-
19-
If the command is invoked outside the application directory, or if you want to receive log messages of a particular Spin application running on _Fermyon Wasm Functions_, you must explicitly specify the name of the application using the `--app` flag:
17+
By default it will provide logs for the application that your workspace is [linked to](app-linking). If your workspace is not linked to an application, you can specify the application name using the `--app-name` flag.
2018

2119
<!-- @selectiveCpy -->
2220

2321
```console
24-
$ spin aka logs --app hello-fermyon-wasm-functions
22+
$ spin aka logs --app-name hello-fermyon-wasm-functions
2523
```
2624

2725
The `spin aka logs` command, will print all log messages to `stdout` as shown here:
@@ -35,8 +33,8 @@ The `spin aka logs` command, will print all log messages to `stdout` as shown he
3533
2025-01-16 13:32:04 [hello-fermyon-wasm-functions] 2025/01/16 13:31:56 INFO POST https://11077e3b-d632-4df3-921f-f7ebefb9aaca.aka.fermyon.tech/greet: Handled by handle_greet func
3634
```
3735

38-
The log messages shown above have been generated using the [`log/slog` package](https://go.dev/blog/slog) by a Spin application written in Go. Technically, everything your Spin application writes to `stdout` and `stderr` will be captured by _Fermyon Wasm Functions_ and made accessible via the `spin aka logs` command.
36+
The log messages shown above have been generated using the [`log/slog` package](https://go.dev/blog/slog) by a Spin application written in Go. Technically, everything your Spin application writes to `stdout` and `stderr` will be captured by _Fermyon Wasm Functions_ and made accessible via the `spin aka logs` command.
3937

4038
## Next Steps
4139

42-
- [Delete an application](delete)
40+
- [Delete an application](delete)

content/wasm-functions/list-and-inspect.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ This articles illustrates how to list and inspect Spin applications deployed to
1212

1313
## List Your Applications
1414

15-
To list all Spin applications deployed to your _Fermyon Wasm Functions_ account, use the `spin aka apps list` command as shown in the following snippet:
15+
To list all Spin applications deployed to your _Fermyon Wasm Functions_ account, use the `spin aka app list` command as shown in the following snippet:
1616

1717
<!-- @selectiveCpy -->
1818

1919
```console
20-
$ spin aka apps list
20+
$ spin aka app list
2121
```
2222

2323
Depending on which apps you have deployed to your _Fermyon Wasm Functions_ account, the actual output will differ from the output shown here.
@@ -30,12 +30,12 @@ validate-jwt-tokens
3030
query-external-database
3131
```
3232

33-
By default, `spin aka apps list` will print the name of each Spin application deployed to your _Fermyon Wasm Functions_ account as plain text. Alternatively, you could add the `--format` flag and change the output format to `JSON`:
33+
By default, `spin aka app list` will print the name of each Spin application deployed to your _Fermyon Wasm Functions_ account as plain text. Alternatively, you could add the `--format` flag and change the output format to `JSON`:
3434

3535
<!-- @selectiveCpy -->
3636

3737
```console
38-
$ spin aka apps list --format json
38+
$ spin aka app list --format json
3939
```
4040

4141
This time, you'll receive the list of Spin applications as `JSON` array:
@@ -61,19 +61,22 @@ query-external-database(b6cc1427-392c-4f96-859d-bb4d0adc216c)
6161

6262
## Inspecting an Application
6363

64-
Use the `spin aka apps info` command, to gather fundamental information about a Spin application deployed to your _Fermyon Wasm Functions_ account. The command requires the name of the desired application to be passed as an argument to the `--app` flag:
64+
Use the `spin aka app status` command, to gather fundamental information about a Spin application deployed to your _Fermyon Wasm Functions_ account. The command will provide the status of the application your workspace is [linked to](app-linking). Alternatively, you can specify a specific app with the `--app-name` flag.
6565

6666
<!-- @selectiveCpy -->
6767

6868
```console
69-
$ spin aka apps info --name hello-fermyon-wasm-functions
69+
$ spin aka app status
7070
```
7171

7272
<!-- @nocpy -->
7373

7474
```console
7575
Name: hello-fermyon-wasm-functions
76-
URL: https://25a5fd1e-d476-40fd-bc54-6cee0e846540.aka.fermyon.tech/
76+
ID: ec8a19d8-6d10-4056-bb69-cc864306b489
77+
URL: https://ec8a19d8-6d10-4056-bb69-cc864306b489.aka.fermyon.tech
78+
Created at: 2025-05-23 16:11:49 UTC
79+
Invocations: 229 in the past 7 days
7780
```
7881

7982
As you can see, you'll also receive the public origin, which could be used to access the Spin application. Similar to the `spin aka apps list` command, you could add the `--format json` flag to make the command return fundamental information about a particular application as `JSON` object:
@@ -87,11 +90,16 @@ $ spin aka apps info --name hello-fermyon-wasm-functions --format json
8790

8891
```json
8992
{
93+
"id": "ec8a19d8-6d10-4056-bb69-cc864306b489",
9094
"name": "hello-fermyon-wasm-functions",
91-
"url": "https://25a5fd1e-d476-40fd-bc54-6cee0e846540.aka.fermyon.tech/"
95+
"urls": [
96+
"https://ec8a19d8-6d10-4056-bb69-cc864306b489.aka.fermyon.tech"
97+
],
98+
"created_at": "2025-05-23 16:11:49 UTC",
99+
"invocations": "229 in the past 7 days"
92100
}
93101
```
94102

95103
## Next Steps
96104

97-
- [Get Application Logs](get-logs)
105+
- [Get Application Logs](get-logs)

content/wasm-functions/property-manager-integration.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,15 @@ The `spin aka deploy` command will generate an output similar to the one shown b
6969
<!-- @noCpy -->
7070

7171
```console
72-
App 'hello-fermyon-wasm-functions' initialized successfully.
73-
Waiting for application to be ready... ready
74-
75-
View application: https://27383f31-adbe-482f-a859-2ce9aad02c4f.aka.fermyon.tech/
72+
Name of new app: hello-fermyon-wasm-functions
73+
Creating new app hello-fermyon-wasm-functions in account your-account
74+
Note: If you would instead like to deploy to an existing app, cancel this deploy and link this workspace to the app with `spin aka app link`
75+
OK to continue? yes
76+
Workspace linked to app hello-fermyon-wasm-functions
77+
Waiting for app to be ready... ready
78+
79+
App Routes:
80+
- hello-fermyon-wasm-functions: https://ec8a19d8-6d10-4056-bb69-cc864306b489.aka.fermyon.tech (wildcard)
7681
```
7782

7883
Copy the URL from the output shown in your terminal, we'll need it in a second to configure the Akamai Property.

content/wasm-functions/querying-linode-mysql.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,10 +488,15 @@ The above deploy command will produce similar output to the following:
488488
<!-- @nocpy -->
489489

490490
```bash
491-
App 'linode-mysql' initialized successfully.
492-
Waiting for application to be ready... ready
493-
494-
View application: https://8d332abd-5f9e-4943-aaaa-60c219213410.aka.fermyon.tech/
491+
Name of new app: linode-mysql
492+
Creating new app linode-mysql in account your-account
493+
Note: If you would instead like to deploy to an existing app, cancel this deploy and link this workspace to the app with `spin aka app link`
494+
OK to continue? yes
495+
Workspace linked to app linode-mysql
496+
Waiting for app to be ready... ready
497+
498+
App Routes:
499+
- linode-mysql: https://ec8a19d8-6d10-4056-bb69-cc864306b489.aka.fermyon.tech (wildcard)
495500
```
496501

497502
Finally, you can use `curl` to interact with the application you just deployed to _Fermyon Wasm Functions_. First, let's send a `GET` request to the `/products` endpoint to retrieve a list of all products:

content/wasm-functions/querying-postgresql.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,15 @@ The above deploy command will produce similar output to the following:
440440
<!-- @nocpy -->
441441

442442
```bash
443-
Waiting for application to be ready... ready
444-
Application deployed to https://rust-pg-12345678.aka.fermyon.tech/
445-
View application: https://rust-pg-12345678.aka.fermyon.tech/
443+
Name of new app: hello-postgresql
444+
Creating new app hello-postgresql in account your-account
445+
Note: If you would instead like to deploy to an existing app, cancel this deploy and link this workspace to the app with `spin aka app link`
446+
OK to continue? yes
447+
Workspace linked to app hello-postgresql
448+
Waiting for app to be ready... ready
449+
450+
App Routes:
451+
- hello-postgresql: https://ec8a19d8-6d10-4056-bb69-cc864306b489.aka.fermyon.tech (wildcard)
446452
```
447453

448454
Finally, you can use `curl` to interact with the application you just deployed to _Fermyon Wasm Functions_. First, let's send a `GET` request to the `/products` endpoint to retrieve a list of all products:

content/wasm-functions/quickstart.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ $ spin aka login
509509
<!-- @nocpy -->
510510

511511
```console
512-
Go to https://login.neutrino.fermyon.computer/realms/neutrino/device?user_code=BB-AA
512+
Go to https://login.infra.fermyon.tech/realms/neutrino/device?user_code=BB-AA
513513
and follow the prompts.
514514

515515
Don't worry, we'll wait here for you. You got this.
@@ -527,7 +527,7 @@ Finally, let's deploy the application to _Fermyon Wasm Functions_:
527527
$ spin aka deploy
528528
```
529529

530-
The `spin` command will run using the Spin binary in your system path and read the Spin application definition file `spin.toml` in the current (`hello-spin`) directory to know what application to deploy.
530+
The `spin` command will run using the Spin binary in your system path and read the Spin application definition file `spin.toml` in the current (`hello-spin`) directory to know what application to deploy. It will ask you for a name for the application (defaulting to `hello-spin`) and then it will ask for confirmation that you want to deploy.
531531

532532
{{ details "Learn more" "Deploying a Spin application to _Fermyon Wasm Functions_ includes packaging the application and all the required files, uploading it to an OCI registry, as well as instantiating the application on _Fermyon Wasm Functions_. " }}
533533

@@ -538,12 +538,15 @@ This is what a successful Spin application deployment on Fermyon Wasm Functions
538538
<!-- @nocpy -->
539539

540540
```console
541-
Pushing app to the Registry....
542-
App 'hello-spin' initialized successfully.
543-
Waiting for application to be ready... ready
544-
545-
Application deployed to https://ac465a57-8d62-443e-a8ed-f50872dd17b7.aka.fermyon.tech/
546-
View application: https://ac465a57-8d62-443e-a8ed-f50872dd17b7.aka.fermyon.tech/
541+
Name of new app: hello-spin
542+
Creating new app hello-spin in account your-account
543+
Note: If you would instead like to deploy to an existing app, cancel this deploy and link this workspace to the app with `spin aka app link`
544+
OK to continue? yes
545+
Workspace linked to app hello-spin
546+
Waiting for app to be ready... ready
547+
548+
App Routes:
549+
- hello-spin: https://ec8a19d8-6d10-4056-bb69-cc864306b489.aka.fermyon.tech (wildcard)
547550
```
548551

549552
You can `CTRL`+Click on the link in the terminal to visit the web application you just deployed.

content/wasm-functions/stream-data-from-linode-object-store.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,15 @@ Deployment to _Fermyon Wasm Functions_ will take a couple of seconds, once the d
363363
<!-- @nocpy -->
364364

365365
```console
366-
App 'linode-streaming-app' initialized successfully.
367-
Waiting for application to be ready... ready
368-
369-
View application: https://70b79692-1028-4aa5-9395-e311f44d038b.aka.fermyon.tech/
366+
Name of new app: linode-streaming-app
367+
Creating new app linode-streaming-app in account your-account
368+
Note: If you would instead like to deploy to an existing app, cancel this deploy and link this workspace to the app with `spin aka app link`
369+
OK to continue? yes
370+
Workspace linked to app linode-streaming-app
371+
Waiting for app to be ready... ready
372+
373+
App Routes:
374+
- linode-streaming-app: https://ec8a19d8-6d10-4056-bb69-cc864306b489.aka.fermyon.tech (wildcard)
370375
```
371376

372377
## Conclusion

0 commit comments

Comments
 (0)