@@ -22,16 +22,15 @@ func GetGeneratedCommands() *core.Commands {
2222 ipfsRoot (),
2323 ipfsIpfs (),
2424 ipfsVolume (),
25- ipfsToken (),
2625 ipfsVolumeCreate (),
2726 ipfsVolumeGet (),
2827 ipfsVolumeList (),
2928 ipfsVolumeUpdate (),
3029 ipfsVolumeDelete (),
3130 ipfsIpfsAddURL (),
3231 ipfsIpfsAddCid (),
33- ipfsIpfsAddFile (),
3432 ipfsIpfsGetPinID (),
33+ ipfsIpfsListPins (),
3534 ipfsIpfsRmPinID (),
3635 )
3736}
@@ -45,8 +44,8 @@ func ipfsRoot() *core.Command {
4544
4645func ipfsIpfs () * core.Command {
4746 return & core.Command {
48- Short : `add content in s3 bucket ` ,
49- Long : `add content in s3 bucket .` ,
47+ Short : `add content by cid or url and manage pins ` ,
48+ Long : `add content by cid or url and manage pins .` ,
5049 Namespace : "ipfs" ,
5150 Resource : "ipfs" ,
5251 }
@@ -61,19 +60,10 @@ func ipfsVolume() *core.Command {
6160 }
6261}
6362
64- func ipfsToken () * core.Command {
65- return & core.Command {
66- Short : `manage token in ipfs cli` ,
67- Long : `manage token in ipfs cli.` ,
68- Namespace : "ipfs" ,
69- Resource : "token" ,
70- }
71- }
72-
7363func ipfsVolumeCreate () * core.Command {
7464 return & core.Command {
75- Short : `Create volume in S3 bucket ` ,
76- Long : `Create volume in S3 bucket .` ,
65+ Short : `Create volume` ,
66+ Long : `Create volume.` ,
7767 Namespace : "ipfs" ,
7868 Resource : "volume" ,
7969 Verb : "create" ,
@@ -212,8 +202,8 @@ func ipfsVolumeUpdate() *core.Command {
212202
213203func ipfsVolumeDelete () * core.Command {
214204 return & core.Command {
215- Short : `Delete volume in S3 bucket ` ,
216- Long : `Delete volume in S3 bucket .` ,
205+ Short : `Delete volume` ,
206+ Long : `Delete volume.` ,
217207 Namespace : "ipfs" ,
218208 Resource : "volume" ,
219209 Verb : "delete" ,
@@ -247,8 +237,8 @@ func ipfsVolumeDelete() *core.Command {
247237
248238func ipfsIpfsAddURL () * core.Command {
249239 return & core.Command {
250- Short : `Add content in s3 bucket ` ,
251- Long : `Add content in s3 bucket .` ,
240+ Short : `Add content in volume by url ` ,
241+ Long : `Add content in volume by url .` ,
252242 Namespace : "ipfs" ,
253243 Resource : "ipfs" ,
254244 Verb : "add-url" ,
@@ -300,8 +290,8 @@ func ipfsIpfsAddURL() *core.Command {
300290
301291func ipfsIpfsAddCid () * core.Command {
302292 return & core.Command {
303- Short : `Add content in s3 bucket ` ,
304- Long : `Add content in s3 bucket .` ,
293+ Short : `Add content in volume by cid ` ,
294+ Long : `Add content in volume by cid .` ,
305295 Namespace : "ipfs" ,
306296 Resource : "ipfs" ,
307297 Verb : "add-cid" ,
@@ -363,15 +353,15 @@ func ipfsIpfsAddCid() *core.Command {
363353 }
364354}
365355
366- func ipfsIpfsAddFile () * core.Command {
356+ func ipfsIpfsGetPinID () * core.Command {
367357 return & core.Command {
368- Short : `Add content in s3 bucket ` ,
369- Long : `Add content in s3 bucket .` ,
358+ Short : `Get pin id in volume ` ,
359+ Long : `Get pin id in volume .` ,
370360 Namespace : "ipfs" ,
371361 Resource : "ipfs" ,
372- Verb : "add-file " ,
362+ Verb : "get-pin-id " ,
373363 // Deprecated: false,
374- ArgsType : reflect .TypeOf (ipfs.CreatePinByRawRequest {}),
364+ ArgsType : reflect .TypeOf (ipfs.GetPinRequest {}),
375365 ArgSpecs : core.ArgSpecs {
376366 {
377367 Name : "volume-id" ,
@@ -380,57 +370,33 @@ func ipfsIpfsAddFile() *core.Command {
380370 Positional : false ,
381371 },
382372 {
383- Name : "content" ,
384- Required : false ,
385- Deprecated : false ,
386- Positional : false ,
387- },
388- {
389- Name : "mime-type" ,
390- Required : false ,
391- Deprecated : false ,
392- Positional : false ,
393- },
394- {
395- Name : "name" ,
396- Required : false ,
397- Deprecated : false ,
398- Positional : false ,
399- },
400- {
401- Name : "pin-options.required-zones.{index}" ,
402- Required : false ,
403- Deprecated : false ,
404- Positional : false ,
405- },
406- {
407- Name : "pin-options.replication-count" ,
408- Required : false ,
373+ Name : "pin-id" ,
374+ Required : true ,
409375 Deprecated : false ,
410376 Positional : false ,
411377 },
412378 core .RegionArgSpec (scw .RegionFrPar , scw .RegionNlAms , scw .RegionPlWaw ),
413379 },
414380 Run : func (ctx context.Context , args interface {}) (i interface {}, e error ) {
415- request := args .(* ipfs.CreatePinByRawRequest )
381+ request := args .(* ipfs.GetPinRequest )
416382
417383 client := core .ExtractClient (ctx )
418384 api := ipfs .NewAPI (client )
419- return api .CreatePinByRaw (request )
385+ return api .GetPin (request )
420386
421387 },
422388 }
423389}
424390
425- func ipfsIpfsGetPinID () * core.Command {
391+ func ipfsIpfsListPins () * core.Command {
426392 return & core.Command {
427- Short : `Get pin id create when content is add in s3 bucket ` ,
428- Long : `Get pin id create when content is add in s3 bucket .` ,
393+ Short : `List pins in specific volume ` ,
394+ Long : `List pins in specific volume .` ,
429395 Namespace : "ipfs" ,
430396 Resource : "ipfs" ,
431- Verb : "get-pin-id " ,
397+ Verb : "list-pins " ,
432398 // Deprecated: false,
433- ArgsType : reflect .TypeOf (ipfs.GetPinRequest {}),
399+ ArgsType : reflect .TypeOf (ipfs.ListPinsRequest {}),
434400 ArgSpecs : core.ArgSpecs {
435401 {
436402 Name : "volume-id" ,
@@ -439,19 +405,48 @@ func ipfsIpfsGetPinID() *core.Command {
439405 Positional : false ,
440406 },
441407 {
442- Name : "pin -id" ,
443- Required : true ,
408+ Name : "project -id" ,
409+ Required : false ,
444410 Deprecated : false ,
445411 Positional : false ,
446412 },
447- core .RegionArgSpec (scw .RegionFrPar , scw .RegionNlAms , scw .RegionPlWaw ),
413+ {
414+ Name : "order-by" ,
415+ Required : false ,
416+ Deprecated : false ,
417+ Positional : false ,
418+ EnumValues : []string {"created_at_asc" , "created_at_desc" },
419+ },
420+ {
421+ Name : "status" ,
422+ Required : false ,
423+ Deprecated : false ,
424+ Positional : false ,
425+ EnumValues : []string {"unknown_status" , "queued" , "pinning" , "failed" , "pinned" },
426+ },
427+ {
428+ Name : "organization-id" ,
429+ Required : false ,
430+ Deprecated : false ,
431+ Positional : false ,
432+ },
433+ core .RegionArgSpec (scw .RegionFrPar , scw .RegionNlAms , scw .RegionPlWaw , scw .Region (core .AllLocalities )),
448434 },
449435 Run : func (ctx context.Context , args interface {}) (i interface {}, e error ) {
450- request := args .(* ipfs.GetPinRequest )
436+ request := args .(* ipfs.ListPinsRequest )
451437
452438 client := core .ExtractClient (ctx )
453439 api := ipfs .NewAPI (client )
454- return api .GetPin (request )
440+ opts := []scw.RequestOption {scw .WithAllPages ()}
441+ if request .Region == scw .Region (core .AllLocalities ) {
442+ opts = append (opts , scw .WithRegions (api .Regions ()... ))
443+ request .Region = ""
444+ }
445+ resp , err := api .ListPins (request , opts ... )
446+ if err != nil {
447+ return nil , err
448+ }
449+ return resp .Pins , nil
455450
456451 },
457452 }
0 commit comments