diff --git a/libs/lume/docs/API-Reference.md b/libs/lume/docs/API-Reference.md index 569f919a..71447b36 100644 --- a/libs/lume/docs/API-Reference.md +++ b/libs/lume/docs/API-Reference.md @@ -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 ``` diff --git a/libs/lume/src/Server/Handlers.swift b/libs/lume/src/Server/Handlers.swift index affecfd4..3fe03565 100644 --- a/libs/lume/src/Server/Handlers.swift +++ b/libs/lume/src/Server/Handlers.swift @@ -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 { } } } -} \ No newline at end of file +} diff --git a/libs/lume/src/Server/Requests.swift b/libs/lume/src/Server/Requests.swift index e3f86a61..3db114e6 100644 --- a/libs/lume/src/Server/Requests.swift +++ b/libs/lume/src/Server/Requests.swift @@ -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 -} \ No newline at end of file +}