mirror of
https://github.com/trycua/computer.git
synced 2026-02-18 12:28:51 -06:00
update API endpoint and api docs
This commit is contained in:
@@ -151,7 +151,8 @@ curl --connect-timeout 6000 \
|
||||
"image": "macos-sequoia-vanilla:latest",
|
||||
"name": "my-vm-name",
|
||||
"registry": "ghcr.io",
|
||||
"organization": "trycua"
|
||||
"organization": "trycua",
|
||||
"noCache": false
|
||||
}' \
|
||||
http://localhost:3000/lume/pull
|
||||
```
|
||||
|
||||
@@ -225,7 +225,7 @@ extension Server {
|
||||
|
||||
do {
|
||||
let vmController = LumeController()
|
||||
try await vmController.pullImage(image: request.image, name: request.name, registry: request.registry, organization: request.organization)
|
||||
try await vmController.pullImage(image: request.image, name: request.name, registry: request.registry, organization: request.organization, noCache: request.noCache)
|
||||
return HTTPResponse(
|
||||
statusCode: .ok,
|
||||
headers: ["Content-Type": "application/json"],
|
||||
@@ -322,4 +322,4 @@ extension Server {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,9 +37,10 @@ struct PullRequest: Codable {
|
||||
let name: String?
|
||||
var registry: String
|
||||
var organization: String
|
||||
var noCache: Bool
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case image, name, registry, organization
|
||||
case image, name, registry, organization, noCache
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
@@ -48,6 +49,7 @@ struct PullRequest: Codable {
|
||||
name = try container.decodeIfPresent(String.self, forKey: .name)
|
||||
registry = try container.decodeIfPresent(String.self, forKey: .registry) ?? "ghcr.io"
|
||||
organization = try container.decodeIfPresent(String.self, forKey: .organization) ?? "trycua"
|
||||
noCache = try container.decodeIfPresent(Bool.self, forKey: .noCache) ?? false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,4 +93,4 @@ struct SetVMRequest: Codable {
|
||||
struct CloneRequest: Codable {
|
||||
let name: String
|
||||
let newName: String
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user