{"id":20725056,"url":"https://github.com/koordinator-sh/client-java","last_synced_at":"2025-10-03T19:53:52.130Z","repository":{"id":182045618,"uuid":"667762539","full_name":"koordinator-sh/client-java","owner":"koordinator-sh","description":"Java client library for Koordinator","archived":false,"fork":false,"pushed_at":"2025-08-14T04:34:19.000Z","size":81,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-08-14T06:21:15.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://koordinator.sh","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koordinator-sh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-18T08:45:17.000Z","updated_at":"2023-07-19T02:22:03.000Z","dependencies_parsed_at":"2025-01-17T23:37:23.001Z","dependency_job_id":null,"html_url":"https://github.com/koordinator-sh/client-java","commit_stats":null,"previous_names":["koordinator-sh/client-java"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/koordinator-sh/client-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koordinator-sh%2Fclient-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koordinator-sh%2Fclient-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koordinator-sh%2Fclient-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koordinator-sh%2Fclient-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koordinator-sh","download_url":"https://codeload.github.com/koordinator-sh/client-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koordinator-sh%2Fclient-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278219766,"owners_count":25950350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T04:17:11.468Z","updated_at":"2025-10-03T19:53:52.072Z","avatar_url":"https://github.com/koordinator-sh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Koordinator Java Client\n\nJava client for the [Koordinator](https://koordinator.sh/) API.\n\n## Usage\n\nAdd this dependency to your project's POM:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003esh.koordinator\u003c/groupId\u003e\n    \u003cartifactId\u003eclient-java\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n**Note that this package has not been uploaded to the maven official repository. Currently, you should manually download this repo and package it to use.**\n\nYou should also add the dependency of Kubernetes official java SDK:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.kubernetes\u003c/groupId\u003e\n    \u003cartifactId\u003eclient-java\u003c/artifactId\u003e\n    \u003cversion\u003e16.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Manually package\n\nAt first generate the JAR by executing:\n\n    mvn package\n\nThen manually install the following JARs:\n\n* target/client-java-1.3.0.jar\n\n## Getting Started\n\n```java\npackage sh.koordinator.scheduling.models;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.List;\n\nimport io.kubernetes.client.custom.Quantity;\nimport io.kubernetes.client.openapi.ApiClient;\nimport io.kubernetes.client.openapi.models.V1Container;\nimport io.kubernetes.client.openapi.models.V1ObjectMeta;\nimport io.kubernetes.client.openapi.models.V1PodSpec;\nimport io.kubernetes.client.openapi.models.V1PodTemplateSpec;\nimport io.kubernetes.client.openapi.models.V1ResourceRequirements;\nimport io.kubernetes.client.util.Config;\nimport io.kubernetes.client.util.generic.GenericKubernetesApi;\nimport io.kubernetes.client.util.generic.KubernetesApiResponse;\nimport org.junit.Test;\nimport sh.koordinator.scheduling.models.V1alpha1ReservationSpec.AllocatePolicyEnum;\n\npublic class V1alpha1ReservationTest {\n    private static final String API_GROUP = \"scheduling.koordinator.sh\";\n    private static final String API_VERSION = \"v1alpha1\";\n    private static final String RESOURCE_PLURAL = \"reservations\";\n    private static final String API_VERSION_DETAIL = API_GROUP + \"/\" + API_VERSION;\n    private static final String API_KIND = \"Reservation\";\n\n    @Test\n    public void testCreateReservation() throws IOException {\n        ApiClient apiClient = Config.defaultClient();\n        GenericKubernetesApi\u003cV1alpha1Reservation, V1alpha1ReservationList\u003e reservationClient = new GenericKubernetesApi\u003c\u003e(\n            V1alpha1Reservation.class,\n            V1alpha1ReservationList.class,\n            API_GROUP,\n            API_VERSION,\n            RESOURCE_PLURAL,\n            apiClient);\n        V1ObjectMeta objectMeta = new V1ObjectMeta().name(\"test-reservation\");\n        V1alpha1ReservationSpecOwners owners = new V1alpha1ReservationSpecOwners()\n            .labelSelector(\n                new V1alpha1ReservationSpecLabelSelector()\n                    .matchLabels(\n                        new HashMap\u003cString, String\u003e(){{\n                            put(\"app\", \"test\");\n                        }}\n                    )\n            );\n        List\u003cV1Container\u003e containerList = new ArrayList\u003c\u003e(\n            Collections.singletonList(\n                new V1Container()\n                    .name(\"main\")\n                    .resources(\n                        new V1ResourceRequirements()\n                            .limits(\n                                new HashMap\u003cString, Quantity\u003e() {{\n                                    put(\"cpu\", Quantity.fromString(\"2\"));\n                                    put(\"memory\", Quantity.fromString(\"4Gi\"));\n                                }}\n                            )\n                    )\n            )\n        );\n        V1alpha1ReservationSpec reservationSpec = new V1alpha1ReservationSpec()\n            .allocateOnce(false)\n            .addOwnersItem(owners)\n            .allocatePolicy(AllocatePolicyEnum.RESTRICTED)\n            .template(new V1PodTemplateSpec().spec(new V1PodSpec().containers(containerList)));\n        V1alpha1Reservation reservation = new V1alpha1Reservation()\n            .apiVersion(API_VERSION_DETAIL)\n            .kind(API_KIND)\n            .metadata(objectMeta)\n            .spec(reservationSpec);\n        KubernetesApiResponse\u003cV1alpha1Reservation\u003e response = reservationClient.create(reservation);\n        System.out.println(response.getStatus());\n        System.out.println(response.getObject());\n        assert reservation.getMetadata() != null;\n        reservationClient.delete(reservation.getMetadata().getName());\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoordinator-sh%2Fclient-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoordinator-sh%2Fclient-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoordinator-sh%2Fclient-java/lists"}