{"id":20001150,"url":"https://github.com/apecloud/kb-cloud-client-go","last_synced_at":"2026-01-16T20:36:18.425Z","repository":{"id":258959299,"uuid":"875882521","full_name":"apecloud/kb-cloud-client-go","owner":"apecloud","description":"Golang client for the KubeBlocks Cloud API","archived":false,"fork":false,"pushed_at":"2026-01-12T12:08:11.000Z","size":7660,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-12T13:25:58.432Z","etag":null,"topics":["golang","kb-cloud","kbcloud-api","kubeblocks","kubeblocks-cloud"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/apecloud/kb-cloud-client-go","language":"Go","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/apecloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-21T03:07:36.000Z","updated_at":"2026-01-12T12:07:13.000Z","dependencies_parsed_at":"2024-11-06T10:29:14.705Z","dependency_job_id":"0b1e0556-84a1-48f1-99f5-84d9c85dd116","html_url":"https://github.com/apecloud/kb-cloud-client-go","commit_stats":null,"previous_names":["apecloud/kb-cloud-client-go"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/apecloud/kb-cloud-client-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apecloud%2Fkb-cloud-client-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apecloud%2Fkb-cloud-client-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apecloud%2Fkb-cloud-client-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apecloud%2Fkb-cloud-client-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apecloud","download_url":"https://codeload.github.com/apecloud/kb-cloud-client-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apecloud%2Fkb-cloud-client-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["golang","kb-cloud","kbcloud-api","kubeblocks","kubeblocks-cloud"],"created_at":"2024-11-13T05:16:50.864Z","updated_at":"2026-01-16T20:36:18.408Z","avatar_url":"https://github.com/apecloud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kb-cloud-client-go\n\nThis repository contains a Go API client for the KubeBlocks Cloud API.\n\n## Requirements\n\n* Go 1.22+\n\n## Installation\n\n```bash\ngo get github.com/apecloud/kb-cloud-client-go\n```\n\n## Layout\n\nThe client library contains the following packages:\n\n### The KubeBlocks Cloud API Client\n\nThe main API client is located in the `api/kbcloud` directory. Import it with:\n\n```go\nimport \"github.com/apecloud/kb-cloud-client-go/api/kbcloud\"\n```\n\n### The Admin API Client \n\nThe admin API client is located in the `api/kbcloud/admin` directory. Import it with:\n\n```go\nimport \"github.com/apecloud/kb-cloud-client-go/api/kbcloud/admin\" \n```\n\n### The Data API Client\n\nThe data API client is located in the `api/kbcloud/data` directory. Import it with:\n\n```go\nimport \"github.com/apecloud/kb-cloud-client-go/api/kbcloud/data\"\n```\n\n## Authentication\n\nThe client supports authentication via API Key \u0026 Secret. The recommended way is to use environment variables with NewDefaultContext:\n\n```go\n// Use environment variables:\n// KB_CLOUD_API_KEY_NAME - API key name\n// KB_CLOUD_API_KEY_SECRET - API key secret\n// KB_CLOUD_SITE - Optional site configuration\nctx := common.NewDefaultContext(context.Background())\n```\n\nYou can also configure authentication directly through context:\n\n### API Key \u0026 Secret via Context\n\n```go\nctx := context.WithValue(\n    context.Background(),\n    common.ContextDigestAuth,\n    common.DigestAuth{\n        UserName: os.Getenv(\"KB_CLOUD_API_KEY_NAME\"),\n        Password: os.Getenv(\"KB_CLOUD_API_KEY_SECRET\"),\n    },\n)\n```\n\n## Getting Started\n\nFor complete examples, check out the [examples](./examples) directory.\n\nHere's an example using API key authentication:\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"os\"\n\n    \"github.com/apecloud/kb-cloud-client-go/api/common\"\n    \"github.com/apecloud/kb-cloud-client-go/api/kbcloud\"\n)\n\nfunc main() {\n    // Set up authentication context\n    ctx := context.WithValue(\n        context.Background(),\n        common.ContextDigestAuth,\n        common.DigestAuth{\n            UserName: os.Getenv(\"KB_CLOUD_API_KEY_NAME\"),\n            Password: os.Getenv(\"KB_CLOUD_API_KEY_SECRET\"),\n        },\n    )\n    \n    // Optional: Set site configuration\n    ctx = context.WithValue(\n        ctx,\n        common.ContextServerVariables,\n        map[string]string{\"site\": os.Getenv(\"KB_CLOUD_SITE\")},\n    )\n    \n    orgName := \"my-org\"\n\tclient := common.NewAPIClient(configuration)\n\tfmt.Println(\"Listing environments...\")\n\tapi := kbcloud.NewEnvironmentApi(client)\n\tenvs, resp, err := api.ListEnvironment(ctx, orgName)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error listing environments: %v\\nResponse: %v\", err, resp)\n\t}\n\tfmt.Printf(\"Environments: %+v\\n\\n\", envs)\n}\n```\n\n### Configuration Options\n\n#### Environment Variables\n\nThe client supports the following environment variables:\n\n```bash\n# Authentication\nKB_CLOUD_API_KEY_NAME=your-api-key-name\nKB_CLOUD_API_KEY_SECRET=your-api-key-secret\n\n# Site configuration\nKB_CLOUD_SITE=https://api-test.apecloud.com\n\n# HTTP proxy settings\nHTTP_PROXY=http://proxy.example.com:8080\nHTTPS_PROXY=http://proxy.example.com:8080\n```\n\n#### Server Configuration\n\nConfigure server URL and variables:\n\n```go\nconfiguration := common.NewConfiguration()\n\n// Set server URL\nconfiguration.Host = \"api.example.com\"\n\n// Set server variables\nconfiguration.ServerVariables = map[string]string{\n    \"site\": os.Getenv(\"KB_CLOUD_SITE\"),\n}\n\n// Or use context to set server variables\nctx := context.WithValue(\n    context.Background(),\n    common.ContextServerVariables,\n    map[string]string{\"site\": os.Getenv(\"KB_CLOUD_SITE\")},\n)\n```\n\n#### Debug Mode\n\nEnable debug logging:\n\n```go\nconfiguration := common.NewConfiguration()\nconfiguration.Debug = true\n```\n\n#### Retry Configuration\n\nConfigure retry behavior:\n\n```go\nconfiguration := common.NewConfiguration()\n\n// Configure retry settings\nconfiguration.RetryConfiguration = common.RetryConfiguration{\n    EnableRetry: true,           // Enable/disable retry\n    MaxRetries: 3,               // Maximum number of retries\n    RetryInterval: 2,            // Base retry interval in seconds\n    MaxRetryInterval: 30,        // Maximum retry interval in seconds\n    BackOffBase: 2,              // Exponential backoff base\n    RequestTimeout: 30,          // Request timeout in seconds\n}\n```\n\n#### HTTP Client Configuration\n\nConfigure HTTP client:\n\n```go\nconfiguration := common.NewConfiguration()\n\n// Custom HTTP client\nconfiguration.HTTPClient = \u0026http.Client{\n    Timeout: time.Second * 30,\n    Transport: \u0026http.Transport{\n        MaxIdleConns: 10,\n        MaxIdleConnsPerHost: 10,\n        IdleConnTimeout: 30 * time.Second,\n    },\n}\n\n// Skip TLS verification (not recommended for production)\nctx := context.WithValue(\n    context.Background(),\n    common.ContextInsecureSkipVerify,\n    true,\n)\n```\n\n#### User Agent\n\nConfigure custom user agent:\n\n```go\nconfiguration := common.NewConfiguration()\nconfiguration.UserAgent = \"MyApp/1.0.0\"\n```\n\n#### Default Headers\n\nAdd default headers to all requests:\n\n```go\nconfiguration := common.NewConfiguration()\nconfiguration.AddDefaultHeader(\"Custom-Header\", \"value\")\n```\n\n## Development\n\n### Generate API Client\n\nTo regenerate the API client code:\n\n```bash\n./generate.sh\n```\n\n## Contributing\n\nWe welcome contributions! Please feel free to submit a Pull Request.\n\n## Acknowledgments\n\nThis project's generator is inspired by and built upon the work from [Datadog's API client generator](https://github.com/DataDog/datadog-api-client-go). We are grateful to Datadog for their excellent work and open source contributions.\n\n## License\n\nThis library is distributed under the Apache 2.0 license found in the [LICENSE](./LICENSE) file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapecloud%2Fkb-cloud-client-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapecloud%2Fkb-cloud-client-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapecloud%2Fkb-cloud-client-go/lists"}