5 Replies Latest reply on Nov 6, 2018 4:28 PM by Mark W Wiseman

    How do I undo a service I've created?

    Mark W Wiseman

      Hi, how are ya?

       

      I am using Ords 18.3

       

      How do I undo a service I've created?

       

      I used ords.enable_object() to create a service called b_bozo.

      Now I want to remove that service.  I tried changing the status to NOT_PUBLISHED but it is still there.

      If I call  in postman ..../open-api-catalog/b_bozo/

      it returns me the swagger(open api) for the non published service b_bozo.

       

      So how do I remove all references to a service once I have used ords.enable_object to create the service?

        • 1. Re: How do I undo a service I've created?
          thatJeffSmith-Oracle

          BEGIN

           

           

              ORDS.ENABLE_OBJECT(p_enabled => FALSE,

                                 p_schema => 'HR',

                                 p_object => 'EMPLOYEES',

                                 p_object_type => 'TABLE',

                                 p_object_alias => 'peeps',

                                 p_auto_rest_auth => FALSE);

           

           

              commit;

           

           

          END;

          • 2. Re: How do I undo a service I've created?
            Mark W Wiseman

            Jeff,

            Thank you for your quick response.

             

            When I call ORDS.ENABLE_OBJECT(p_enabled => FALSE, ...) I still see the service in the user_ords_services view.  The status shows as NOT_PUBLISHED instead of when it is enabled when the status = 'PUBLISHED'

             

            -- Service sitll shows up in this view

            -- query leaves off the source field which is a clob to speed up the query

            SELECT s.method

                  ,s.base_path

                  ,s.pattern

                  ,s.priority

                  ,s.NAME

                  ,s.status

                  ,s.privilege_name

                  ,s.items_per_page

                  ,s.pre_hook

                  ,s.module_id

                  ,s.template_id

                  ,s.handler_id

                  ,s.source_type

            FROM   user_ords_services s

            WHERE  1 = 1

            ORDER  BY 2;

             

            Is there another way to actually make the service go bye-bye instead of just 'NOT_PUBLISHED'?

            • 3. Re: How do I undo a service I've created?
              Pierre Yotti

              Mqrk W Wiseman wrote:

               

              Jeff,

              Thank you for your quick response.

               

              When I call ORDS.ENABLE_OBJECT(p_enabled => FALSE, ...) I still see the service in the user_ords_services view.  The status shows as NOT_PUBLISHED instead of when it is enabled when the status = 'PUBLISHED'

               

              -- Service sitll shows up in this view

              -- query leaves off the source field which is a clob to speed up the query

              SELECT s.method

                    ,s.base_path

                    ,s.pattern

                    ,s.priority

                    ,s.NAME

                    ,s.status

                    ,s.privilege_name

                    ,s.items_per_page

                    ,s.pre_hook

                    ,s.module_id

                    ,s.template_id

                    ,s.handler_id

                    ,s.source_type

              FROM   user_ords_services s

              WHERE  1 = 1

              ORDER  BY 2;

               

              Is there another way to actually make the service go bye-bye instead of just 'NOT_PUBLISHED'?

               

               

              - To remove a Module

               

              BEGIN
                ORDS.DEFINE_TEMPLATE(
                  p_module_name => 'my.tickets',
                  p_pattern => '/:id'
                );
              END;
              /
              

               

              https://docs.oracle.com/cd/E56351_01/doc.30/e87809/ORDS-reference.htm#AELIG90214

               

              - delete all auto rest ords metadata associated schema

               

              use drop_rest_for_schema procedure

              • 4. Re: How do I undo a service I've created?
                thatJeffSmith-Oracle

                are we talking about a module or a rest enabled table, view, or procedure?

                • 5. Re: How do I undo a service I've created?
                  Mark W Wiseman

                  Jeff,

                   

                  I am referring specifically to rest enabled objects such as tables, procedures, functions and packages.  It is a package in my case but I duped it with a table as well.

                  The module_id that is listed in the view user_ords_services does not appear in the user_ords_modules view.  I know I can delete those that appear in the user_ords_modules view using the ords.delete_module() routine.

                   

                  I hope there is a way to delete/drop the specific service without using the drop_rest_for_schema procedure that would drop everything rest as mentioned by Pierre Yotti.

                   

                  Fingers crossed...