Documentação da API Alojamento web acessível a todos Visitar a LWS

Ativar ou desativar a renovação automática

PUT https://api.lws.net/v1/hosting/{hosting}/autorenew

operationIdputHostingAutorenew

Ativa ou desativa a renovação automática de um alojamento. Isto afetará tanto o alojamento como o domínio (se aplicável).

Parâmetros do caminho

hosting string obrigatório

O nome de domínio cujas definições de renovação automática pretende alterar

Exemplo: example.com

Corpo do pedido

  • enable boolean

    Ativar (true) ou desativar (false) a renovação automática

    Exemplo: true

    opcional
Exemplo de pedido
{
  "enable": true
}

Respostas

200

Definições de renovação automática alteradas com sucesso

{
  "code": 200,
  "info": "Your hosting's auto-renewal settings has been changed",
  "data": true
}
Campos da resposta 3
  • code integer

    Exemplo: 200

  • info string

    Exemplo: Your hosting's auto-renewal settings has been changed

  • data boolean

    Novo estado da renovação automática. true = ativada, false = desativada

    Exemplo: true

314

Domínio não encontrado na conta

314 não é um código de estado HTTP registado. É específico desta API.

{
  "code": 314,
  "info": "Provided domain has not been found on your account. You must own this domain to manage it."
}
Campos da resposta 2
  • code integer

    Exemplo: 314

  • info string

    Exemplo: Provided domain has not been found on your account. You must own this domain to manage it.

400

Entrada inválida

{
  "code": 400,
  "info": "No auto-renewal status provided. Example: true",
  "data": []
}
Campos da resposta 3
  • code integer

    Exemplo: 400

  • info string

    Exemplo: No auto-renewal status provided. Example: true

  • data any[]
401

Não autorizado - Faltam os cabeçalhos de autenticação

{
  "code": 401,
  "info": "Unauthorized access to the API. Please specify X-Auth-Pass and X-Auth-Login to proceed."
}
Campos da resposta 2
  • code integer

    Exemplo: 401

  • info string

    Exemplo: Unauthorized access to the API. Please specify X-Auth-Pass and X-Auth-Login to proceed.

429

Limite de pedidos excedido

{
  "code": 429,
  "info": "Rate limit exceeded. Please try again later."
}
Campos da resposta 2
  • code integer

    Exemplo: 429

  • info string

    Exemplo: Rate limit exceeded. Please try again later.

500

Erro interno do servidor

{
  "code": 500,
  "info": "Internal Server Error",
  "data": "Error message"
}
Campos da resposta 3
  • code integer

    Exemplo: 500

  • info string

    Exemplo: Internal Server Error

  • data string

    Exemplo: Error message

502

Gateway inválido

{
  "code": 502,
  "info": "Invalid response from upstream server",
  "data": []
}
Campos da resposta 3
  • code integer

    Exemplo: 502

  • info string

    Exemplo: Invalid response from upstream server

  • data object
Mostrar os exemplos de código e a consola de testes
PUT /hosting/{hosting}/autorenew
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X PUT \  "https://api.lws.net/v1/hosting/example.com/autorenew" \  -H "X-Auth-Login: $LWS_AUTH_LOGIN" \  -H "X-Auth-Pass: $LWS_AUTH_PASS" \  -H "Content-Type: application/json" \  -d '{"enable":true}'
$lwsAuthLogin = '…';$lwsAuthPass = '…';$ch = curl_init("https://api.lws.net/v1/hosting/example.com/autorenew");curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [    "X-Auth-Login: " . $lwsAuthLogin,    "X-Auth-Pass: " . $lwsAuthPass,    "Content-Type: application/json",]);curl_setopt($ch, CURLOPT_POSTFIELDS, '{"enable":true}');$res = json_decode(curl_exec($ch), true);
import requestsLWS_AUTH_LOGIN = "…"LWS_AUTH_PASS = "…"res = requests.put(    "https://api.lws.net/v1/hosting/example.com/autorenew",    headers={        "X-Auth-Login": LWS_AUTH_LOGIN,        "X-Auth-Pass": LWS_AUTH_PASS,    },    json={"enable": True},)print(res.json())
const LWS_AUTH_LOGIN = "…";const LWS_AUTH_PASS = "…";const res = await fetch("https://api.lws.net/v1/hosting/example.com/autorenew", {  method: "PUT",  headers: {    "X-Auth-Login": LWS_AUTH_LOGIN,    "X-Auth-Pass": LWS_AUTH_PASS,    "Content-Type": "application/json",  },  body: JSON.stringify({"enable":true}),});const data = await res.json();
lwsAuthLogin := "…"lwsAuthPass := "…"body := strings.NewReader(`{"enable":true}`)req, _ := http.NewRequest("PUT",    "https://api.lws.net/v1/hosting/example.com/autorenew", body)req.Header.Set("X-Auth-Login", lwsAuthLogin)req.Header.Set("X-Auth-Pass", lwsAuthPass)req.Header.Set("Content-Type", "application/json")resp, err := http.DefaultClient.Do(req)