Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
inference_registry_credentials = client.cloud.inference.registry_credentials.replace(
credential_name="docker-io",
project_id=1,
password="password",
registry_url="registry.example.com",
username="username",
)
print(inference_registry_credentials.project_id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
inferenceRegistryCredentials, err := client.Cloud.Inference.RegistryCredentials.Replace(
context.TODO(),
"docker-io",
cloud.InferenceRegistryCredentialReplaceParams{
ProjectID: gcore.Int(1),
Password: "password",
RegistryURL: "registry.example.com",
Username: "username",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", inferenceRegistryCredentials.ProjectID)
}curl --request PUT \
--url https://api.gcore.com/cloud/v3/inference/{project_id}/registry_credentials/{credential_name} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"password": "password",
"registry_url": "registry.example.com",
"username": "username"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
password: 'password',
registry_url: 'registry.example.com',
username: 'username'
})
};
fetch('https://api.gcore.com/cloud/v3/inference/{project_id}/registry_credentials/{credential_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v3/inference/{project_id}/registry_credentials/{credential_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'password' => 'password',
'registry_url' => 'registry.example.com',
'username' => 'username'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.gcore.com/cloud/v3/inference/{project_id}/registry_credentials/{credential_name}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"password\": \"password\",\n \"registry_url\": \"registry.example.com\",\n \"username\": \"username\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v3/inference/{project_id}/registry_credentials/{credential_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"password\": \"password\",\n \"registry_url\": \"registry.example.com\",\n \"username\": \"username\"\n}"
response = http.request(request)
puts response.read_body{
"name": "docker-io",
"project_id": 1,
"registry_url": "registry.example.com",
"username": "username"
}Everywhere Inference
Replace inference registry credential
PUT
/
cloud
/
v3
/
inference
/
{project_id}
/
registry_credentials
/
{credential_name}
Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
inference_registry_credentials = client.cloud.inference.registry_credentials.replace(
credential_name="docker-io",
project_id=1,
password="password",
registry_url="registry.example.com",
username="username",
)
print(inference_registry_credentials.project_id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
inferenceRegistryCredentials, err := client.Cloud.Inference.RegistryCredentials.Replace(
context.TODO(),
"docker-io",
cloud.InferenceRegistryCredentialReplaceParams{
ProjectID: gcore.Int(1),
Password: "password",
RegistryURL: "registry.example.com",
Username: "username",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", inferenceRegistryCredentials.ProjectID)
}curl --request PUT \
--url https://api.gcore.com/cloud/v3/inference/{project_id}/registry_credentials/{credential_name} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"password": "password",
"registry_url": "registry.example.com",
"username": "username"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
password: 'password',
registry_url: 'registry.example.com',
username: 'username'
})
};
fetch('https://api.gcore.com/cloud/v3/inference/{project_id}/registry_credentials/{credential_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v3/inference/{project_id}/registry_credentials/{credential_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'password' => 'password',
'registry_url' => 'registry.example.com',
'username' => 'username'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.gcore.com/cloud/v3/inference/{project_id}/registry_credentials/{credential_name}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"password\": \"password\",\n \"registry_url\": \"registry.example.com\",\n \"username\": \"username\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v3/inference/{project_id}/registry_credentials/{credential_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"password\": \"password\",\n \"registry_url\": \"registry.example.com\",\n \"username\": \"username\"\n}"
response = http.request(request)
puts response.read_body{
"name": "docker-io",
"project_id": 1,
"registry_url": "registry.example.com",
"username": "username"
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Path Parameters
Project ID
Example:
1
Registry credential name.
Minimum string length:
4Pattern:
^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Example:
"docker-io"
Body
application/json
Response
200 - application/json
OK
Registry credential name.
Minimum string length:
4Pattern:
^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Example:
"docker-io"
Project ID to which the inference registry credentials belongs.
Example:
1
Registry URL.
Example:
"registry.example.com"
Registry username.
Example:
"username"
Was this page helpful?
⌘I