Wrote something real quick to do this. Following code uses UCF canvasapi and sgqlc module. Sample code, in case someone wants to use it.
You may need to size this to your needs. I have a small tenant with only 80 something courses and there are no issues.
To set course status ...
# gql setup
endpoint = HTTPEndpoint(url=url, base_headers=header)
mutation_op = Operation(schema.Mutation)
# control logic
alias_count = 0
courses = account.get_courses(enrollment_term_id=enrollment_term_id)
for course in courses:
course_id = course.id
query_alias = "gql" + str(alias_count).zfill(3)
alias_count = alias_count + 1
gql_mutate = mutation_op.set_course_post_policy(
input=schema.SetCoursePostPolicyInput(
course_id=course_id,
post_manually=True
),
__alias__=query_alias
)
# print(mutation_op)
endpoint(mutation_op)
To retrieve data use a query instead of mutation.
You can also request additional fields in your mutation query for error handling, retries, logging etc.