Skip to content

Commit d3a4820

Browse files
committed
refactor(wit): Rename ip.allocate to allocate-unsafe
1 parent 2f0b920 commit d3a4820

5 files changed

Lines changed: 13 additions & 10 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ obelisk client execution submit -f obelisk-flyio:activity-fly-http/ips@1.0.0-bet
5959
```
6060
Allocate an IP:
6161
```sh
62-
IP=$(obelisk client execution submit -f --json obelisk-flyio:activity-fly-http/ips@1.0.0-beta.allocate -- \
62+
IP=$(obelisk client execution submit -f --json obelisk-flyio:activity-fly-http/ips@1.0.0-beta.allocate-unsafe -- \
6363
\"$FLY_APP_NAME\" '{ "config":{ "ipv6": {"region": null} } }' | jq -r '.[-1].ok' )
6464
```
6565
Release an IP:

activity/fly-http/impl/src/ips.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ where
172172
}
173173

174174
impl ips::Guest for crate::Component {
175-
fn allocate(app_name: String, request: ips::IpRequest) -> Result<ips::IpAddress, String> {
175+
fn allocate_unsafe(
176+
app_name: String,
177+
request: ips::IpRequest,
178+
) -> Result<ips::IpAddress, String> {
176179
(|| {
177180
let app_name = AppName::new(app_name)?;
178181
block_on(allocate_ip(app_name, request))

activity/fly-http/wit/gen/obelisk-flyio_activity-fly-http-obelisk-ext@1.0.0-beta/activity-fly-http-obelisk-ext.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ interface ips {
203203

204204
type ip-address = string;
205205

206-
allocate-submit: func(join-set: borrow<join-set>, app-name: string, request: ip-request) -> execution-id;
206+
allocate-unsafe-submit: func(join-set: borrow<join-set>, app-name: string, request: ip-request) -> execution-id;
207207

208-
allocate-await-next: func(join-set: borrow<join-set>) -> result<tuple<execution-id, result<ip-address, string>>, await-next-extension-error>;
208+
allocate-unsafe-await-next: func(join-set: borrow<join-set>) -> result<tuple<execution-id, result<ip-address, string>>, await-next-extension-error>;
209209

210-
allocate-get: func(execution-id: execution-id) -> result<result<ip-address, string>, get-extension-error>;
210+
allocate-unsafe-get: func(execution-id: execution-id) -> result<result<ip-address, string>, get-extension-error>;
211211

212-
allocate-invoke: func(label: string, app-name: string, request: ip-request) -> result<result<ip-address, string>, invoke-extension-error>;
212+
allocate-unsafe-invoke: func(label: string, app-name: string, request: ip-request) -> result<result<ip-address, string>, invoke-extension-error>;
213213

214214
list-submit: func(join-set: borrow<join-set>, app-name: string) -> execution-id;
215215

activity/fly-http/wit/gen/obelisk-flyio_activity-fly-http-obelisk-schedule@1.0.0-beta/activity-fly-http-obelisk-schedule.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ interface ips {
8282

8383
type ip-address = string;
8484

85-
allocate-schedule: func(schedule-at: schedule-at, app-name: string, request: ip-request) -> execution-id;
85+
allocate-unsafe-schedule: func(schedule-at: schedule-at, app-name: string, request: ip-request) -> execution-id;
8686

8787
list-schedule: func(schedule-at: schedule-at, app-name: string) -> execution-id;
8888

activity/fly-http/wit/obelisk-flyio_activity-fly-http@1.0.0-beta/fly.wit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ interface ips {
5454
ip-variant: ip-variant,
5555
}
5656

57-
/// Allocate an IP address
58-
/// Idempotency note: Retry of a success will allocate another IP address.
57+
/// Allocate an IP address.
58+
/// Non idempotent: Retry of a success will allocate another IP address.
5959
/// Upon allocating an IP the caller should use `list` and `release` to prevent this issue.
60-
allocate: func(app-name: string, request: ip-request) -> result<ip-address, string>;
60+
allocate-unsafe: func(app-name: string, request: ip-request) -> result<ip-address, string>;
6161

6262
/// List allocated IP addresses
6363
%list: func(app-name: string) -> result<list<ip-detail>, string>;

0 commit comments

Comments
 (0)