@@ -575,3 +575,205 @@ Retrieve the Issues associated with a package and version.
575
575
576
576
- **package (str)** - The name of the NPM package.
577
577
- **version (str)** - The version of the NPM Package.
578
+
579
+ labels.list(org_slug)
580
+ """ """ """ """ """ """ """ " "
581
+ List all repository labels for the given organization.
582
+
583
+ ** Usage:**
584
+
585
+ .. code- block:: python
586
+
587
+ from socketdev import socketdev
588
+
589
+ socket = socketdev(token = " REPLACE_ME" )
590
+ print (socket.labels.list(" org_slug" ))
591
+
592
+ ** PARAMETERS :**
593
+
594
+ - ** org_slug (str )** – The organization name
595
+
596
+ labels.post(org_slug, label_name)
597
+ """ """ """ """ """ """ """ """ """ """ """ ""
598
+ Create a new label in the organization.
599
+
600
+ **Usage:**
601
+
602
+ .. code-block:: python
603
+
604
+ print(socket.labels.post("org_slug", "my-label"))
605
+
606
+ **PARAMETERS:**
607
+
608
+ - **org_slug (str)** – The organization name
609
+ - **label_name (str)** – Name of the label to create
610
+
611
+ labels.get(org_slug, label_id)
612
+ """ """ """ """ """ """ """ """ """ """ """
613
+ Retrieve a single label by its ID .
614
+
615
+ ** Usage:**
616
+
617
+ .. code- block:: python
618
+
619
+ print (socket.labels.get(" org_slug" , " label_id" ))
620
+
621
+ ** PARAMETERS :**
622
+
623
+ - ** org_slug (str )** – The organization name
624
+ - ** label_id (str )** – The label ID
625
+
626
+ labels.delete(org_slug, label_id)
627
+ """ """ """ """ """ """ """ """ """ """ """ ""
628
+ Delete a label by ID.
629
+
630
+ **Usage:**
631
+
632
+ .. code-block:: python
633
+
634
+ print(socket.labels.delete("org_slug", "label_id"))
635
+
636
+ **PARAMETERS:**
637
+
638
+ - **org_slug (str)** – The organization name
639
+ - **label_id (str)** – The label ID
640
+
641
+ labels.associate(org_slug, label_id, repo_id)
642
+ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ " "
643
+ Associate a label with a repository.
644
+
645
+ ** Usage:**
646
+
647
+ .. code- block:: python
648
+
649
+ print (socket.labels.associate(" org_slug" , 1234 , " repo_id" ))
650
+
651
+ ** PARAMETERS :**
652
+
653
+ - ** org_slug (str )** – The organization name
654
+ - ** label_id (int )** – The label ID
655
+ - ** repo_id (str )** – The repository ID
656
+
657
+ labels.disassociate(org_slug, label_id, repo_id)
658
+ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ "
659
+ Disassociate a label from a repository.
660
+
661
+ ** Usage:**
662
+
663
+ .. code- block:: python
664
+
665
+ print (socket.labels.disassociate(" org_slug" , 1234 , " repo_id" ))
666
+
667
+ ** PARAMETERS :**
668
+
669
+ - ** org_slug (str )** – The organization name
670
+ - ** label_id (int )** – The label ID
671
+ - ** repo_id (str )** – The repository ID
672
+
673
+ labels.setting.get(org_slug, label_id, setting_key)
674
+ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ ""
675
+ Get a setting for a specific label.
676
+
677
+ **Usage:**
678
+
679
+ .. code-block:: python
680
+
681
+ print(socket.labels.setting.get("org_slug", 1234, "severity"))
682
+
683
+ **PARAMETERS:**
684
+
685
+ - **org_slug (str)** – The organization name
686
+ - **label_id (int)** – The label ID
687
+ - **setting_key (str)** – The key of the setting
688
+
689
+ labels.setting.put(org_slug, label_id, settings)
690
+ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """
691
+ Update settings for a specific label.
692
+
693
+ ** Usage:**
694
+
695
+ .. code- block:: python
696
+
697
+ settings = {" severity" : {" value" : {" level" : " high" }}}
698
+ print (socket.labels.setting.put(" org_slug" , 1234 , settings))
699
+
700
+ ** PARAMETERS :**
701
+
702
+ - ** org_slug (str )** – The organization name
703
+ - ** label_id (int )** – The label ID
704
+ - ** settings (dict )** – A dictionary of label settings
705
+
706
+ labels.setting.delete(org_slug, label_id, setting_key)
707
+ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ "
708
+ Delete a setting from a label.
709
+
710
+ ** Usage:**
711
+
712
+ .. code- block:: python
713
+
714
+ print (socket.labels.setting.delete(" org_slug" , 1234 , " severity" ))
715
+
716
+ ** PARAMETERS :**
717
+
718
+ - ** org_slug (str )** – The organization name
719
+ - ** label_id (int )** – The label ID
720
+ - ** setting_key (str )** – The setting key to delete
721
+
722
+ historical.list(org_slug, query_params = None )
723
+ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ ""
724
+ List historical alerts for an organization.
725
+
726
+ **Usage:**
727
+
728
+ .. code-block:: python
729
+
730
+ print(socket.historical.list("org_slug", {"repo": "example-repo"}))
731
+
732
+ **PARAMETERS:**
733
+
734
+ - **org_slug (str)** – The organization name
735
+ - **query_params (dict, optional)** – Optional query parameters
736
+
737
+ historical.trend(org_slug, query_params=None)
738
+ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ " "
739
+ Retrieve alert trend data across time.
740
+
741
+ ** Usage:**
742
+
743
+ .. code- block:: python
744
+
745
+ print (socket.historical.trend(" org_slug" , {" range" : " 30d" }))
746
+
747
+ ** PARAMETERS :**
748
+
749
+ - ** org_slug (str )** – The organization name
750
+ - ** query_params (dict , optional)** – Optional query parameters
751
+
752
+ historical.snapshots.create(org_slug)
753
+ """ """ """ """ """ """ """ """ """ """ """ """ """ "
754
+ Create a new snapshot of historical data.
755
+
756
+ **Usage:**
757
+
758
+ .. code-block:: python
759
+
760
+ print(socket.historical.snapshots.create("org_slug"))
761
+
762
+ **PARAMETERS:**
763
+
764
+ - **org_slug (str)** – The organization name
765
+
766
+ historical.snapshots.list(org_slug, query_params=None)
767
+ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """ """
768
+ List all historical snapshots for an organization.
769
+
770
+ ** Usage:**
771
+
772
+ .. code- block:: python
773
+
774
+ print (socket.historical.snapshots.list(" org_slug" , {" repo" : " example-repo" }))
775
+
776
+ ** PARAMETERS :**
777
+
778
+ - ** org_slug (str )** – The organization name
779
+ - ** query_params (dict , optional)** – Optional query parameters
0 commit comments