MCPcopy Create free account
hub / github.com/algolia/cli / Create

Method Create

api/crawler/client.go:148–165  ·  view source on GitHub ↗

Create creates a new Crawler. It returns the Crawler ID if successful.

(name string, config Config)

Source from the content-addressed store, hash-verified

146// Create creates a new Crawler.
147// It returns the Crawler ID if successful.
148func (c *Client) Create(name string, config Config) (string, error) {
149 var res struct {
150 ID string `json:"id"`
151 }
152 path := "crawlers"
153
154 crawler := &Crawler{
155 Name: name,
156 Config: &config,
157 }
158
159 err := c.request(&res, http.MethodPost, path, crawler, nil)
160 if err != nil {
161 return "", err
162 }
163
164 return res.ID, nil
165}
166
167// List lists Crawlers.
168func (c *Client) List(itemsPerPage, page int, name, appID string) (*CrawlersResponse, error) {

Callers 3

runCreateCmdFunction · 0.80
writeMdxPageTreeFunction · 0.80
GenYamlTreeFunction · 0.80

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected