예제 #1
0
    def POST(self):
        form = web.input(GUID="",
                         MVID="",
                         video_id="",
                         videoName="",
                         videoDesc="",
                         videoLocation="",
                         videoOwner="",
                         videoSubject="",
                         videoViewers="",
                         videoGroups="")

        # build JWT
        new_jwt = jwt_tools.build_jwt(str(form.GUID))

        # update video on medvid.io
        api_status, return_data, response_msg, api_msg = api_tools_video.video_update(
            new_jwt, form.video_id, form.videoName, form.videoDesc,
            form.videoLocation, form.videoOwner, form.videoSubject,
            form.videoViewers, form.videoGroups)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_video_update(return_data)

        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
예제 #2
0
    def POST(self):
        # Gather data; execute API call
        form = web.input(MVID="",
                         p_id="",
                         g_id="",
                         _create="",
                         _read="",
                         _update="",
                         _delete="",
                         _list="")
        account_jwt = jwt_tools.build_account_jwt()
        api_status, policy_data, response_msg, api_msg = api_tools_policy.policy_update(
            account_jwt, form.MVID, form.p_id, form.g_id, form._create,
            form._read, form._update, form._delete, form._list)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            if form.p_id:
                # If a policy ID exists we are editing an existing policy
                final_output = render_tools.render_policy_manage(
                    policy_data, False)
            else:
                # No policy ID, new policy
                final_output = render_tools.render_policy_manage(
                    policy_data, True)

        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
예제 #3
0
    def POST(self):
        # Gather data; execute API call
        form = web.input(GUID="", MVID="")
        if form.GUID and form.MVID:
            # Run as Application User
            new_jwt = jwt_tools.build_jwt(str(form.GUID))
            group_delete = False
        else:
            # Run as Account User
            new_jwt = jwt_tools.build_account_jwt()
            group_delete = True

        api_status, group_data, response_msg, api_msg = api_tools_group.group_list(
            new_jwt, group_delete, form.GUID, form.MVID)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_group_list(group_data)

        # Display as needed
        return render.group_list(op_status=api_status,
                                 op_guid=form.GUID,
                                 op_mvid=form.MVID,
                                 op_data=final_output,
                                 op_API=render_tools.render_api_msg(api_msg))
예제 #4
0
	def POST(self):
		form = web.input(GUID="", MVID="", videoName="", videoDesc="", videoLoc = "", file_id ="", videoLocation="", videoSubject="", videoViewers="", videoGroups="")
		
		# get local file path from UUID
		file_path = ""
		for x in file_list:
			if x[0] == form.file_id:
				file_path = str(x[1])

		# build JWT
		new_jwt = jwt_tools.build_jwt(str(form.GUID))

		# upload to medvid.io
		api_status, return_data, response_msg, api_msg = api_tools_video.video_post(new_jwt, form.MVID, form.videoName, form.videoDesc, form.videoLoc, file_path, form.videoSubject, form.videoViewers, form.videoGroups)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_video_new(return_data)

		# remove temp file
		os.remove(file_path)

		return render.status(op_status = api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
예제 #5
0
	def POST(self):
		form = web.input(file_id="", GUID="")
		new_jwt = jwt_tools.build_jwt(str(form.GUID))
		api_status, smil_url, response_msg, api_msg = api_tools_video.video_play(new_jwt, form.file_id)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_video_play(smil_url)

		return render.video_play(op_status=api_status, op_data = final_output, op_API = render_tools.render_api_msg(api_msg))
예제 #6
0
	def POST(self):
		form = web.input(policy_id="")
		account_jwt = jwt_tools.build_account_jwt()
		api_status, delete_policy_id, response_msg, api_msg = api_tools_policy.policy_delete(account_jwt, form.policy_id)
		
		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_policy_delete(delete_policy_id)

		return render.status(op_status=api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
예제 #7
0
	def POST(self):
		form = web.input(file_id="", GUID="")
		new_jwt = jwt_tools.build_jwt(str(form.GUID))
		api_status, delete_video_id, response_msg, api_msg = api_tools_video.video_delete(new_jwt, form.file_id)
		
		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_video_delete(delete_video_id)

		return render.status(op_status=api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
예제 #8
0
	def GET(self):
		# Execute API Call
		account_jwt = jwt_tools.build_account_jwt()
		api_status, user_data, response_msg, api_msg = api_tools_user.user_list(account_jwt)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_user_list(user_data)

		# Display as needed
		return render.user_list(op_status = api_status, op_data = final_output, op_API = render_tools.render_api_msg(api_msg))
예제 #9
0
	def POST(self):
		# Gather data; execute API call
		form = web.input(GUID="", MVID="")
		new_jwt = jwt_tools.build_jwt(str(form.GUID))
		api_status, policy_data, response_msg, api_msg = api_tools_policy.policy_list(new_jwt, form.GUID, form.MVID)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_policy_list(policy_data)

		return render.policy_list(op_status = api_status, op_guid = form.GUID, op_mvid = form.MVID, op_data=final_output, op_API = render_tools.render_api_msg(api_msg))
예제 #10
0
	def POST(self):
		# Gather data; execute API call
		form = web.input(GUID="")
		new_jwt = jwt_tools.build_jwt(str(form.GUID))
		api_status, app_user_id, user_id, response_msg, api_msg = api_tools_user.user_profile(new_jwt)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_user_new(app_user_id, user_id)

		# Display as needed
		return render.status(op_status = api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
예제 #11
0
	def POST(self):
		# Gather data; execute API call
		form = web.input(name="")
		account_jwt = jwt_tools.build_account_jwt()
		api_status, new_group_id, new_group_name, response_msg, api_msg = api_tools_group.group_new(account_jwt, form.name)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_group_new(new_group_id, new_group_name)

		# Display as needed
		return render.status(op_status = api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
예제 #12
0
    def POST(self):
        form = web.input(file_id="", GUID="")
        new_jwt = jwt_tools.build_jwt(str(form.GUID))
        api_status, delete_video_id, response_msg, api_msg = api_tools_video.video_delete(
            new_jwt, form.file_id)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_video_delete(delete_video_id)

        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
예제 #13
0
    def POST(self):
        form = web.input(file_id="", GUID="")
        new_jwt = jwt_tools.build_jwt(str(form.GUID))
        api_status, smil_url, response_msg, api_msg = api_tools_video.video_play(
            new_jwt, form.file_id)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_video_play(smil_url)

        return render.video_play(op_status=api_status,
                                 op_data=final_output,
                                 op_API=render_tools.render_api_msg(api_msg))
예제 #14
0
    def POST(self):
        form = web.input(policy_id="")
        account_jwt = jwt_tools.build_account_jwt()
        api_status, delete_policy_id, response_msg, api_msg = api_tools_policy.policy_delete(
            account_jwt, form.policy_id)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_policy_delete(delete_policy_id)

        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
예제 #15
0
	def POST(self):
		form = web.input(GUID="", MVID="", video_id = "", videoName="", videoDesc="", videoLocation="", videoOwner="", videoSubject="", videoViewers="", videoGroups="")

		# build JWT
		new_jwt = jwt_tools.build_jwt(str(form.GUID))

		# update video on medvid.io
		api_status, return_data, response_msg, api_msg = api_tools_video.video_update(new_jwt, form.video_id, form.videoName, form.videoDesc, form.videoLocation, form.videoOwner, form.videoSubject, form.videoViewers, form.videoGroups)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_video_update(return_data)

		return render.status(op_status = api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
예제 #16
0
    def GET(self):
        # Execute API Call
        account_jwt = jwt_tools.build_account_jwt()
        api_status, user_data, response_msg, api_msg = api_tools_user.user_list(
            account_jwt)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_user_list(user_data)

        # Display as needed
        return render.user_list(op_status=api_status,
                                op_data=final_output,
                                op_API=render_tools.render_api_msg(api_msg))
예제 #17
0
    def POST(self):
        # Gather data; execute API call
        form = web.input(GUID="")
        new_jwt = jwt_tools.build_jwt(str(form.GUID))
        api_status, app_user_id, user_id, response_msg, api_msg = api_tools_user.user_profile(
            new_jwt)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_user_new(app_user_id, user_id)

        # Display as needed
        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
예제 #18
0
	def POST(self):
		# Gather data; execute API call
		form = web.input(MVID="", p_id = "", g_id = "", _create = "", _read = "", _update = "", _delete = "", _list = "")
		account_jwt = jwt_tools.build_account_jwt()
		api_status, policy_data, response_msg, api_msg = api_tools_policy.policy_update(account_jwt, form.MVID, form.p_id, form.g_id, form._create, form._read, form._update, form._delete, form._list)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			if form.p_id:
				# If a policy ID exists we are editing an existing policy
				final_output = render_tools.render_policy_manage(policy_data, False)
			else:
				# No policy ID, new policy
				final_output = render_tools.render_policy_manage(policy_data, True)

		return render.status(op_status=api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
예제 #19
0
    def POST(self):
        # Gather data; execute API call
        form = web.input(GUID="", MVID="")
        new_jwt = jwt_tools.build_jwt(str(form.GUID))
        api_status, policy_data, response_msg, api_msg = api_tools_policy.policy_list(
            new_jwt, form.GUID, form.MVID)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_policy_list(policy_data)

        return render.policy_list(op_status=api_status,
                                  op_guid=form.GUID,
                                  op_mvid=form.MVID,
                                  op_data=final_output,
                                  op_API=render_tools.render_api_msg(api_msg))
예제 #20
0
    def POST(self):
        # Gather data; execute API call
        form = web.input(name="")
        account_jwt = jwt_tools.build_account_jwt()
        api_status, new_group_id, new_group_name, response_msg, api_msg = api_tools_group.group_new(
            account_jwt, form.name)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_group_new(
                new_group_id, new_group_name)

        # Display as needed
        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
예제 #21
0
	def POST(self):
		# Gather data; execute API call
		form = web.input(GUID="", MVID="")
		if form.GUID and form.MVID:
			# Run as Application User
			new_jwt = jwt_tools.build_jwt(str(form.GUID))
			group_delete = False
		else:
			# Run as Account User
			new_jwt = jwt_tools.build_account_jwt()
			group_delete = True

		api_status, group_data, response_msg, api_msg = api_tools_group.group_list(new_jwt, group_delete, form.GUID, form.MVID)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_group_list(group_data)
		
		# Display as needed
		return render.group_list(op_status = api_status, op_guid = form.GUID, op_mvid = form.MVID, op_data = final_output, op_API = render_tools.render_api_msg(api_msg))
예제 #22
0
    def POST(self):
        form = web.input(GUID="",
                         MVID="",
                         videoName="",
                         videoDesc="",
                         videoLoc="",
                         file_id="",
                         videoLocation="",
                         videoSubject="",
                         videoViewers="",
                         videoGroups="")

        # get local file path from UUID
        file_path = ""
        for x in file_list:
            if x[0] == form.file_id:
                file_path = str(x[1])

        # build JWT
        new_jwt = jwt_tools.build_jwt(str(form.GUID))

        # upload to medvid.io
        api_status, return_data, response_msg, api_msg = api_tools_video.video_post(
            new_jwt, form.MVID, form.videoName, form.videoDesc, form.videoLoc,
            file_path, form.videoSubject, form.videoViewers, form.videoGroups)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_video_new(return_data)

        # remove temp file
        os.remove(file_path)

        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))