Skip to content

Commit 3de9d4f

Browse files
committed
Add README badges
1 parent 1036de8 commit 3de9d4f

5 files changed

Lines changed: 7 additions & 9 deletions

File tree

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# VastAI.NET
1+
# VastAI.NET [![.NET Build and Test](https://github.com/Alos-no/VastAI.NET/actions/workflows/CI.yml/badge.svg)](https://github.com/Alos-no/VastAI.NET/actions/workflows/CI.yml) [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-27ae60)](https://github.com/Alos-no/VastAI.NET/blob/main/LICENSE.txt) [![NuGet (VastAI.NET)](https://img.shields.io/nuget/v/VastAI.NET?label=VastAI.NET&color=27ae60)](https://www.nuget.org/packages/VastAI.NET/)
22

33
`VastAI.NET` is a typed .NET client for the Vast.ai REST API.
44

5-
It exists so the CLI and future browser host can share the same Vast provider code instead of shelling out to the `vastai` CLI.
6-
75
## Install
86

97
```bash
@@ -75,7 +73,7 @@ search.Filters["inet_down_cost"] = new VastSearchFilter { LessThanOrEqualTo = 1.
7573
var offers = await client.SearchOffersAsync(search);
7674
```
7775

78-
`Order` accepts the Vast CLI shorthand used by this project: `dph_total` sorts ascending, `dlperf_usd-` sorts descending.
76+
`Order` accepts compact Vast-style sort expressions: `dph_total` sorts ascending, `dlperf_usd-` sorts descending.
7977

8078
### GetInstancesAsync
8179

src/VastAI.NET/Models/VastSearchOffersRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ public sealed class VastSearchOffersRequest
99
public int Limit { get; set; } = 10;
1010

1111
/// <summary>
12-
/// Sort expression using the Vast CLI shorthand kept by the trainer profiles.
12+
/// Compact sort expression accepted by this client.
1313
/// A trailing <c>-</c> sorts descending, a trailing <c>+</c> sorts ascending, and no suffix sorts ascending.
1414
/// </summary>
1515
public string Order { get; set; } = "dph_total";
1616

17-
/// <summary>Vast instance type. The trainer uses on-demand rentals by default.</summary>
17+
/// <summary>Vast instance type. Defaults to on-demand rentals.</summary>
1818
public string Type { get; set; } = "on-demand";
1919

2020
/// <summary>Filter fields keyed by Vast offer property name.</summary>

src/VastAI.NET/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Typed .NET client for the Vast.ai REST API.
44

5-
The library owns Vast request/response models, JSON parsing, authentication headers, and HTTP resilience registration. Application hosts should depend on `IVastApiClient` instead of invoking the `vastai` CLI or duplicating Vast DTOs.
5+
The library provides typed request/response models, authentication headers, JSON mapping, runtime client creation, and optional HTTP resilience registration.
66

77
For runtime-created clients, use `VastApiClient.Create(apiKey)` or pass a host-owned `HttpClient` with `VastApiClient.Create(apiKey, httpClient: httpClient)`.
88

src/VastAI.NET/VastApiClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private HttpRequestMessage CreateRequest(HttpMethod method, string relativePath,
145145
return body;
146146
}
147147

148-
/// <summary>Converts the trainer's Vast CLI-style order shorthand into the REST API's list-based order shape.</summary>
148+
/// <summary>Converts a compact sort expression into Vast's REST API list-based order shape.</summary>
149149
private static IReadOnlyList<IReadOnlyList<string>> CreateOrder(string order)
150150
{
151151
var trimmedOrder = string.IsNullOrWhiteSpace(order) ? "dph_total" : order.Trim();

tests/VastAI.NET.Tests/VastApiClientTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public async Task SearchOffersAsync_SendsAuthenticatedBundlesRequestAndParsesOff
5353
Assert.Equal(0.5, offers[0].InternetUpCostPerTb);
5454
}
5555

56-
/// <summary>Search converts the trainer's descending Vast CLI order shorthand to the REST API order-list shape.</summary>
56+
/// <summary>Search converts a descending compact sort expression to the REST API order-list shape.</summary>
5757
[Fact]
5858
public async Task SearchOffersAsync_WithDescendingOrderSuffix_SendsRestOrderList()
5959
{

0 commit comments

Comments
 (0)