update API endpoint and api docs

This commit is contained in:
Amit Kumar
2025-03-24 19:08:22 +00:00
parent 475b515964
commit 41fb099b8e
3 changed files with 8 additions and 5 deletions

View File

@@ -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
```

View File

@@ -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 {
}
}
}
}
}

View File

@@ -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
}
}