Skip to content

Commit b00ddce

Browse files
authored
docs(webhosting): revamp (#1683)
1 parent 6bff518 commit b00ddce

File tree

1 file changed

+63
-59
lines changed

1 file changed

+63
-59
lines changed

api/webhosting/v1alpha1/webhosting_sdk.go

Lines changed: 63 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var (
3939
_ = namegenerator.GetRandomName
4040
)
4141

42-
// API: webhosting API.
42+
// API: web Hosting API.
4343
type API struct {
4444
client *scw.Client
4545
}
@@ -342,7 +342,7 @@ type DNSRecord struct {
342342
// Type: record type.
343343
// Default value: unknown_type
344344
Type DNSRecordType `json:"type"`
345-
// TTL: record time to live.
345+
// TTL: record time-to-live.
346346
TTL uint32 `json:"ttl"`
347347
// Value: record value.
348348
Value string `json:"value"`
@@ -366,41 +366,41 @@ type DNSRecords struct {
366366

367367
// Hosting: hosting.
368368
type Hosting struct {
369-
// ID: ID of the hosting.
369+
// ID: ID of the Web Hosting plan.
370370
ID string `json:"id"`
371-
// OrganizationID: organization ID of the hosting.
371+
// OrganizationID: ID of the Scaleway Organization the Web Hosting plan belongs to.
372372
OrganizationID string `json:"organization_id"`
373-
// ProjectID: project ID of the hosting.
373+
// ProjectID: ID of the Scaleway Project the Web Hosting plan belongs to.
374374
ProjectID string `json:"project_id"`
375-
// UpdatedAt: last update date.
375+
// UpdatedAt: date on which the Web Hosting plan was last updated.
376376
UpdatedAt *time.Time `json:"updated_at"`
377-
// CreatedAt: creation date.
377+
// CreatedAt: date on which the Web Hosting plan was created.
378378
CreatedAt *time.Time `json:"created_at"`
379-
// Status: the hosting status.
379+
// Status: status of the Web Hosting plan.
380380
// Default value: unknown_status
381381
Status HostingStatus `json:"status"`
382382
// PlatformHostname: hostname of the host platform.
383383
PlatformHostname string `json:"platform_hostname"`
384384
// PlatformNumber: number of the host platform.
385385
PlatformNumber *int32 `json:"platform_number"`
386-
// OfferID: ID of the active offer.
386+
// OfferID: ID of the active offer for the Web Hosting plan.
387387
OfferID string `json:"offer_id"`
388-
// OfferName: name of the active offer.
388+
// OfferName: name of the active offer for the Web Hosting plan.
389389
OfferName string `json:"offer_name"`
390-
// Domain: main domain of the hosting.
390+
// Domain: main domain associated with the Web Hosting plan.
391391
Domain string `json:"domain"`
392-
// Tags: tags of the hosting.
392+
// Tags: list of tags associated with the Web Hosting plan.
393393
Tags []string `json:"tags"`
394-
// Options: active options of the hosting.
394+
// Options: array of any options activated for the Web Hosting plan.
395395
Options []*HostingOption `json:"options"`
396-
// DNSStatus: DNS status of the hosting.
396+
// DNSStatus: DNS status of the Web Hosting plan.
397397
// Default value: unknown_dns_status
398398
DNSStatus HostingDNSStatus `json:"dns_status"`
399-
// CpanelURLs: URL to connect to cPanel Dashboard and to Webmail interface.
399+
// CpanelURLs: URL to connect to cPanel dashboard and to Webmail interface.
400400
CpanelURLs *HostingCpanelURLs `json:"cpanel_urls"`
401-
// Username: main hosting cPanel username.
401+
// Username: main Web Hosting cPanel username.
402402
Username string `json:"username"`
403-
// Region: region of the hosting.
403+
// Region: region where the Web Hosting plan is hosted.
404404
Region scw.Region `json:"region"`
405405
}
406406

@@ -420,15 +420,15 @@ type HostingOption struct {
420420

421421
// ListHostingsResponse: list hostings response.
422422
type ListHostingsResponse struct {
423-
// TotalCount: number of returned hostings.
423+
// TotalCount: number of Web Hosting plans returned.
424424
TotalCount uint32 `json:"total_count"`
425-
// Hostings: list of hostings.
425+
// Hostings: list of Web Hosting plans.
426426
Hostings []*Hosting `json:"hostings"`
427427
}
428428

429429
// ListOffersResponse: list offers response.
430430
type ListOffersResponse struct {
431-
// Offers: list of returned offers.
431+
// Offers: list of offers.
432432
Offers []*Offer `json:"offers"`
433433
}
434434

@@ -439,7 +439,7 @@ type Nameserver struct {
439439
// Status: status of the nameserver.
440440
// Default value: unknown_status
441441
Status NameserverStatus `json:"status"`
442-
// IsDefault: if the nameserver is the default.
442+
// IsDefault: defines whether the nameserver is the default one.
443443
IsDefault bool `json:"is_default"`
444444
}
445445

@@ -449,13 +449,13 @@ type Offer struct {
449449
ID string `json:"id"`
450450
// BillingOperationPath: unique identifier used for billing.
451451
BillingOperationPath string `json:"billing_operation_path"`
452-
// Product: offer product.
452+
// Product: product constituting this offer.
453453
Product *OfferProduct `json:"product"`
454-
// Price: offer price.
454+
// Price: price of this offer.
455455
Price *scw.Money `json:"price"`
456-
// Available: if offer is available for a specific hosting.
456+
// Available: if a hosting_id was specified in the call, defines whether this offer is available for that Web Hosting plan to migrate (update) to.
457457
Available bool `json:"available"`
458-
// QuotaWarnings: if not available, return quota warnings.
458+
// QuotaWarnings: quota warnings, if the offer is not available for the specified hosting_id.
459459
QuotaWarnings []OfferQuotaWarning `json:"quota_warnings"`
460460
}
461461

@@ -491,21 +491,22 @@ func (s *API) Regions() []scw.Region {
491491
type CreateHostingRequest struct {
492492
// Region: region to target. If none is passed will use default region from the config.
493493
Region scw.Region `json:"-"`
494-
// OfferID: ID of the selected offer for the hosting.
494+
// OfferID: ID of the selected offer for the Web Hosting plan.
495495
OfferID string `json:"offer_id"`
496-
// ProjectID: project ID of the hosting.
496+
// ProjectID: ID of the Scaleway Project in which to create the Web Hosting plan.
497497
ProjectID string `json:"project_id"`
498-
// Email: contact email of the client for the hosting.
498+
// Email: contact email for the Web Hosting client.
499499
Email *string `json:"email"`
500-
// Tags: the tags of the hosting.
500+
// Tags: list of tags for the Web Hosting plan.
501501
Tags []string `json:"tags"`
502-
// Domain: the domain name of the hosting.
502+
// Domain: domain name to link to the Web Hosting plan. You must already own this domain name, and have completed the DNS validation process beforehand.
503503
Domain string `json:"domain"`
504-
// OptionIDs: iDs of the selected options for the hosting.
504+
// OptionIDs: iDs of any selected additional options for the Web Hosting plan.
505505
OptionIDs []string `json:"option_ids"`
506506
}
507507

508-
// CreateHosting: create a hosting.
508+
// CreateHosting: order a Web Hosting plan.
509+
// Order a Web Hosting plan, specifying the offer type required via the `offer_id` parameter.
509510
func (s *API) CreateHosting(req *CreateHostingRequest, opts ...scw.RequestOption) (*Hosting, error) {
510511
var err error
511512

@@ -546,26 +547,27 @@ func (s *API) CreateHosting(req *CreateHostingRequest, opts ...scw.RequestOption
546547
type ListHostingsRequest struct {
547548
// Region: region to target. If none is passed will use default region from the config.
548549
Region scw.Region `json:"-"`
549-
// Page: a positive integer to choose the page to return.
550+
// Page: page number to return, from the paginated results (must be a positive integer).
550551
Page *int32 `json:"-"`
551-
// PageSize: a positive integer lower or equal to 100 to select the number of items to return.
552+
// PageSize: number of Web Hosting plans to return (must be a positive integer lower or equal to 100).
552553
PageSize *uint32 `json:"-"`
553-
// OrderBy: define the order of the returned hostings.
554+
// OrderBy: sort order for Web Hosting plans in the response.
554555
// Default value: created_at_asc
555556
OrderBy ListHostingsRequestOrderBy `json:"-"`
556-
// Tags: return hostings with these tags.
557+
// Tags: tags to filter for, only Web Hosting plans with matching tags will be returned.
557558
Tags *[]string `json:"-"`
558-
// Statuses: return hostings with these statuses.
559+
// Statuses: statuses to filter for, only Web Hosting plans with matching statuses will be returned.
559560
Statuses []HostingStatus `json:"-"`
560-
// Domain: return hostings with this domain.
561+
// Domain: domain to filter for, only Web Hosting plans associated with this domain will be returned.
561562
Domain *string `json:"-"`
562-
// ProjectID: return hostings from this project ID.
563+
// ProjectID: project ID to filter for, only Web Hosting plans from this Project will be returned.
563564
ProjectID *string `json:"-"`
564-
// OrganizationID: return hostings from this organization ID.
565+
// OrganizationID: organization ID to filter for, only Web Hosting plans from this Organization will be returned.
565566
OrganizationID *string `json:"-"`
566567
}
567568

568-
// ListHostings: list all hostings.
569+
// ListHostings: list all Web Hosting plans.
570+
// List all of your existing Web Hosting plans. Various filters are available to limit the results, including filtering by domain, status, tag and Project ID.
569571
func (s *API) ListHostings(req *ListHostingsRequest, opts ...scw.RequestOption) (*ListHostingsResponse, error) {
570572
var err error
571573

@@ -616,8 +618,8 @@ type GetHostingRequest struct {
616618
HostingID string `json:"-"`
617619
}
618620

619-
// GetHosting: get a hosting.
620-
// Get the details of a Hosting with the given ID.
621+
// GetHosting: get a Web Hosting plan.
622+
// Get the details of one of your existing Web Hosting plans, specified by its `hosting_id`.
621623
func (s *API) GetHosting(req *GetHostingRequest, opts ...scw.RequestOption) (*Hosting, error) {
622624
var err error
623625

@@ -654,17 +656,18 @@ type UpdateHostingRequest struct {
654656
Region scw.Region `json:"-"`
655657
// HostingID: hosting ID.
656658
HostingID string `json:"-"`
657-
// Email: new contact email for the hosting.
659+
// Email: new contact email for the Web Hosting plan.
658660
Email *string `json:"email"`
659-
// Tags: new tags for the hosting.
661+
// Tags: new tags for the Web Hosting plan.
660662
Tags *[]string `json:"tags"`
661-
// OptionIDs: new options IDs for the hosting.
663+
// OptionIDs: iDs of the new options for the Web Hosting plan.
662664
OptionIDs *[]string `json:"option_ids"`
663-
// OfferID: new offer ID for the hosting.
665+
// OfferID: ID of the new offer for the Web Hosting plan.
664666
OfferID *string `json:"offer_id"`
665667
}
666668

667-
// UpdateHosting: update a hosting.
669+
// UpdateHosting: update a Web Hosting plan.
670+
// Update the details of one of your existing Web Hosting plans, specified by its `hosting_id`. You can update parameters including the contact email address, tags, options and offer.
668671
func (s *API) UpdateHosting(req *UpdateHostingRequest, opts ...scw.RequestOption) (*Hosting, error) {
669672
var err error
670673

@@ -708,8 +711,8 @@ type DeleteHostingRequest struct {
708711
HostingID string `json:"-"`
709712
}
710713

711-
// DeleteHosting: delete a hosting.
712-
// Delete a hosting with the given ID.
714+
// DeleteHosting: delete a Web Hosting plan.
715+
// Delete a Web Hosting plan, specified by its `hosting_id`. Note that deletion is not immediate: it will take place at the end of the calendar month, after which time your Web Hosting plan and all its data (files and emails) will be irreversibly lost.
713716
func (s *API) DeleteHosting(req *DeleteHostingRequest, opts ...scw.RequestOption) (*Hosting, error) {
714717
var err error
715718

@@ -748,8 +751,8 @@ type RestoreHostingRequest struct {
748751
HostingID string `json:"-"`
749752
}
750753

751-
// RestoreHosting: restore a hosting.
752-
// Restore a hosting with the given ID.
754+
// RestoreHosting: restore a Web Hosting plan.
755+
// When you [delete a Web Hosting plan](#path-hostings-delete-a-hosting), definitive deletion does not take place until the end of the calendar month. In the time between initiating the deletion, and definitive deletion at the end of the month, you can choose to **restore** the Web Hosting plan, using this endpoint and specifying its `hosting_id`.
753756
func (s *API) RestoreHosting(req *RestoreHostingRequest, opts ...scw.RequestOption) (*Hosting, error) {
754757
var err error
755758

@@ -789,12 +792,12 @@ func (s *API) RestoreHosting(req *RestoreHostingRequest, opts ...scw.RequestOpti
789792
type GetDomainDNSRecordsRequest struct {
790793
// Region: region to target. If none is passed will use default region from the config.
791794
Region scw.Region `json:"-"`
792-
// Domain: domain associated to the DNS records.
795+
// Domain: domain associated with the DNS records.
793796
Domain string `json:"-"`
794797
}
795798

796-
// GetDomainDNSRecords: get the DNS records.
797-
// The set of DNS record of a specific domain associated to a hosting.
799+
// GetDomainDNSRecords: get DNS records.
800+
// Get the set of DNS records of a specified domain associated with a Web Hosting plan.
798801
func (s *API) GetDomainDNSRecords(req *GetDomainDNSRecordsRequest, opts ...scw.RequestOption) (*DNSRecords, error) {
799802
var err error
800803

@@ -829,18 +832,19 @@ func (s *API) GetDomainDNSRecords(req *GetDomainDNSRecordsRequest, opts ...scw.R
829832
type ListOffersRequest struct {
830833
// Region: region to target. If none is passed will use default region from the config.
831834
Region scw.Region `json:"-"`
832-
// OrderBy: define the order of the returned hostings.
835+
// OrderBy: sort order of offers in the response.
833836
// Default value: price_asc
834837
OrderBy ListOffersRequestOrderBy `json:"-"`
835-
// WithoutOptions: select only offers, no options.
838+
// WithoutOptions: defines whether the response should consist of offers only, without options.
836839
WithoutOptions bool `json:"-"`
837-
// OnlyOptions: select only options.
840+
// OnlyOptions: defines whether the response should consist of options only, without offers.
838841
OnlyOptions bool `json:"-"`
839-
// HostingID: define a specific hosting id (optional).
842+
// HostingID: ID of a Web Hosting plan, to check compatibility with returned offers (in case of wanting to update the plan).
840843
HostingID *string `json:"-"`
841844
}
842845

843846
// ListOffers: list all offers.
847+
// List the different Web Hosting offers, and their options, available to order from Scaleway.
844848
func (s *API) ListOffers(req *ListOffersRequest, opts ...scw.RequestOption) (*ListOffersResponse, error) {
845849
var err error
846850

0 commit comments

Comments
 (0)